summaryrefslogtreecommitdiffstats
path: root/app/common
diff options
context:
space:
mode:
authorAndrew Geissler <geissonator@yahoo.com>2018-05-03 12:56:15 -0700
committerGunnar Mills <gmills@us.ibm.com>2018-05-14 12:08:32 +0000
commite672c7cd742c43f952a146573f4f9361fbaf742a (patch)
tree5d6ee1089f5102d20f5ff7339039556edadd98fc /app/common
parent9f8af0c8fe9322ffc662912f92b6c7c6c1935c34 (diff)
downloadphosphor-webui-e672c7cd742c43f952a146573f4f9361fbaf742a.tar.gz
phosphor-webui-e672c7cd742c43f952a146573f4f9361fbaf742a.zip
Add utility to set hostname
The user needs the ability to set the hostname in a few different spots. Change-Id: Ia70e7c773d7ff951a505f3297d8eaf1b3d14fa73 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'app/common')
-rw-r--r--app/common/services/api-utils.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 5f4b931..6f81ce1 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -1120,6 +1120,20 @@ window.angular && (function (angular) {
console.log(error);
});
},
+ setHostname: function(hostname){
+ return $http({
+ method: 'PUT',
+ url: DataService.getHost() + "/xyz/openbmc_project/network/config/attr/HostName",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ withCredentials: true,
+ data: JSON.stringify({"data": hostname})
+ }).then(function(response){
+ return response.data;
+ });
+ },
};
return SERVICE;
}]);
OpenPOWER on IntegriCloud