diff options
Diffstat (limited to 'app/common/services/api-utils.js')
-rw-r--r-- | app/common/services/api-utils.js | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js index 434ca2f..a9fb99a 100644 --- a/app/common/services/api-utils.js +++ b/app/common/services/api-utils.js @@ -1052,6 +1052,106 @@ window.angular && (function(angular) { return response.data; }); }, + // Even though NTPServers is a network interface specific path + // (e.g. /xyz/openbmc_project/network/eth0/attr/NTPServers) it acts + // like a global setting. Just use eth0 for setting and getting the + // NTP Servers until it is moved to a non-network interface specific + // path like it is in Redfish. TODO: openbmc/phosphor-time-manager#4 + getNTPServers: function() { + return $http({ + method: 'GET', + url: DataService.getHost() + + '/xyz/openbmc_project/network/eth0/attr/NTPServers', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + withCredentials: true + }) + .then(function(response) { + return response.data; + }); + }, + setNTPServers: function(ntpServers) { + return $http({ + method: 'PUT', + url: DataService.getHost() + + '/xyz/openbmc_project/network/eth0/attr/NTPServers', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + withCredentials: true, + data: JSON.stringify({'data': ntpServers}) + }) + .then(function(response) { + return response.data; + }); + }, + setTimeMode: function(timeMode) { + return $http({ + method: 'PUT', + url: DataService.getHost() + + '/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + withCredentials: true, + data: JSON.stringify({'data': timeMode}) + }) + .then(function(response) { + return response.data; + }); + }, + setTimeOwner: function(timeOwner) { + return $http({ + method: 'PUT', + url: DataService.getHost() + + '/xyz/openbmc_project/time/owner/attr/TimeOwner', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + withCredentials: true, + data: JSON.stringify({'data': timeOwner}) + }) + .then(function(response) { + return response.data; + }); + }, + setBMCTime: function(time) { + return $http({ + method: 'PUT', + url: DataService.getHost() + + '/xyz/openbmc_project/time/bmc/attr/Elapsed', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + withCredentials: true, + data: JSON.stringify({'data': time}) + }) + .then(function(response) { + return response.data; + }); + }, + setHostTime: function(time) { + return $http({ + method: 'PUT', + url: DataService.getHost() + + '/xyz/openbmc_project/time/host/attr/Elapsed', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + withCredentials: true, + data: JSON.stringify({'data': time}) + }) + .then(function(response) { + return response.data; + }); + }, getHardwares: function(callback) { $http({ method: 'GET', |