Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9a18606
added post lookups + dhcp to latest esx-ks
nucklehead Jun 16, 2016
e8160b3
shutdown day
nucklehead Jul 1, 2016
cc0513e
merged with master
nucklehead Jul 1, 2016
0318667
merged with rackhd master and fixed centos-ks
nucklehead Jul 29, 2016
506bfbd
fixed cnetos-ks
nucklehead Jul 29, 2016
fc17519
pulled master branch again
nucklehead Jul 29, 2016
b237333
ztip demo hardwarepool 4
nucklehead Sep 30, 2016
df7da5e
Merge branch 'master' of https://github.com/RackHD/on-tasks
nucklehead Oct 11, 2016
f802d33
Updated centos-ks to set interfaces to dhcp by default when a list of…
nucklehead Oct 17, 2016
de92023
carved branch for esx-ks changes
nucklehead Oct 17, 2016
ba14751
removed swagger folder
nucklehead Oct 17, 2016
a7d1fea
Hook API design
pengz1 Jan 9, 2017
f7b75d7
add swagger python-client deb build back
panpan0000 Jan 16, 2017
4fa77e7
Merge pull request #563 from panpan0000/StopTravisCI
rolandpoulter Jan 18, 2017
8bd5a0e
add the identifier property to the node schema
tannoa2 Jan 18, 2017
c36098d
fix task annotation link
Nov 3, 2016
4352052
show link after npm run taskdoc
Jan 20, 2017
3440f10
Merge pull request #567 from tannoa2/ucsRackmount
Jan 20, 2017
c41d02d
Merge pull request #569 from yyscamper/fix-task-annotation
geoff-reid Jan 26, 2017
1433256
Cisco Version Header string contains characters
nucklehead Jan 26, 2017
cfdc41e
Additional Details to Clarify Proposed Changes
king-jam Jan 27, 2017
d8a3153
Merge pull request #573 from project-voyager/master
Jan 27, 2017
b75e591
jump version for new release 1.1.0
Jan 28, 2017
32e9dc5
Merge branch 'master' of https://github.com/RackHD/on-http into ztip-…
nucklehead Jan 30, 2017
212a96d
Merge pull request #497 from nucklehead/ztip-esx-kickstart-update
Jan 31, 2017
d1c3be0
'Allowing for systems with more than 26 drives'
Feb 1, 2017
bc7da45
Update Redfish schemas to 2016.3
dalebremner Jan 30, 2017
9cd2d5b
Bugfix
Feb 3, 2017
d58dd54
expanding regex for hd[a-z][a-z] as well
Feb 6, 2017
026b674
shortening regex
Feb 6, 2017
535676f
prevent render error if networkDevices is not defined
geoff-reid Feb 6, 2017
3f1f225
Merge pull request #577 from ytjohn/fixdrivelines
anhou Feb 7, 2017
fa28305
Update review comments on hook API
pengz1 Jan 12, 2017
30320cb
Revert "Ztip esx kickstart update"
anhou Feb 7, 2017
4d7b080
Merge pull request #578 from keedya/master
geoff-reid Feb 7, 2017
82e99c9
Merge pull request #582 from geoff-reid/windows_install_fix
geoff-reid Feb 7, 2017
d392304
Merge pull request #579 from dalebremner/redfish2016
Feb 7, 2017
6f38f6f
Merge pull request #583 from RackHD/revert-497-ztip-esx-kickstart-update
geoff-reid Feb 8, 2017
52c388b
Add Deprecation Warning Header to 1.1 northbound/southbound router
srinia6 Feb 9, 2017
90857cf
Merge pull request #554 from pengz1/Hook-design-for-Progress
yyscamper Feb 9, 2017
8419476
Merge pull request #585 from srinia6/master
Feb 9, 2017
92a4e80
Merge remote-tracking branch 'origin/master' into feature/ibms
dalebremner Feb 9, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ before_deploy:
if ! [ "$BEFORE_DEPLOY_RUN" ]; then
export BEFORE_DEPLOY_RUN=1;
./extra/make-docs.sh;
./extra/make-deb.sh;
fi

deploy:
Expand Down
8 changes: 7 additions & 1 deletion data/templates/cisco-catalog-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ def main():
data = {}

try:
data = json.loads(clid('show version'))
# get the version in json form in a temporary string so we can manipulate it
dataString = clid('show version')
# The "as is" in the license header string from 'show version'
# will cause json.dumps within taskrunner.py to produce an invalid json string
# This is resolved by replacing the additional escapes (\) with a raw string
dataString = dataString.replace("\\\"as is,\\\"", "as is")
data = json.loads(dataString)
except:
pass

Expand Down
2 changes: 1 addition & 1 deletion data/templates/get_driveid.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function parseDriveWwid(idList) {
//Only IDE and SCSI disk will be retrieved
var scsiLines = [], sataLines = [], wwnLines = [], usbLines = [], requiredStrLen = 60;
lines.forEach(function(line){
if ( line && !(line.match('part')) && line.match(/sd[a-z]$|hd[a-z]$/i)){
if ( line && !(line.match('part')) && line.match(/[sh]d[a-z]?[a-z]$/i)){
var nameIndex = line.lastIndexOf('/'), idIndex = line.lastIndexOf('->');
if (line.indexOf('scsi') === 0) {
scsiLines.push([line.slice(nameIndex + 1), line.slice(0, idIndex)]);
Expand Down
23 changes: 22 additions & 1 deletion data/templates/remove_bmc_credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,26 @@

usernames=(<%= users.join(" ") %>)

mapfile -t userlist < <(ipmitool user list)
channel=''
function set_channel()
{
for i in {1..15}; do
ipmitool user list $i &>/dev/null
status=$?
if [ "$status" -eq "0" ] ; then
channel=$i
break
fi
done
}
set_channel
echo "channel number is" $channel
if [ -z "${channel}" ]; then
echo "Channel number was not set correctly, exiting script"
exit 1
fi

mapfile -t userlist < <(ipmitool user list $channel)

array_len=${#userlist[@]}
if [ "$array_len" -gt "1" ]; then
Expand All @@ -22,4 +41,6 @@ for user in ${usernames[@]}; do
fi
done
done
#succesfull
exit 0

8 changes: 5 additions & 3 deletions data/templates/set_bmc_credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ fi
echo " Getting the user list"
cmdReturn=$(ipmitool user list $channel)
myarray=(${cmdReturn//$'\n'/ })
cmdReturn1=$(ipmitool user summary $channel)
myarray1=(${cmdReturn1//$'\n'/ })
userNumber=${myarray1[8]}
mapfile -t userlist < <(ipmitool user list $channel)
userNumber=${#userlist[@]}
if [ "$userNumber" -gt "1" ]; then
userNumber=$(expr $userNumber - 1)
fi
user=$(<%=user%>)
#The check variable is a flag to determine if the user already exists
#(1:already exist and 0:user does not exist)
Expand Down
2 changes: 1 addition & 1 deletion data/templates/unattend_server2012.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
<ComputerName><%=hostname%></ComputerName>
</component>
<component name="Microsoft-Windows-TCPIP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<% if( undefined !== networkDevices ) { %>
<% if( typeof networkDevices !== 'undefined' ) { %>
<% networkDevices.forEach(function(n) { %>
<% cidr_bits = 0 %>
<% dhcp_ipv4 = false %>
Expand Down
10 changes: 10 additions & 0 deletions data/views/hook.2.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "<%=url%>",
"id": "<%=id%>",
<% if (typeof name !== "undefined") {%>
"name": "<%=name%>",
<% } %>
"filters": <%- JSON.stringify(filters)%>
}


Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"UUID": "<%= ohai.data.dmi.system.uuid.toLowerCase() %>",
"HostName": "",
"IndicatorLED": "<%= chassisData.uid %>",
"PowerState": "<%= chassisData.power %>",
"PowerState": "<%= chassisData.power==='Unknown' ? 'On' : chassisData.power %>",
"Boot": {},
"BiosVersion": "<%= ohai.data.dmi.bios.version.trim() %> <%= ohai.data.dmi.bios.bios_revision.trim() %> <%= ohai.data.dmi.bios.release_date.trim() %>",
"ProcessorSummary": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"@odata.context" : "<%= basepath %>/$metadata/Schemas/Members/$entity",
"@odata.id": "<%= url %>",
"@odata.type": "#JsonSchemaFile.1.0.0.JsonSchemaFile",
"Name": "",
"Description": "Schema Definition File for <%= identifier %>",
"Id": "<%= identifier %>",
"Languages": [
Expand Down
1 change: 1 addition & 0 deletions data/views/redfish-1.0/redfish.1.0.0.processor.1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"@odata.type": "#Processor.1.0.0.Processor",
"Oem" : {},
"Id": "<%=socketId%>",
"Name": "",
"Socket": "<%= dmi.data['Processor Information'][socketId]['Socket Designation'] %>",
"ProcessorType": "CPU",
"ProcessorArchitecture": "x86",
Expand Down
1 change: 1 addition & 0 deletions data/views/redfish-1.0/redfish.1.0.0.role.1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"OemPrivileges": [],
"@odata.id": "<%= url %>",
"Oem": {},
"Id": "",
"AssignedPrivileges": [
<% rolePrivileges.forEach(function(rolePrivilege, i, arr) { %>
"<%= rolePrivilege %>"
Expand Down
2 changes: 1 addition & 1 deletion data/views/redfish-1.0/redfish.1.0.0.thermal.1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{
"Oem": {},
"FanName": "<%= sdr['sensorId'] %>",
"ReadingRPM": <%= _.isNaN(parseFloat(sdr['sensorReading'])) ? 'null' : parseFloat(sdr['sensorReading']) %>,
"Reading": <%= _.isNaN(parseFloat(sdr['sensorReading'])) ? 'null' : parseFloat(sdr['sensorReading']) %>,
"UpperThresholdNonCritical": <%= _.isNaN(parseFloat(sdr['upperNonCritical'])) ? 'null' : parseFloat(sdr['upperNonCritical']) %>,
"UpperThresholdCritical": <%= _.isNaN(parseFloat(sdr['upperCritical'])) ? 'null' : parseFloat(sdr['upperCritical']) %>,
"UpperThresholdFatal": null,
Expand Down
5 changes: 3 additions & 2 deletions debianstatic/on-http/changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
on-http (1.0.0) UNRELEASED; urgency=low
on-http (1.1.0) UNRELEASED; urgency=low

* Initial release
* release 1.0.0
* release 1.1.0

-- rackhd <rackhd@emc.com> Fri, 13 Jan 2017 21:02:27 -0500
-- rackhd <rackhd@emc.com> Fri, 27 Jan 2017 21:02:08 -0500
4 changes: 4 additions & 0 deletions install-task-doc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright 2016, EMC, Inc.

set -e

if [ ! -d './node_modules/on-tasks/' ]; then
echo 'on-tasks folder not found, please run npm install.'
exit 1
Expand All @@ -21,3 +23,5 @@ cp -rf ./node_modules/apidoc/template/* ./static/taskdoc/
# Copy generated json file to ./static folder, override existing files
mv -f ./node_modules/on-tasks/api_data.js ./static/taskdoc
mv -f ./node_modules/on-tasks/task_doc_data.json ./static/taskdoc/api_data.json

echo "Visit http://<server>:<port>/taskdoc for task documentation web page"
6 changes: 5 additions & 1 deletion lib/api/1.1/northbound/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ function northApiFactory (injector) {

// Un-mount existing routes when mounting.
this.unMountAllRouters();
router.all("*", function (req, res, next) {
res.setHeader('X-Warning', 'Deprecated API');
return next();
});

router.use(injector.get(require('./catalogs')));
router.use(injector.get(require('./config')));
Expand All @@ -46,4 +50,4 @@ function northApiFactory (injector) {
};

return router;
}
}
4 changes: 4 additions & 0 deletions lib/api/1.1/southbound/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ function internalApiFactory (injector) {
// Un-mount existing routes when mounting.
this.unMountAllRouters();

router.all("*", function (req, res, next) {
res.setHeader('X-Warning', 'Deprecated API');
return next();
});
router.use(injector.get(require('./profiles')));
router.use(injector.get(require('./files')));
router.use(injector.get(require('./tasks')));
Expand Down
66 changes: 66 additions & 0 deletions lib/api/2.0/hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2017, Dell EMC, Inc.

'use strict';

var injector = require('../../../index.js').injector;
var controller = injector.get('Http.Services.Swagger').controller;
var hooks = injector.get('Http.Services.Api.Hooks');

/**
* @api {get} /api/2.0/hooks GET /
* @apiDescription get list of hooks
* @apiName hooks-get
* @apiGroup hooks
*/
var hooksGetAll = controller(function(req) {
return hooks.getHooks(req.query);
});

/**
* @api {get} /api/2.0/hooks/:identifier GET /:identifier
* @apiDescription get list of hooks
* @apiName hooks-get
* @apiGroup hooks
*/
var hooksGetById = controller(function(req) {
return hooks.getHookById(req.swagger.params.identifier.value);
});

/**
* @api {POST} /api/2.0/hooks POST /
* @apiDescription post a new hook
* @apiName hooks-post
* @apiGroup hooks
*/
var hooksPost = controller({success: 201}, function(req) {
return hooks.createHook(req.body);
});

/**
* @api {PATCH} /api/2.0/hooks/:identifier POST /:identifier
* @apiDescription patch an existing hook
* @apiName hooks-patch
* @apiGroup hooks
*/
var hooksPatchById = controller(function(req) {
return hooks.updateHookById(req.swagger.params.identifier.value, req.body);
});

/**
* @api {DELETE} /api/2.0/hooks/:identifier DELETE /:identifier
* @apiDescription delete an existing hook
* @apiName hooks-delete
* @apiGroup hooks
*/
var hooksDelById = controller({success: 204}, function(req) {
return hooks.deleteHookById(req.swagger.params.identifier.value);
});

module.exports = {
hooksGetAll: hooksGetAll,
hooksPost: hooksPost,
hooksPatchById: hooksPatchById,
hooksDelById: hooksDelById,
hooksGetById: hooksGetById
};

14 changes: 7 additions & 7 deletions lib/api/redfish-1.0/account-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var configuration = injector.get('Services.Configuration');
var getAccountService = controller(function(req, res) {
var options = redfish.makeOptions(req, res);
return redfish.render('redfish.1.0.0.accountservice.1.0.0.json',
'AccountService.1.0.0.json#/definitions/AccountService',
'AccountService.v1_1_0.json#/definitions/AccountService',
options)
.catch(function(error) {
return redfish.handleError(error, res);
Expand Down Expand Up @@ -46,8 +46,8 @@ var getAccount = controller(function(req, res) {
throw new Errors.NotFoundError();
}
options.user = user;
return redfish.render('redfish.1.0.0.manageraccount.1.0.0.json',
'ManagerAccount.1.0.0.json#/definitions/ManagerAccount',
return redfish.render('redfish.1.0.0.manageraccount.1.0.0.json',
'ManagerAccount.v1_0_3.json#/definitions/ManagerAccount',
options);
})
.catch(function(error) {
Expand Down Expand Up @@ -104,8 +104,8 @@ var createAccount = controller({success: 201}, function(req, res) {
throw new Errors.NotFoundError();
}
options.user = user;
return redfish.render('redfish.1.0.0.manageraccount.1.0.0.json',
'ManagerAccount.1.0.0.json#/definitions/ManagerAccount',
return redfish.render('redfish.1.0.0.manageraccount.1.0.0.json',
'ManagerAccount.v1_0_3.json#/definitions/ManagerAccount',
options)
.then(function(data) {
res.location('/redfish/v1/AccountService/Accounts/' + user.username);
Expand Down Expand Up @@ -155,8 +155,8 @@ var modifyAccount = controller({success: 202}, function(req, res) {
})
.then(function(user) {
options.user = user;
return redfish.render('redfish.1.0.0.manageraccount.1.0.0.json',
'ManagerAccount.1.0.0.json#/definitions/ManagerAccount',
return redfish.render('redfish.1.0.0.manageraccount.1.0.0.json',
'ManagerAccount.v1_0_3.json#/definitions/ManagerAccount',
options);
})
.catch(function(error) {
Expand Down
6 changes: 3 additions & 3 deletions lib/api/redfish-1.0/chassis.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ var getChassis = controller(function(req, res) {
})

return redfish.render('redfish.1.0.0.chassis.1.0.0.json',
'Chassis.1.0.0.json#/definitions/Chassis',
'Chassis.v1_4_0.json#/definitions/Chassis',
_.merge({}, obj, options));
})
.catch(function(error) {
Expand Down Expand Up @@ -241,7 +241,7 @@ var getThermal = controller(function(req, res) {
});

return redfish.render('redfish.1.0.0.thermal.1.0.0.json',
'Thermal.1.0.0.json#/definitions/Thermal',
'Thermal.v1_2_0.json#/definitions/Thermal',
options);
}).catch(function(error) {
return redfish.handleError(error, res);
Expand Down Expand Up @@ -281,7 +281,7 @@ var getPower = controller(function(req, res) {
});

return redfish.render('redfish.1.0.0.power.1.0.0.json',
'Power.1.0.0.json#/definitions/Power',
'Power.v1_2_1.json#/definitions/Power',
options);
}).catch(function(error) {
return redfish.handleError(error, res);
Expand Down
14 changes: 7 additions & 7 deletions lib/api/redfish-1.0/event-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var eventCallback = function(events) {
(event.reading.sensorReadingUnits ? event.reading.sensorReadingUnits : '');
record.MessageId = "Alert.1.0." +
event.reading.sensorId.replace(/[^A-Za-z0-9.]/g,'');
return redfish.validateSchema(record, 'Event.1.0.0.json#/definitions/EventRecord') //jshint ignore: line
return redfish.validateSchema(record, 'Event.v1_1_2.json#/definitions/EventRecord') //jshint ignore: line
.then(function(result) {
if(result.error) {
throw new Error(result.error);
Expand Down Expand Up @@ -102,7 +102,7 @@ var eventCallback = function(events) {
event.reading.statesAsserted.toString();
record.MessageId = "StatusChange.1.0." +
event.reading.sensorId.replace(/[^A-Za-z0-9.]/g,'');
return redfish.validateSchema(record, 'Event.1.0.0.json#/definitions/EventRecord') //jshint ignore: line
return redfish.validateSchema(record, 'Event.v1_1_2.json#/definitions/EventRecord') //jshint ignore: line
.then(function(result) {
if(result.error) {
throw new Error(result.error);
Expand Down Expand Up @@ -132,7 +132,7 @@ var eventCallback = function(events) {
record.EventTimestamp = new Date().toISOString();
record.Message = JSON.stringify(event.data);
record.MessageId = event.EventType + ".1.0.EndPoints";
return redfish.validateSchema(record, 'Event.1.0.0.json#/definitions/EventRecord') //jshint ignore: line
return redfish.validateSchema(record, 'Event.v1_1_2.json#/definitions/EventRecord') //jshint ignore: line
.then(function(result) {
if(result.error) {
throw new Error(result.error);
Expand All @@ -155,7 +155,7 @@ var eventServiceRoot = controller(function(req, res) {
options.timeoutInSeconds = timeoutInSeconds;
options.retryAttempts = retryAttempts;
return redfish.render('redfish.1.0.0.eventservice.1.0.0.json',
'EventService.1.0.0.json#/definitions/EventService',
'EventService.v1_0_3.json#/definitions/EventService',
options);
})
.catch(function(error) {
Expand All @@ -181,7 +181,7 @@ var createSubscription = controller(function(req, res) {
var options = redfish.makeOptions(req, res);
var event = req.swagger.params.payload.value;
return redfish.validateSchema(event,
'EventDestination.1.0.0.json#/definitions/EventDestination'
'EventDestination.v1_1_1.json#/definitions/EventDestination'
)
.then(function validatePayload(result) {
if(result.error) {
Expand Down Expand Up @@ -227,7 +227,7 @@ var testEvent = controller({success: 202},function(req, res) {
record.EventTimestamp = new Date().toISOString();
record.Message = 'Generated TestEvent to ' + subscription.Destination;
record.MessageId = 'TestEvent.1.0.0';
return redfish.validateSchema(record, 'Event.1.0.0.json#/definitions/EventRecord')
return redfish.validateSchema(record, 'Event.v1_1_2.json#/definitions/EventRecord')
.then(function(result) {
if(result.error) {
throw new Error(result.error);
Expand Down Expand Up @@ -257,7 +257,7 @@ var getEvent = controller(function(req, res) {
}
options.subscription = event;
return redfish.render('redfish.1.0.0.eventdestination.json',
'EventDestination.1.0.0.json#/definitions/EventDestination',
'EventDestination.v1_1_1.json#/definitions/EventDestination',
options);
})
.catch(function(error) {
Expand Down
Loading