Merge "Switch target API to Valence"

This commit is contained in:
Jenkins 2016-11-08 19:49:01 +00:00 committed by Gerrit Code Review
commit 97df1e9687
5 changed files with 14 additions and 22 deletions

View File

@ -22,7 +22,7 @@ const ComposeDisplay = React.createClass({
compose: function() { compose: function() {
var data = this.prepareRequest(); var data = this.prepareRequest();
var url = config.url + '/redfish/v1/Nodes/Actions/Allocate'; var url = config.url + '/Nodes/Actions/Allocate';
$.ajax({ $.ajax({
url: url, url: url,
type: 'POST', type: 'POST',

View File

@ -28,7 +28,7 @@ const Home = React.createClass({
* *
* TODO(ntpttr): Remove this once the compose menu is fully flushed out. * 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({ $.ajax({
url: url, url: url,
type: 'POST', type: 'POST',

View File

@ -21,7 +21,7 @@ var util = require('../../util.js');
const NodeList = React.createClass({ const NodeList = React.createClass({
delete: function(nodeId) { delete: function(nodeId) {
var url = config.url + '/redfish/v1/Nodes/' + nodeId; var url = config.url + '/Nodes/' + nodeId;
$.ajax({ $.ajax({
url: url, url: url,
type: 'DELETE', type: 'DELETE',
@ -39,7 +39,7 @@ const NodeList = React.createClass({
}, },
setBoot: function(nodeId) { setBoot: function(nodeId) {
var url = config.url + '/redfish/v1/Nodes/' + nodeId; var url = config.url + '/Nodes/' + nodeId;
$.ajax({ $.ajax({
url: url, url: url,
type: 'PATCH', type: 'PATCH',
@ -62,7 +62,7 @@ const NodeList = React.createClass({
}, },
assemble: function(nodeId) { assemble: function(nodeId) {
var url = config.url + '/redfish/v1/Nodes/' + nodeId + '/Actions/ComposedNode.Assemble'; var url = config.url + '/Nodes/' + nodeId + '/Actions/ComposedNode.Assemble';
$.ajax({ $.ajax({
url: url, url: url,
type: 'POST', type: 'POST',
@ -76,7 +76,7 @@ const NodeList = React.createClass({
}, },
powerOn: function(nodeId) { powerOn: function(nodeId) {
var url = config.url + '/redfish/v1/Nodes/' + nodeId + '/Actions/ComposedNode.Reset'; var url = config.url + '/Nodes/' + nodeId + '/Actions/ComposedNode.Reset';
$.ajax({ $.ajax({
url: url, url: url,
type: 'POST', type: 'POST',

View File

@ -17,9 +17,7 @@
* Configuration file for RSC UI. * Configuration file for RSC UI.
*/ */
exports.url = "http://127.0.0.1:6000" exports.url = "http://127.0.0.1:8181"
exports.username = "admin"
exports.password = "admin"
exports.nodeConfig = exports.nodeConfig =
{ {

View File

@ -16,16 +16,8 @@
var config = require('./config.js'); var config = require('./config.js');
var util = require('./util.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) { exports.getPods = function(callback) {
var url = config.url + '/redfish/v1/Chassis'; var url = config.url + '/Chassis';
$.ajax({ $.ajax({
url: url, url: url,
type: 'GET', type: 'GET',
@ -43,7 +35,7 @@ exports.getPods = function(callback) {
}; };
exports.getRacks = function(callback) { exports.getRacks = function(callback) {
var url = config.url + '/redfish/v1/Chassis'; var url = config.url + '/Chassis';
$.ajax({ $.ajax({
url: url, url: url,
type: 'GET', type: 'GET',
@ -61,7 +53,7 @@ exports.getRacks = function(callback) {
}; };
exports.getSystems = function(callback) { exports.getSystems = function(callback) {
var url = config.url + '/redfish/v1/Systems'; var url = config.url + '/Systems';
$.ajax({ $.ajax({
url: url, url: url,
type: 'GET', type: 'GET',
@ -78,7 +70,7 @@ exports.getSystems = function(callback) {
}; };
exports.getNodes = function(callback) { exports.getNodes = function(callback) {
var url = config.url + '/redfish/v1/Nodes'; var url = config.url + '/Nodes';
$.ajax({ $.ajax({
url: url, url: url,
type: 'GET', type: 'GET',
@ -95,7 +87,7 @@ exports.getNodes = function(callback) {
}; };
exports.getStorage = function(callback) { exports.getStorage = function(callback) {
var url = config.url + '/redfish/v1/Services'; var url = config.url + '/Services';
$.ajax({ $.ajax({
url: url, url: url,
type: 'GET', type: 'GET',
@ -154,6 +146,8 @@ exports.filterChassis = function(memberList, filter) {
}; };
exports.readAndReturn = function(resource) { exports.readAndReturn = function(resource) {
// remove redfish from URL for passthrough
resource = resource.replace("/redfish/v1", "");
var url = config.url + resource; var url = config.url + resource;
return $.ajax({ return $.ajax({
url: url, url: url,