-
Notifications
You must be signed in to change notification settings - Fork 77
RAC-4177, RAC-4909, RAC-4901 #644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added the following endpoints:
GET /redfish/v1/Systems/{identifier}/Bios
GET /redfish/v1/Systems/{identifier}/Bios/Settings
PATCH /redfish/v1/Systems/{identifier}/Bios/Settings
- This implements redfish systems bios settings for Dell
nodes only.
lib/api/redfish-1.0/systems.js
Outdated
| graphOptions.defaults.serverComponents[0].attributes.push({name: key, value: payload.Attributes[key]}); | ||
| } | ||
| return [ graphName, graphOptions ]; | ||
| }).spread(function(name, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'options' is defined but never used.
'name' is defined but never used.
lib/api/redfish-1.0/systems.js
Outdated
| } | ||
| return [ graphName, graphOptions ]; | ||
| }).spread(function(name, options) { | ||
| return nodeApi.setNodeWorkflowById({ name: graphName, options: graphOptions }, identifier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
| serverComponents: [{fqdd: "BIOS.Setup.1-1", attributes: []}] | ||
| } | ||
| }; | ||
| for (var key in payload.Attributes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
| } | ||
| }; | ||
| for (var key in payload.Attributes) { | ||
| graphOptions.defaults.serverComponents[0].attributes.push({name: key, value: payload.Attributes[key]}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
lib/api/redfish-1.0/systems.js
Outdated
| serverIP: summary.data.id, | ||
| fileName: "", | ||
| shareType: 0, | ||
| shareAddress: southbound_api_router.address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier 'southbound_api_router' is not in camel case.
lib/api/redfish-1.0/systems.js
Outdated
| .then(function(node){ | ||
| var dellFound = false; | ||
| for(var i=0; i<node.identifiers.length; i++) | ||
| if(/^[0-9|A-Z]{7}$/.test(node.identifiers[i])){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected '{' and instead saw 'if'.
lib/api/redfish-1.0/systems.js
Outdated
| return waterline.nodes.getNodeById(identifier) | ||
| .then(function(node){ | ||
| var dellFound = false; | ||
| for(var i=0; i<node.identifiers.length; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of '++'.
lib/api/redfish-1.0/systems.js
Outdated
| } | ||
| // normalize the currentValue field (some need value fields) | ||
| for(var key in bios.attributes) { | ||
| if (bios.attributes[key].currentValue[0] == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected '===' and instead saw '=='.
lib/api/redfish-1.0/systems.js
Outdated
| } | ||
| } | ||
| // normalize the currentValue field (some need value fields) | ||
| for(var key in bios.attributes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'key' is already defined.
lib/api/redfish-1.0/systems.js
Outdated
| .then(function(node){ | ||
| var dellFound = false; | ||
| for(var i=0; i<node.identifiers.length; i++) | ||
| if(/^[0-9|A-Z]{7}$/.test(node.identifiers[i])){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected '{' and instead saw 'if'.
lib/api/redfish-1.0/systems.js
Outdated
| .then(function(node){ | ||
| var dellFound = false; | ||
|
|
||
| for(var i=0; i<node.identifiers.length; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of '++'.
| var key; | ||
|
|
||
| // create a single bios attribute list (not organized by type) | ||
| for(key in bios.data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
lib/api/redfish-1.0/systems.js
Outdated
| return waterline.nodes.getNodeById(identifier) | ||
| .then(function(node){ | ||
| var dellFound = false; | ||
| for(var i=0; i<node.identifiers.length; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of '++'.
lib/api/redfish-1.0/systems.js
Outdated
| return waterline.nodes.getNodeById(identifier) | ||
| .then(function(node){ | ||
| var dellFound = false; | ||
| for(var i=0; i<node.identifiers.length; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of '++'.
lib/api/redfish-1.0/systems.js
Outdated
| var moment = require('moment'); | ||
| var configuration = injector.get('Services.Configuration'); | ||
|
|
||
| var southboundApiRouter = _.filter(configuration.get('httpEndpoints', []), _.matches({routers:'southbound-api-router'}))[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
|
Cleaning up warnings using captive audience of houndci. No merge please. |
| } | ||
| }).catch(function(error) { | ||
| return redfish.handleError(error, res); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an identifier and instead saw ')'.
| // TODO: Non-Dell still needs work | ||
| options.bios = {"source": "bios", "attributes": []}; | ||
| } | ||
| }).catch(function(error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an identifier and instead saw ')'.
Expected an operator and instead saw '.'.
Missing semicolon.
Expected an identifier and instead saw 'catch'.
Expected an operator and instead saw '('.
Missing name in function declaration.
'function' is defined but never used.
| }).spread(function(result) { | ||
| return nodeApi.setNodeWorkflowById({ name: result.name, options: result.options }, identifier); | ||
| }); | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected ')' and instead saw 'else'.
Missing semicolon.
| name: graphName, | ||
| options: graphOptions | ||
| }).spread(function(result) { | ||
| return nodeApi.setNodeWorkflowById({ name: result.name, options: result.options }, identifier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
| forEach(var ident in node.identifiers) { | ||
| if(/^[0-9|A-Z]{7}$/.test(ident)){ | ||
| dellFound = true; | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected 'break'.
| } | ||
| for (key = bios.attributes.length - 1; key >= 0; key -= 1) { | ||
| // remove entries that are readOnly | ||
| if (bios.attributes[key].isReadOnly.value == "true") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected '===' and instead saw '=='.
| forEach(var ident in node.identifiers) { | ||
| if(/^[0-9|A-Z]{7}$/.test(ident)){ | ||
| dellFound = true; | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected 'break'.
| return waterline.nodes.getNodeById(identifier) | ||
| .then(function(node){ | ||
| var dellFound = false; | ||
| forEach(var ident in node.identifiers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an identifier and instead saw 'var'.
Expected ')' and instead saw 'ident'.
Missing semicolon.
Expected an identifier and instead saw ')'.
| forEach(var ident in node.identifiers) { | ||
| if(/^[0-9|A-Z]{7}$/.test(ident)){ | ||
| dellFound = true; | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected 'break'.
| return waterline.nodes.getNodeById(identifier) | ||
| .then(function(node){ | ||
| var dellFound = false; | ||
| forEach(var ident in node.identifiers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an identifier and instead saw 'var'.
Expected ')' and instead saw 'ident'.
Missing semicolon.
Expected an identifier and instead saw ')'.
|
Test this please |
Added the following endpoints:
GET /redfish/v1/Systems/{identifier}/Bios
GET /redfish/v1/Systems/{identifier}/Bios/Settings
PATCH /redfish/v1/Systems/{identifier}/Bios/Settings
nodes only.
@derrickostertag @larry-dean