Switch target API to Valence
This commit moves the UI API calls from the pod manager to the Valence API, which will then forward requests to the pod manager. Currently it's just passing along direct requests, but as the API/controller service is fleshed out more functionality will be added to the UI using the Valence API. Change-Id: Idf352572a2df7e45b76548a9089ef61dea3d360f Closes-bug: #1636958
This commit is contained in:
parent
a8edf431a3
commit
1e1d7fadd8
@ -7,7 +7,7 @@ const ComposeDisplay = React.createClass({
|
||||
|
||||
compose: function() {
|
||||
var data = this.prepareRequest();
|
||||
var url = config.url + '/redfish/v1/Nodes/Actions/Allocate';
|
||||
var url = config.url + '/Nodes/Actions/Allocate';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
|
@ -13,7 +13,7 @@ const Home = React.createClass({
|
||||
*
|
||||
* TODO(ntpttr): Remove this once the compose menu is fully flushed out.
|
||||
*/
|
||||
var url = config.url + '/redfish/v1/Nodes/Actions/Allocate';
|
||||
var url = config.url + '/Nodes/Actions/Allocate';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
|
@ -6,7 +6,7 @@ var util = require('../../util.js');
|
||||
const NodeList = React.createClass({
|
||||
|
||||
delete: function(nodeId) {
|
||||
var url = config.url + '/redfish/v1/Nodes/' + nodeId;
|
||||
var url = config.url + '/Nodes/' + nodeId;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
@ -24,7 +24,7 @@ const NodeList = React.createClass({
|
||||
},
|
||||
|
||||
setBoot: function(nodeId) {
|
||||
var url = config.url + '/redfish/v1/Nodes/' + nodeId;
|
||||
var url = config.url + '/Nodes/' + nodeId;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'PATCH',
|
||||
@ -47,7 +47,7 @@ const NodeList = React.createClass({
|
||||
},
|
||||
|
||||
assemble: function(nodeId) {
|
||||
var url = config.url + '/redfish/v1/Nodes/' + nodeId + '/Actions/ComposedNode.Assemble';
|
||||
var url = config.url + '/Nodes/' + nodeId + '/Actions/ComposedNode.Assemble';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
@ -61,7 +61,7 @@ const NodeList = React.createClass({
|
||||
},
|
||||
|
||||
powerOn: function(nodeId) {
|
||||
var url = config.url + '/redfish/v1/Nodes/' + nodeId + '/Actions/ComposedNode.Reset';
|
||||
var url = config.url + '/Nodes/' + nodeId + '/Actions/ComposedNode.Reset';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
|
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* Configuration file for RSC UI.
|
||||
* Configuration file for RSC UI.
|
||||
*/
|
||||
|
||||
exports.url = "http://127.0.0.1:6000"
|
||||
exports.username = "admin"
|
||||
exports.password = "admin"
|
||||
exports.url = "http://127.0.0.1:8181"
|
||||
|
||||
exports.nodeConfig =
|
||||
{
|
||||
|
@ -1,16 +1,8 @@
|
||||
var config = require('./config.js');
|
||||
var util = require('./util.js');
|
||||
|
||||
// Base64 username:password on client-side, and append into request header
|
||||
$.ajaxSetup({
|
||||
beforeSend: function(xhr) {
|
||||
xhr.setRequestHeader('Authorization',
|
||||
'Basic ' + btoa(config.username + ':' + config.password));
|
||||
}
|
||||
});
|
||||
|
||||
exports.getPods = function(callback) {
|
||||
var url = config.url + '/redfish/v1/Chassis';
|
||||
var url = config.url + '/Chassis';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
@ -28,7 +20,7 @@ exports.getPods = function(callback) {
|
||||
};
|
||||
|
||||
exports.getRacks = function(callback) {
|
||||
var url = config.url + '/redfish/v1/Chassis';
|
||||
var url = config.url + '/Chassis';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
@ -46,7 +38,7 @@ exports.getRacks = function(callback) {
|
||||
};
|
||||
|
||||
exports.getSystems = function(callback) {
|
||||
var url = config.url + '/redfish/v1/Systems';
|
||||
var url = config.url + '/Systems';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
@ -63,7 +55,7 @@ exports.getSystems = function(callback) {
|
||||
};
|
||||
|
||||
exports.getNodes = function(callback) {
|
||||
var url = config.url + '/redfish/v1/Nodes';
|
||||
var url = config.url + '/Nodes';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
@ -80,7 +72,7 @@ exports.getNodes = function(callback) {
|
||||
};
|
||||
|
||||
exports.getStorage = function(callback) {
|
||||
var url = config.url + '/redfish/v1/Services';
|
||||
var url = config.url + '/Services';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
@ -139,6 +131,8 @@ exports.filterChassis = function(memberList, filter) {
|
||||
};
|
||||
|
||||
exports.readAndReturn = function(resource) {
|
||||
// remove redfish from URL for passthrough
|
||||
resource = resource.replace("/redfish/v1", "");
|
||||
var url = config.url + resource;
|
||||
return $.ajax({
|
||||
url: url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user