Merge "Switch UI to /v1/systems endpoint"

This commit is contained in:
Jenkins 2017-01-24 17:55:08 +00:00 committed by Gerrit Code Review
commit 623e495791
4 changed files with 24 additions and 25 deletions

View File

@ -69,6 +69,7 @@ Response
- description: node_description
- name: system_name
- power_state: system_power_state
- health: system_health
- chassis_id : system_chassis_id
- assettag: system_assettag
- url_id : system_url_id

View File

@ -55,11 +55,14 @@ const DetailDisplay = React.createClass({
<hr class="separator" />
<p>Name: {data.Name}</p>
<p>Description: {data.Description}</p>
<p>State: {data.Status.State}</p>
<p>Health: {data.Status.Health}</p>
<p>Processor Count: {data.ProcessorSummary.Count}</p>
<p>Processor Model: {data.ProcessorSummary.Model}</p>
<p>Total Memory: {data.MemorySummary.TotalSystemMemoryGiB} GiB</p>
<p>ID: {data.id}</p>
<p>Health: {data.health}</p>
<p>System Storage: {data.storage}</p>
<p>Processor Count: {data.cpu.cores}</p>
<p>Processor Model: {data.cpu.model}</p>
<p>Total Memory: {data.ram} GiB</p>
<p>Network Interfaces: {data.network}</p>
<p>System Location: {data.location}</p>
<input type="button"
class="detail-button"
onClick={() => this.props.onHideDetail()} value="Return" />

View File

@ -21,8 +21,6 @@ exports.getPods = function(callback) {
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
cache: false,
success: function(resp) {
var chassis = this.listItems(resp['Members']);
var pods = this.filterChassis(chassis, 'Pod');
@ -39,8 +37,6 @@ exports.getRacks = function(callback) {
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
cache: false,
success: function(resp) {
var chassis = this.listItems(resp['Members']);
var racks = this.filterChassis(chassis, 'Rack');
@ -53,15 +49,12 @@ exports.getRacks = function(callback) {
};
exports.getSystems = function(callback) {
var url = config.url + '/Systems';
var url = config.url + '/v1/systems';
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
cache: false,
success: function(resp) {
var systems = this.listItems(resp['Members']);
callback(systems);
callback(resp);
}.bind(this),
error: function(xhr, status, err) {
console.error(url, status, err.toString());
@ -74,8 +67,6 @@ exports.getNodes = function(callback) {
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
cache: false,
success: function(resp) {
var nodes = this.listItems(resp['Members']);
callback(nodes);

View File

@ -189,17 +189,21 @@ def systems_list(filters={}):
if not filterPassed:
continue
systemid = lnk.split("/")[-1]
systemuuid = system['UUID']
systemlocation = podmtree.getPath(lnk)
system_id = lnk.split("/")[-1]
system_uuid = system['UUID']
system_name = system['Name']
system_description = system['Description']
system_health = system['Status']['Health']
system_location = podmtree.getPath(lnk)
cpu = system_cpu_details(lnk)
ram = system_ram_details(lnk)
nw = system_network_details(lnk)
network = system_network_details(lnk)
storage = system_storage_details(lnk)
system = {"id": systemid, "cpu": cpu,
"ram": ram, "storage": storage,
"nw": nw, "location": systemlocation,
"uuid": systemuuid}
system = {"Name": system_name, "id": system_id,
"Description": system_description,
"cpu": cpu, "ram": ram, "storage": storage,
"network": network, "location": system_location,
"uuid": system_uuid, "health": system_health}
# filter based on RAM, CPU, NETWORK..etc
if 'ram' in filters:
@ -210,7 +214,7 @@ def systems_list(filters={}):
# filter based on RAM, CPU, NETWORK..etc
if 'nw' in filters:
filterPassed = (True
if int(nw) >= int(filters['nw'])
if int(network) >= int(filters['network'])
else False)
# filter based on RAM, CPU, NETWORK..etc