summaryrefslogtreecommitdiffstats
path: root/app/common/services
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2018-05-31 13:13:30 -0500
committerGunnar Mills <gmills@us.ibm.com>2018-06-06 13:48:13 +0000
commitcb2c306036c12a86a5f13613634b5355824dd733 (patch)
treecdad0d794acc844c432e2929589863d5703a83cf /app/common/services
parenta45c3852258dd1a468febdda0a5ff8f1c44de538 (diff)
downloadphosphor-webui-cb2c306036c12a86a5f13613634b5355824dd733.tar.gz
phosphor-webui-cb2c306036c12a86a5f13613634b5355824dd733.zip
Set DHCP on "Save settings"
Set the DHCP enabled field when the user selects "Save settings" and accepts the popup. Added a TODO for issue #3154, Rest server should return a proper JSON bool. Resolves openbmc/openbmc#3165 Tested: Set "Obtain an IP address automatically using DHCP" on a Witherspoon. Change-Id: I45c817e3ddd8bf9c4f582460b1f9230e38548ff8 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'app/common/services')
-rw-r--r--app/common/services/api-utils.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 9f1cc23..93b70e1 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -225,6 +225,23 @@ window.angular && (function(angular) {
return response.data;
});
},
+ setDHCPEnabled: function(interfaceName, dhcpEnabled) {
+ return $http({
+ method: 'PUT',
+ url: DataService.getHost() +
+ '/xyz/openbmc_project/network/' + interfaceName +
+ '/attr/DHCPEnabled',
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ withCredentials: true,
+ data: JSON.stringify({'data': dhcpEnabled})
+ })
+ .then(function(response) {
+ return response.data;
+ });
+ },
deleteIPV4: function(interfaceName, networkID) {
return $http({
method: 'POST',
OpenPOWER on IntegriCloud