summaryrefslogtreecommitdiffstats
path: root/app/common/services
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2018-05-30 13:07:01 -0500
committerGunnar Mills <gmills@us.ibm.com>2018-06-06 13:48:13 +0000
commitdca79d73337cc1d8528c5f021817ed49ea77188e (patch)
treeb011039166576959e0cdd5136b7abbc00220958c /app/common/services
parent845acdc54ea78424219bd00d50f3332e01f75216 (diff)
downloadphosphor-webui-dca79d73337cc1d8528c5f021817ed49ea77188e.tar.gz
phosphor-webui-dca79d73337cc1d8528c5f021817ed49ea77188e.zip
Set DefaultGateway on "Save settings"
Set the DefaultGateway field when the user selects "Save settings" and accepts the popup. Moved to q.all() with a promise array. Later commits will add to this array and do a check to make sure the field changed before setting the value. Tested: Set the DefaultGateway on a Witherspoon Change-Id: Ica6abe14169f00bc3195f34a08db61ddbc09fa92 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'app/common/services')
-rw-r--r--app/common/services/api-utils.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 71756d4..c8617d3 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -209,6 +209,22 @@ window.angular && (function(angular) {
return response.data;
});
},
+ setDefaultGateway: function(defaultGateway) {
+ return $http({
+ method: 'PUT',
+ url: DataService.getHost() +
+ '/xyz/openbmc_project/network/config/attr/DefaultGateway',
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ withCredentials: true,
+ data: JSON.stringify({'data': defaultGateway})
+ })
+ .then(function(response) {
+ return response.data;
+ });
+ },
getLEDState: function() {
var deferred = $q.defer();
$http({
OpenPOWER on IntegriCloud