Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial
Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under
vendor's standard commercial license.
The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express
warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall
not be liable for technical or editorial errors or omissions contained herein.
Acknowledgments
Windows Server® is a trademark of the Microsoft Group of companies.
Prerequisites and Audience
This paper assumes the reader is familiar with HTTP operations and RESTful web service APIs. The reader should be familiar with JSON and UTF-8 encoding as well as HTTP operations and
headers.
This paper is a reference and is intended to be used in conjunction with the paper entitled "Managing HP Servers Using the HP RESTful API." This other document is an introduction to using
the HP RESTful API, while this document provides detail on individual properties and messages.
First Things
HP Moonshot running Chassis Manager 1.30 or later features a new management interface called the “HP RESTful API.” The HP RESTful API is a RESTful Web Service API served by iLO’s web
server. If you are familiar with RESTful APIs, this should tell you much about how the API works. In short, a RESTful API is an application programming interface using the basic HTTP
operations GET, PUT, POST, DELETE, and PATCH. Each HTTP operation either submits or returns a “resource” in the form of UTF-8 encoded JSON. Just as a Web application returns HTML to
your browser, a REST interface returns data (in the form of JSON) to your client over the same transport (HTTPS).
All modern scripting languages make it very easy to write simple REST clients for web services. Most, like Python can transform JSON into internal data structures like dictionaries, allowing for
easily access to data. This enables you to write custom code directly to the API instead of using intermediate tools.
If you are not familiar with RESTful APIs, you should pause and do internet research on the subject. This tutorial is intended to point out the things you must consider when creating a proper
client to interact with The HP RESTful API.
Key Benefits of the HP RESTful API
This HP RESTful API will become the main management API for Moonshot. Using this API you can take full inventory of the Moonshot enclosure, control power and reset, configure settings,
fetch event logs as well as many other things.
This API follows the trend of the Internet in moving to a common pattern for new software interfaces. Many web services in a variety of industries use REST APIs because they are easily to
implement, easy to consume, and offer scalability advantages over previous technologies. HP OneView, OpenStack, and many other server management APIs are now REST APIs. Most HP
Management software offerings as well as the entire Software Defined Data Center architecture is built upon REST APIs.
Requirements for using the HP RESTful API
The HP RESTful API for iLO is available on Moonshot servers running iLO Chassis Manager and does not require a license.
How to Use This Document
This document has three main sections.
Examples of using PATCH and POST to set properties and perform actions.
Resource Map documents the resources in the data model including the URIs and types of the resources as well as the relationships between resources. Not all implementations of the
The
API will contain all the resources in this table and the model may expand in future versions of firmware.
Data Model Type Reference contains a chapter for each resource type and a section for each property in each resource type.
The
The Message Reference documents the MessageID values that may be returned in ExtendedError responses to HTTP operations.
Examples of using PATCH and POST to set properties and
perform actions
1./rest/v1/Sessions
a.POST Login
{
"Password": "",
"UserName": ""
}
b.DELETE Session (Clear session)
From the /rest/v1/Sessions URI select the href: for the session to be cleared. An
example is href: /rest/v1/Sessions/administrator53d95db4c8098e1d. When
the session is verified sending a DELETE request will clear the session.
2./rest/v1/AccountService
a.PATCH Minimum Password Length
{
"Oem": {
"Hp": {
"MinPasswordLength": 8
}
}
}
This changes the Minimum Password Length. Acceptable values are 0 through 39.
Valid values for privileges are true and false. Each account has specific link with an
integer (N). Perform a GET /rest/v1/AccountService/Accounts to get a list of
valid accounts.
This POST removes the SSH public key associated with account N.
5./rest/v1/Managers/1
a.POST Reset
{
"Action": "Reset"
}
The performs a reset on iLO CM.
b.POST Set Factory Defaults
{
"Action": "SetFactoryDefaults"
}
6./rest/v1/Managers/1/DateTime
a.PATCH DateTime
{
"DateTime": "YYYY-MM-DDTHH:MM:SS+hh:mm"
}
The DateTime format follows the ISO 8601 standard. The time is set using local time and
the +hh:mm section is the offset from UTC to the local standard time zone. Daylight savings
time is automatically determined. CST/CDT is +06:00.
b.PATCH TimeZone.Index
{
"TimeZone": {
"Index": 296
}
}
The Timezone Indexes that are available are listed in the TimeZoneList array with a GET
/rest/v1/Managers/1/DateTime.
c.PATCH SNTPPollingPeriodSeconds
{
"SNTPPollingPeriodSeconds": 95
}
This is an integer value with a 60 second minimum. It sets the frequency that the the NTP
server(s) are polled for the current time.
This removes the named firmware file from the repository. The firmware files currently in
the repository are listed in the FirmwareRepositoryFiles array.
Use "none" for "StaticRoutes", "Address", "SubnetMask", or "Gateway" to
clear the setting.
The "DDNSRegistration", "WINSRegistration", "StaticSubnetMask",
"DNSServers", "StaticRoutes", and "WINSServers" properties can be PATCHED
in any combination.
Changing this property requires an iLO CM reset for the changes to take effect.
c.PATCH PingGatewayOnStartup
{
"Oem": {
"Hp": {
"PingGatewayOnStartup": true
}
}
}
Changing this property requires an iLO CM reset for the change to take effect.
Valid ControlType values are "Off" and "On". "On" creates a link between cartridges
Cx and Cy if there is an appropriate connection path between the two cartridges. It is
possible to create a link from a cartridge to more than one other cartridge. "Off" breaks
an existing link between two cartridges.
c.PATCH Power
{
"Power": "Press"
}
Valid Power values are "Press"and "PressAndHold".
"PressAndHold"unconditionally removes power from all nodes on a cartridge.
"Press"(when all nodes are off) sends a power on signal to all nodes. "Press" (when
any nodes are on) sends a power off signal to all nodes that have power applied. This
requires a running OS for a response.
d.PATCH SKU (Product ID)
{
"SKU": "XXXXXX-B21"
}
e.PATCH Serial Number
{
"SerialNumber": ""
}
f.PATCH IndicatorLED (UID)
{
"IndicatorLED": "Lit"
}
Valid IndicatorLED values are "Off" and "Lit".
18. /rest/v1/Chassis/1/Cartridges/Cx/Logs/IML
a.POST ClearLog
{
"Action": "ClearLog"
}
This action clears the Integrated Management Log of any entries related to the cartridge
(Cx) or any node(s) (CxNy) on the cartridge.
This action clears the Integrated Management Log of any entries related to the switch
(Sx).
21. /rest/v1/Systems/CxNy
a.POST PowerButton
{
"Action": "PowerButton",
“PushType”: “”
}
Valid PushType values are "Press" and "PressAndHold". "PressAndHold"
unconditionally removes power from the node. "Press" (when the node is off) sends a
power on signal to the node. "Press" (when the node is on) sends a power off signal
the node. This requires a running OS for a response.
b.POST Reset
{
"Action": "Reset",
"ResetType": ""
}
Valid ResetType values are "On", "Off", "Reset", "ColdReset", and
"GracefulShutdown". "ResetType": "On" changes the power state of the node
to "On". "ResetType": "Off" forces the power state of the node to "Off".
"ResetType": " GracefulShutdown " changes the power state of the node to
"Off" based on the OS services running on the node. "ResetType": "Reset" and
"ResetType": "ColdReset" forces the power state of the node to "Off" and then
back to "On".
c.PATCH BSC
{
"Oem": {
"Hp": {
"Options": {
"BSC": "Enable"
}
}
}
}
d.PATCH CPU
{
"Oem": {
"Hp": {
"Options": {
"CPU": {
"ClockRate": {
"CurrentFrequency": "1.8"
}
}
}
}
}
}
The "CurrentFrequency" must be in the list of "AvailableFrequency" values.
Valid BootOrder values are "N/A", "PXE", "HDD", "iSCSI", and "M.2". Up to two
boot order targets can be specified.
f.PATCH BootSourceOverride
{
"Boot": {
"BootSourceOverrideEnabled": "Once",
"BootSourceOverrideTarget": "M.2"
}
}
The list of valid targets for "BootSourceOverrideTarget" is listed in
"BootSourceOverrideSupported".
22. /rest/v1/Systems/CxNy/Logs/IML
a.POST ClearLog
{
"Action": "ClearLog"
}
This action clears the Integrated Management Log of any entries related to the node
(CxNy).
Resource Map
This section documents the resource map. Not all resources will be present in all implementations and the resource model may expand in future versions of the firmware. The root resource
is /rest/v1.
/rest/v1/Systems/{item}/Logs/IMLHpMoonshotLogServiceHTTP Allow: GET, PATCH, POST
Links to other resourcesto resource URIto resource Type
/rest/v1/SystemsSummary
SystemsSummaryHTTP Allow: GET
Links to other resourcesto resource URIto resource Type
/rest/v1/Systems/{item}ComputerSystem
/rest/v1/Chassis/{item}Chassis
Data Model Type Reference
This section documents each type of resource. Note that more than one resource may be of the same type. Not all resource instances implement every property specified in the definition.
"AccountService" Resource Type
Resource Instances
/rest/v1/AccountService
See Resource Map for more details.
This is the schema definition for
"AuthFailureLoggingThreshold"
You may create an iLO account by building a request JSON object of type
POST {"UserName":
"VirtualMediaPriv": true,
"newuser"}}}
"AccountService"
defines the following properties specified in JSON-pointer syntax
the Account service. It represents the properties for this service and has links to the list of accounts.
may be PATCHed to the values 0, 1, 2, 3, or 5. The value of 4 is not supported by
ManagerAccount and POSTing it to the Collection pointed to by the "Accounts" link. For Example:
This property enables you to view and configure logging criteria for failed authentications. A failed login log entry is recorded after the configured number of attempts. 0 = feature disabled; 13 and 5 are allowable values.
JSON type:
HTTP Operations
Integer
GETRendered if supported by the implementation or omitted if not.
PATCHThis property may be PATCHed if the resource instance of this type supports PATCH in the HTTP Allow headers.
The property "Oem/Hp/AuthFailureLoggingThreshold" on resource type
ExtendedError. Multiple properties may be included in a single HTTP PATCH operation as long as the request is properly formatted JSON. To address an array entry other than the first, insert
nulls as placeholders on skipped array entries.
AccountService may not support PATCH of all values and may result in an HTTP 400 error with response of Type
"Oem/Hp/MinPasswordLength"
This property is a member of AccountService
This property specifies the minimum number of characters allowed when a user password is set or changed. It must be a value from 0 to 39.
JSON type: Integer from 0 to 39.
HTTP Operations
GETRendered if supported by the implementation or omitted if not.
PATCHThis property may be PATCHed if the resource instance of this type supports PATCH in the HTTP Allow headers.
The property "Oem/Hp/MinPasswordLength" on resource type
Multiple properties may be included in a single HTTP PATCH operation as long as the request is properly formatted JSON. To address an array entry other than the first, insert nulls as
placeholders on skipped array entries.
AccountService may not support PATCH of all values and may result in an HTTP 400 error with response of Type ExtendedError.
"Chassis" Resource Type
Resource Instances
/rest/v1/Chassis/{item}
See Resource Map for more details.
The schema definition for the Chassis resource. It represents the properties for physical components for any system. This object represents racks, rackmount servers, blades, standalone,
modular systems, enclosures, and all other containers. The non-CPU/device-centric parts of the schema are accessed either directly or indirectly through this resource.
Chassis resources are members of the Chassis collection at /rest/v1/Chassis. Each Chassis contains an OEM section with HP-specific properties.
"Chassis" defines the following properties specified in JSON-pointer syntax
This is a user-assigned asset tag for the chassis.
JSON type: String
HTTP Operations
GETRendered if supported by the implementation or omitted if not. The value of this property may also be null if it is unavailable at the time of the request.
PATCHThis property may be PATCHed if the resource instance of this type supports PATCH in the HTTP Allow headers.
PATCH Example
HTTP PATCH to resource with request JSON:
{"AssetTag": "<string-value>"}
The property "AssetTag" on resource type
Chassis may not support PATCH of all values and may result in an HTTP 400 error with response of Type ExtendedError. Multiple properties may be
included in a single HTTP PATCH operation as long as the request is properly formatted JSON. To address an array entry other than the first, insert nulls as placeholders on skipped array
entries.
"ChassisType"
This property is a member of Chassis
This property indicates the type of physical form factor of this resource.
JSON type: String containing one of the following supported values:
This is the indicator LED for the chassis, which is used to identify the chassis. This LED can be manipulated by the user.
JSON type: String containing one of the following supported values:
"Unknown"
"Lit"
"Blinking"
"Off"
HTTP Operations
GETRendered if supported by the implementation or omitted if not. The value of this property may also be null if it is unavailable at the time of the request.
PATCHThis property may be PATCHed if the resource instance of this type supports PATCH in the HTTP Allow headers.
PATCH Example
HTTP PATCH to resource with request JSON:
{"IndicatorLED": "Lit"}
The property "IndicatorLED" on resource type
be included in a single HTTP PATCH operation as long as the request is properly formatted JSON. To address an array entry other than the first, insert nulls as placeholders on skipped array
entries.
Chassis may not support PATCH of all values and may result in an HTTP 400 error with response of Type ExtendedError. Multiple properties may
"Manufacturer"
This property is a member of Chassis
This is the manufacturer of this chassis.
JSON type: String
HTTP Operations
GETRendered if supported by the implementation or omitted if not. The value of this property may also be null if it is unavailable at the time of the request.
"Model"
This property is a member of Chassis
This is the model number for the chassis.
JSON type: String
HTTP Operations
GETRendered if supported by the implementation or omitted if not. The value of this property may also be null if it is unavailable at the time of the request.
JSON type: String containing one of the following supported values:
"On"
"Off"
HTTP Operations
GETRendered if supported by the implementation or omitted if not.
PATCHThis property may be PATCHed if the resource instance of this type supports PATCH in the HTTP Allow headers.
PATCH Example
HTTP PATCH to resource with request JSON:
{"Oem": {"Hp": {"AutoPowerOn": "Off"}}}
The property "Oem/Hp/AutoPowerOn" on resource type
properties may be included in a single HTTP PATCH operation as long as the request is properly formatted JSON. To address an array entry other than the first, insert nulls as placeholders on
skipped array entries.
Chassis may not support PATCH of all values and may result in an HTTP 400 error with response of Type ExtendedError. Multiple
"Oem/Hp/BaseFru[]/MfgDateTime"
This property is a member of Chassis
JSON type: String
HTTP Operations
GETRendered if supported by the implementation or omitted if not.
"Oem/Hp/BaseFru[]/ProductName"
This property is a member of Chassis
JSON type: String
HTTP Operations
GETRendered if supported by the implementation or omitted if not.
GETRendered if supported by the implementation or omitted if not.
"Oem/Hp/Location/LocationOfChassis/UUID"
This property is a member of Chassis
Chassis UUID provided by SMBIOS.
JSON type: String
HTTP Operations
GETRendered if supported by the implementation or omitted if not.
"PartNumber"
This property is a member of Chassis
This is the part number of the chassis.
JSON type: String
HTTP Operations
GETRendered if supported by the implementation or omitted if not. The value of this property may also be null if it is unavailable at the time of the request.
"SKU"
This property is a member of Chassis
This is the SKU of the chassis.
JSON type: String
HTTP Operations
GETRendered if supported by the implementation or omitted if not. The value of this property may also be null if it is unavailable at the time of the request.
PATCHThis property may be PATCHed if the resource instance of this type supports PATCH in the HTTP Allow headers.
PATCH Example
HTTP PATCH to resource with request JSON:
{"SKU": "<string-value>"}
The property "SKU" on resource type
included in a single HTTP PATCH operation as long as the request is properly formatted JSON. To address an array entry other than the first, insert nulls as placeholders on skipped array
entries.
Chassis may not support PATCH of all values and may result in an HTTP 400 error with response of Type ExtendedError. Multiple properties may be
GETRendered if supported by the implementation or omitted if not. The value of this property may also be null if it is unavailable at the time of the request.
PATCHThis property may be PATCHed if the resource instance of this type supports PATCH in the HTTP Allow headers.
PATCH Example
HTTP PATCH to resource with request JSON:
{"SerialNumber": "<string-value>"}
The property "SerialNumber" on resource type
Chassis may not support PATCH of all values and may result in an HTTP 400 error with response of Type ExtendedError. Multiple properties
may be included in a single HTTP PATCH operation as long as the request is properly formatted JSON. To address an array entry other than the first, insert nulls as placeholders on skipped
array entries.
"Status/Health"
This property is a member of Chassis
Indicates the health state of this resource without considering its dependent resources.
JSON type: String containing one of the following supported values:
"OK"
"Warning"
"Critical"
HTTP Operations
GETRendered if supported by the implementation or omitted if not.
"Status/HealthRollUp"
This property is a member of Chassis
Indicates the overall health state of this resource and its dependent resources.
JSON type: String containing one of the following supported values:
GETRendered if supported by the implementation or omitted if not.
"Status/State"
This property is a member of Chassis
Indicates the known state of this resource (for example, if the resource is enabled). Enabled indicates that the resource is available. Disabled indicates that the resource has been made
unavailable intentionally, but it can be enabled. Offline indicates that the resource is unavailable intentionally and requires action to be made available. InTest indicates that the component is
undergoing testing. Starting indicates that the resource is on its way to becoming available. Absent indicates that the resource is physically unavailable.
JSON type: String containing one of the following supported values:
GETRendered if supported by the implementation or omitted if not.
"Version"
This property is a member of Chassis
This is the version of the chassis.
JSON type: String
HTTP Operations
GETRendered if supported by the implementation or omitted if not. The value of this property may also be null if it is unavailable at the time of the request.