100% found this document useful (1 vote)
545 views

Dell PowerEdge Redfish API Overview

dell api for redfish

Uploaded by

Alex Donoiu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
545 views

Dell PowerEdge Redfish API Overview

dell api for redfish

Uploaded by

Alex Donoiu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Implementation of the

DMTF Redfish API on


Dell PowerEdge Servers

Version 1.0
March 2016

Jonas Werner, Sr. Solution Architect


Dell Customer Solution Centers

P. Raveendra Reddy, Platform Software Staff Engineer


Dell System Management Engineering

Paul Rubin, Sr. Product Manager


Dell Systems Management Marketing

Dell | Enterprise Solutions Group

1 Introducing the Dell PowerEdge Redfish API


Table of contents
Executive summary .......................................................................................................................................................................... 4
Introduction ....................................................................................................................................................................................... 5
The Redfish Management Standard .............................................................................................................................................. 6
Next-generation server management .................................................................................................................................. 6
Rack, multi-node, and nested chassis ................................................................................................................................... 7
Keeping up with changes in IT philosophy ........................................................................................................................... 7
Redfish key technologies ........................................................................................................................................................ 7
HTTPS communications ........................................................................................................................................................... 7
RESTful application programming interface ......................................................................................................................... 7
JSON data ................................................................................................................................................................................... 8
OData ........................................................................................................................................................................................... 8
Eventing ....................................................................................................................................................................................... 8
Redfish Operational Model ..................................................................................................................................................... 9
Redfish Client ............................................................................................................................................................................. 9
Redfish Architecture .............................................................................................................................................................. 10
Redfish tree structure .............................................................................................................................................................. 10
Redfish Operations ................................................................................................................................................................... 11
Authentication ........................................................................................................................................................................... 11
Privileges.................................................................................................................................................................................... 12
Using the Redfish API on PowerEdge systems .......................................................................................................................... 13
Web browser access ............................................................................................................................................................... 13
Accessing Redfish by using the cURL application ........................................................................................................... 15
Using cURL with authentication............................................................................................................................................ 16
Accessing Redfish by using Python scripting ................................................................................................................... 16
View general system information and status ...................................................................................................................... 16
View system health across multiple servers........................................................................................................................ 18
View system event log ............................................................................................................................................................ 18
Check system power state ..................................................................................................................................................... 19
Power on a system .................................................................................................................................................................. 19
Power off a system .................................................................................................................................................................. 19
View system power usage ...................................................................................................................................................... 20

2 Introducing the Dell PowerEdge Redfish API


Update general System Information with PATCH operation ........................................................................................... 20
Change boot device temporarily .......................................................................................................................................... 21
Update / modify iDRAC user account .................................................................................................................................. 22
Extended Information ............................................................................................................................................................. 22
Summary .......................................................................................................................................................................................... 24
Dell Customer Solution Centers .................................................................................................................................................. 25
Additional Information ................................................................................................................................................................... 26
Acronyms ..................................................................................................................................................................................26
Definitions ................................................................................................................................................................................ 27

THIS WHITE PAPER IS FOR INFORMATIONAL PURPOSES ONLY, AND MAY CONTAIN TYPOGRAPHICAL ERRORS AND TECHNICAL INACCURACIES. THE CONTENT IS
PROVIDED AS IS, WITHOUT EXPRESS OR IMPLIED WARRANTIES OF ANY KIND.

Copyright 2016 Dell Inc. All rights reserved. Dell and the Dell logo are trademarks of Dell Inc. in the United States and/or other jurisdictions. All other marks and names
mentioned herein may be trademarks of their respective companies .

March 2016 | Version 1.0

3 Introducing the Dell PowerEdge Redfish API


Executive summary
The growing scale of cloud- and web-based data center infrastructure is reshaping the needs of IT administrators
world-wide. New approaches to systems management are needed to keep up with a growing and changing market.

The Distributed Management Task Force (DMTF) Scalable Platforms Management Forum (SPMF) has published Redfish,
an open industry-standard specification and schema designed to meet the needs of IT administrators for simple,
modern, and secure management of scalable platform hardware. Dell is a key contributor to the Redfish standard,
acting as co-chair of the SPMF, promoting the benefits of Redfish, and working to deliver those benefits within Dell
industry-leading systems management solutions.

This document provides an overview of the Redfish Scalable Platforms Management API standard and describes the
Dell implementation of Redfish for Dells 12th and 13th generation of PowerEdge servers, delivered by the integrated
Dell Remote Access Controller (iDRAC) with Lifecycle Controller.

4 Introducing the Dell PowerEdge Redfish API


Introduction
Since the inception of the x86 server in the late 1980s, IT administrators have sought the means to efficiently manage
a growing number of distributed resources. Industry suppliers have responded by developing management interface
standards to support common methods of monitoring and controlling heterogeneous systems.

While management interfaces such as SNMP and IPMI have been present in data centers for the past decade, they
have not been able to meet the changing requirements due to security and technical limitations.

Further, the scale of deployment has grown significantly as IT models have evolved. Today, organizations often rely on
a large number of lower-cost servers with redundancy provided in the software layer, making scalable management
interfaces more critical.

To meet such market requirements, a new, unifying management standard was needed.

This document describes Redfisha next generation management standard using a data model representation inside
a hypermedia RESTful interface. The data model is defined in terms of a standard, machine-readable schema, with the
payload of the messages expressed in JSON and the protocol using OData v4. Because it is a hypermedia API, Redfish
is capable of representing a variety of implementations by using a consistent interface. It has mechanisms for
discovering and managing data center resources, handling events, and managing long-lived tasks.

Dell is enhancing its leading systems management capabilities with the introduction of Redfish support on the
integrated Dell Remote Access Controller (iDRAC) with Lifecycle Controller. This white paper provides the required
information to create Redfish clients or use existing REST clients to deliver the benefits of the Redfish API on
PowerEdge servers. This document can also be used to help legacy management consoles support or enable the
Redfish standard.

5 Introducing the Dell PowerEdge Redfish API


The Redfish Management Standard
There are various Out-of-Band (OOB) systems management standards available in the industry today. However, there
is no single standard that can be easily used within emerging programming standards, can be readily implemented
within embedded systems, and can meet the demands of todays evolving IT solution models.

New IT solutions models have placed new demands on systems management solutions to support expanded scale,
higher security and multi-vendor openness while also aligning with modern DevOps tools and processes.

Recognizing these needs, Dell and other IT solutions leaders within the DMTF undertook the creation of a new
management interface standard. After a multi-year effort, the new standard, Redfish v1.0, was announced in July,
2015.

Its key benefits include:

Increased simplicity and usability


Encrypted connections and generally heightened security
A programmatic interface that can easily be controlled through scripts
Ability to meet the Open Compute Projects Remote Machine Management requirements
Based on widely-used standards for web APIs and data formats

Redfish has been designed to support the full range of server architectures from monolithic servers to converged
infrastructure and hyper-scale architecture. The Redfish data model, which defines the structure and format of data
representing server status, inventory and available operational functions, is vendor-neutral. Administrators can then
create management automation scripts that can manage any Redfish compliant server. This is crucial for the efficient
operation of a heterogonous server fleet.

Using Redfish also has significant security benefitsunlike legacy management protocols, Redfish utilizes HTTPS
encryption for secure and reliable communication. All Redfish network traffic, including event notifications, can be
sent encrypted across the network.

Redfish provides a highly organized and easily accessible method to interact with a server using scripting tools. The
web interface employed by Redfish is supported by many programming languages, and its tree-like structure makes
information easier to locate. Data returned from a Redfish query can be turned into a searchable dictionary consisting
of key-value-pairs. By looking at the values in the dictionary, it is easy to locate settings and current status of a Redfish
managed system. These settings can then be updated and actions issued to one or multiple systems.

Next-generation server management


The DMTF white paper on Redfish, DSP2044, talks about the need to move away from managing servers as individual
pets. Rather, administrators should begin to treat their servers more as cattle and manage them as herds. While in
the past, IT staff could spend time to adapt their management methods to match a smaller number of servers, they
now have many more servers and much less time. Managing a large and growing infrastructure requires the capability
to issue commands at scale with the expectation that the herd will follow regardless of make or model of the
individual servers.

6 Introducing the Dell PowerEdge Redfish API


Rack, multi-node, and nested chassis
Another limitation of legacy management standards is an implied understanding that one management endpoint such
as a Baseboard Management Controller or BMC means one server. Modern converged server infrastructure such as
the PowerEdge M1000e and FX2 are becoming more prevalent, invalidating this assumption. Redfish explicitly
addresses converged infrastructure and rack-level management with modeling that can scale for the management of
multiple nodes, nested chassis, and server blades within a larger, actively managed enclosure.

Keeping up with changes in IT philosophy


Redfish has taken into account the recent changes in the IT field. These changes include not only new types of
hardware but also important changes in IT philosophy that are impacting how administrators expect to manage their
infrastructure.

Organizations are now looking for open management solutions that can be controlled in the same way they control
other resources, irrespective of whether the resources are located in a cloud or in a data center. By adopting data
structures and access methods as used for cloud- and web-based infrastructure, Redfish will enable management
methods aligned with modern IT infrastructure. Utilizing a modern data model and RESTful API, Redfish can be readily
integrated with the IT automation tools and processes employed by DevOps practices, a key requirement in many IT
organizations.

System administrators can use Redfish to manage heterogeneous server fleets more efficiently throughout the server
lifecycle from bare metal deployments to maintenance and repurposing. Using a simple and powerful interface that
supports modern automation technologies, Redfish can speed time-to-solution for IT developers.

Redfish key technologies


Redfish is a RESTful interface over HTTPS in JSON format based on ODATA v4 usable by clients, scripts, and browser-
based GUIs. It utilizes a range of IT technologies that have been selected because of their widespread use. By adopting
these accepted technologies, administrators will find it easier to use Redfish. Taken together, these technologies
create a new foundation from which servers can be managed using common programming and scripting languages,
such as Python, Java and C.

HTTPS communications
The Hypertext Transfer Protocol or HTTP is an application protocol for distributed, collaborative, hypermedia
information systems and forms the foundation of data communication for the World Wide Web. Secure HTTP or
HTTPS is a secure version of HTTP that enables secure communications by operating HTTP within a network
connection encrypted by TLS or SSL. By utilizing HTTPS, Redfish significantly enhances the security of server
management especially in comparison to legacy server management protocols.

RESTful application programming interface


REpresentational State Transfer or REST is a software architectural style used within the World Wide Web. Since 2000,
when representational state transfer was introduced and defined by Roy Fielding in his University of California Irvine
doctoral dissertation, REST has been applied for a range of purposes including the definition of web-based APIs.
Systems that adhere to REST practices are often referred to as RESTful interfaces and typically use the HTTP Methods

7 Introducing the Dell PowerEdge Redfish API


(GET, POST, DELETE, and more) that web browsers use to access web pages. RESTful architectures are now
commonly used by many IT solutions. Leveraging this standardized approach, Redfish implements a RESTful API for
accessing management information and for issuing commands to change the configuration or operational state of a
server.

JSON data
Redfish represents data using JSON. JSON is a lightweight data-interchange format that is easy for people to read and
write and also for machines to parse. JSON is based on a subset of the JavaScript Programming Language, using a text
format that is completely language independent but uses conventions familiar to programmers of the C-family of
languages such as C, C++, C#, Java, JavaScript, Perl, and Python. These properties make JSON an ideal data-
interchange language.

OData
OData is an open protocol standard for the definition and exchange of information using RESTful APIs. OData was
originally created in 2007 by Microsoft and subsequently standardized by the OASIS standards body. When
implementing a common interface across multiple vendors, it becomes important to standardize the data formats.
OData provides Redfish the required framework to ensure that the data structures remain interchangeable between
server vendors.

Eventing
The Redfish v1.0 specification includes support for eventing that enables the notification to a management client of
significant events occurring in a server. Redfish provides push style event notifications to an event listener, defined as a
Redfish compliant HTTPS server. The listener subscribes to the events of interest based on the event types defined in
the Redfish specification. Event subscriptions remain in place until specifically deleted or until the Redfish manager
such as iDRAC is reset to its default configuration.

Upon receiving an event subscription request, iDRAC will add the hostname of the requestor to the list of targets to be
notified when the event occurs. In the initial iDRAC Redfish implementation, all events are categorized under the Alert
Event Type with a maximum of 20 event subscriptions per event listener. If delivery of an event notification fails, the
event service will retry delivery. The parameters for re-delivery are configurable.

Redfish events are delivered only over HTTPS transport. In the initial iDRAC Redfish implementation, HTTPS certificates
are disabled; this requires the event listener to support receiving event notifications without certificate validation.
Eventing with certificate support is planned for a future release.

8 Introducing the Dell PowerEdge Redfish API


Redfish Operational Model
Redfish operations are initiated by a client using HTTPS for GET, POST, PATCH and DELETE operations and capable of
interpreting the JSON responses from the managed server. The responses provide the requested information and
indications of success or failure of the requested operation.

Redfish Client Managed Servers

Management
iDRAC
Network

GET https://<iDRAC IP>/redfish/v1/


JSON response
POST https://<iDRAC IP>/redfish/v1/
JSON response

Figure 1 - Redfish Operational Model

Redfish Client
The REST principle of "Everything is a Resource" means that every Uniform Resource Identifier or URI represents a
resource of a specific type. This can be a service, a collection, an entity or some other construct. In the Redfish
context, a resource can be thought of as the content of the HTTP message returned when accessing a URI. A variety
of REST Clients can be used for gaining access to Redfish resources such as:

Apps like Advanced REST Client and Postman from the Google Chrome web store
REST Easy and RESTClient plug-ins for the Firefox browser
cURL, Python, and other scripting/programming languages that provide support for dealing with URIs and for
parsing JSON payloads.

9 Introducing the Dell PowerEdge Redfish API


Redfish Architecture
Because the RESTful API employed by Redfish is web-based, access is provided using URIs, which can be typed into a
web browser. The Redfish API uses a simple folder structure that starts with the Redfish root at /redfish/. In the case
of a PowerEdge server, the root is accessed through the URI https://<iDRAC IP>/redfish/v1/ - the v1 at the end of the
URI denotes the version of the API.

The URI is the primary unique identifier of resources. Redfish URIs consist of three parts as described in RFC3986: Part
one defines the scheme and authority of the URI, part two specifies the root service and version and part three defines
a unique resource identifier.

For example, in the following URI: https://mgmt.vendor.com/redfish/v1/Systems/SvrID

https://mgmr.vendor.com is the scheme and authority


/redfish/v1 is the root and version
/Systems/SvrID is the resource identifier

Redfish tree structure


From the top-level root, the RESTful interface branches out to cover a number of Collections which each in turn
include multiple sub-items, creating a tree-like structure. The administrator can drill down through this structure to
find information and settings of interest.

Figure 2 - Redfish API Tree Structure

10 Introducing the Dell PowerEdge Redfish API


For example, accessing the Redfish structure for the PERC RAID controller on a PowerEdge R630 server would be
navigated by using the following path:

https://<iDRAC IP>/redfish/v1/Systems/System.Embedded.1/Storage/Controllers/RAID.Integrated.1-1

Or more graphically represented as:

Note that the API is best navigated starting from the root as some portions of an API path can vary depending upon
the server hardware configuration. For example, the RAID.Integrated.1-1 Sub-item in the preceding example may be
different when another type of RAID controller is installed in the managed server.

Redfish Operations
In Redfish, HTTP methods implement the operations of a RESTful API. This allows the user to specify the type of
request being made. It adheres to a standard CRUD (Create, Retrieve, Update, and Delete) format. Depending on the
desired result, a user can issue the following types of commands:

GET View data


POST Create resources or use actions
PATCH Change one or more properties on a resource
DELETE Remove a resource

Note: In the current implementation, HEAD and PUT operations are not supported for Redfish URIs.

Creation and removal of data are limited depending on the management characteristics of the resource being
targeted. Generally, viewing and changing settings will be more common.

Authentication
Depending upon the sensitivity of a given resource, Redfish clients will be required to authenticate their access. The
required credentials and supported forms of authentication are determined by the platform being managed. In the
case of iDRAC, authentication is supported using local iDRAC credentials or any of the other supported authentication
methods, such as LDAP and Active Directory.

Access to iDRAC data is allowed by authenticated and authorized users only, except as noted below. Authentication is
achieved using a subset of the common HTTP headers supported by a Redfish service in particular, the X-Auth-
Token header. More details on authentication are provided in the Session Management section of the Redfish
specification.

Authorization covers both user privilege and license authorization. Note that iDRAC Redfish support does not require
any special or separate licensing. The following table details the authentication and authorization required for each
iDRAC Redfish action:

11 Introducing the Dell PowerEdge Redfish API


Redfish Actions Authentication Authorization
Required Required
Read operation on any instrumentation data Yes Yes
Write operation on any instrumentation data Yes Yes
Execute operation on any instrumentation data Yes Yes
View Service root No No
View Metadata document No No
View OData Service Document No No
View Message Registry No No
Table 1 iDRAC Redfish authentication and authorization requirements
Unlike certain management interfaces that restrict authentication to a single command, the Redfish Service provides
access to Redfish URIs by using two methods:

Basic authentication: In this method, user name and password are provided for each Redfish API request.
Session Based Authentication: This method is used when issuing multiple Redfish operation requests.
o Session login is initiated by accessing the Create session URI. The response for this request includes an X-
Auth-Token header with a session token. Authentication for subsequent requests is made using this X-
Auth-Token header.
o Session logout is performed by issuing a DELETE of the Session resource provided by the Login operation
including the X-Auth-Token header.
o Using this approach, Redfish supports multiple transactions within a session with the help of X-Auth-
token, session token and Location headers.

Privileges
Privilege model requirements are aligned to the Redfish specification and schema. The following table shows the
relationship between Redfish Privileges and native iDRAC Privileges:

Redfish Privileges iDRAC Privileges


Login Login
ConfigureManager Config iDRAC
ConfigureUser Config User
ConfigureManager System Control
ConfigureComponents Virtual Console
ConfigureComponents Virtual Media
ConfigureManager Clear Logs

Table 2 Mapping Redfish Privileges to iDRAC Privileges

12 Introducing the Dell PowerEdge Redfish API


Using the Redfish API on PowerEdge systems
The following tests were carried out using a PowerEdge R730 server loaded with firmware version 2.30.30.30,
compliant with the initial Redfish release, specification version 1.0.0, published August, 2015. If a Redfish compliant
server is not available, a simulated server Redfish interface is available at the DMTF website:
http://redfish.dmtf.org/redfish/v1.

Web browser access


Because REST is a web-based API, a typical web browser such as Microsoft Internet Explorer or Google Chrome can
be used for access. Start the web browser and enter the iDRAC IP address or hostname followed by /redfish/v1/ and
the Redfish root is displayed as shown in the following figure:

Figure 3 Accessing PowerEdge Redfish interface using a web browser

Figure 3 illustrates the JSON response to a GET query. In order to improve readability, it is also possible to install a
JSON parser. The examples in this white paper use JSONView, (link accessible using Google Chrome) available from
the Chrome Web Store. Other JSON parsers are available for specific browsers and needs.

13 Introducing the Dell PowerEdge Redfish API


When the JSON parser is installed, an easier-to-read view of the JSON response from the iDRAC can be presented:

Figure 4 Viewing Redfish API with a JSON parser

Each of the @odata.id tags can be explored individually to allow a user to drill down deeper into the Redfish tree, but
further access will prompt for authentication.

For example, Figure 5 shows how to access the Chassis collection. When the /redfish/v1/Chassis/System.Embedded.1
URI is accessed, a pop-up box appears prompting for the entry of an iDRAC user name and password. After these
credentials are validated, more system details and additional @odata.id tags are presented:

Figure 5 iDRAC Redfish authenticated server details access

14 Introducing the Dell PowerEdge Redfish API


Accessing Redfish by using the cURL application
Interacting with Redfish using scripting tools can be extremely powerful. The following examples use a Dell Latitude
E7440 running Ubuntu to access the Redfish API from the command line using the cURL application.

cURL is a powerful open source command line tool for interacting with various web-based services. It supports both
HTTP and HTTPS in addition to other protocols. In the case of Redfish, cURL can be used to test the availability and
function of the REST interface.

Supplying cURL with the iDRAC IP address and the Redfish root will access the service root. If the server has a self-
signed certificate, as in this case, the certificate check can be skipped using the cURL option -k.

Command:

curl "https://<iDRAC IP>/redfish/v1/" -k

Response:
{"@odata.context":"/redfish/v1/$metadata#ServiceRoot","@odata.id":"/redfish/v1","@odata.type":"#ServiceRoot.1.0.0.Se
rviceRoot","AccountService":{"@odata.id":"/redfish/v1/Managers/iDRAC.Embedded.1/AccountService"},"Chassis":{"@od
ata.id":"/redfish/v1/Chassis"},"Description":"Root
Service","EventService":{"@odata.id":"/redfish/v1/EventService"},"Id":"RootService","JsonSchemas":{"@odata.id":"/redfish
/v1/JSONSchemas"},"Links":{"Sessions":{"@odata.id":"/redfish/v1/Sessions"}},"Managers":{"@odata.id":"/redfish/v1/Manag
ers"},"Name":"Root
Service","RedfishVersion":"1.0.0","Registries":{"@odata.id":"/redfish/v1/Registries/Messages/En"},"SessionService":{"@oda
ta.id":"/redfish/v1/SessionService"},"Systems":{"@odata.id":"/redfish/v1/Systems"},"Tasks":{"@odata.id":"/redfish/v1/TaskS
ervice"}}

For cleaner output formatting, the JSON output can be passed to Python and the module json.tool (output limited for
brevity):

Command:

curl "https://<iDRAC IP>/redfish/v1/" -k | python -m json.tool

Response:
{
"@odata.context": "/redfish/v1/$metadata#ServiceRoot",
"@odata.id": "/redfish/v1",
"@odata.type": "#ServiceRoot.1.0.0.ServiceRoot",
"AccountService": {
"@odata.id": "/redfish/v1/Managers/iDRAC.Embedded.1/AccountService"
},
"Chassis": {
"@odata.id": "/redfish/v1/Chassis"

15 Introducing the Dell PowerEdge Redfish API


Using cURL with authentication
As discussed above, Redfish supports Basic and Session based authentication. Here are the cURL commands used for
authentication operations:

Basic Authentication: Drilling down further into the Redfish API will require authentication. This can be done using
-u username:password on the cURL command line:

curl "https://<iDRAC IP>/redfish/v1/Chassis" -k -u root:calvin

This authenticates the single operation using the provided credentials.

Session Based Authentication: This requires a two stage process, creating a session called Login and deleting session
called Logout. For login, run the following command in verbose mode by appending option v; this will output the X-
Auth-Token value for use in the subsequent commands:

curl -k -X POST -d '{"UserName":"root","Password":"calvin"}' https://<iDRAC IP>/redfish/v1/Sessions -v

Once logged in, subsequent commands can be sent using X-Auth-Token as shown below:

curl -k https://<iDRAC IP>/redfish/v1/Chassis -v --header "X-Auth-Token: <X-Auth-Value>"

curl -k https://<iDRAC IP>/redfish/v1/Systems -v --header "X-Auth-Token: <X-Auth-Value>"

After executing the desired commands, the session can be terminated using Logout:

curl -k -X DELETE https://<iDRAC IP>/redfish/v1/Sessions/6 -v --header "X-Auth-Token: <X-


Auth-Value>"

Accessing Redfish by using Python scripting


One of the goals of the Redfish API is to enable easy access from common scripting languages such as Python. The
following Python script examples implement key Redfish API use cases. In these examples, it is assumed that the
Python HTTP requests library (found here: http://docs.python-requests.org/en/master/ ) has been downloaded. Also,
note that the examples assume the factory default credentials of root/calvin for access to the Redfish API these
should be changed to the appropriate credentials for a specific iDRAC target.

View general system information and status


In this use case, the SSL/TLS certificate check is skipped by setting verify=False. Note that the RAID.Integrated.1-1
path may differ between systems depending on the type of RAID controller installed. Therefore, it is recommended to
navigate the API path starting from the root.

import requests
import json

system = requests.get('https://<iDRAC
IP>/redfish/v1/Systems/System.Embedded.1',verify=False,auth=('root','calvin'))

16 Introducing the Dell PowerEdge Redfish API


storage = requests.get('https://<iDRAC
IP>/redfish/v1/Systems/System.Embedded.1/Storage/Controllers/RAID.Integrated.1-
1',verify=False,auth=('root','calvin'))

systemData = system.json()
storageData = storage.json()

print "Model: {}".format(systemData[u'Model'])


print "Manufacturer: {}".format(systemData[u'Manufacturer'])
print "Service tag {}".format(systemData[u'SKU'])
print "Serial number: {}".format(systemData[u'SerialNumber'])
print "Hostname: {}".format(systemData[u'HostName'])
print "Power state: {}".format(systemData[u'PowerState'])
print "Asset tag: {}".format(systemData[u'AssetTag'])
print "Memory size: {}".format(systemData[u'MemorySummary'][u'TotalSystemMemoryGiB'])
print "CPU type: {}".format(systemData[u'ProcessorSummary'][u'Model'])
print "Number of CPUs: {}".format(systemData[u'ProcessorSummary'][u'Count'])
print "System status: {}".format(systemData[u'Status'][u'Health'])
print "RAID health: {}".format(storageData[u'Status'][u'Health'])

Output:
Model: PowerEdge R730
Manufacturer: Dell Inc.
Service tag BN7----
Serial number: CN7-----------
Hostname: XenServer
Power state: On
Asset tag:
Memory size: 64.0
CPU type: Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz
Number of CPUs: 2
System status: OK
RAID health: OK

17 Introducing the Dell PowerEdge Redfish API


View system health across multiple servers
This example displays the service tag and overall system status for multiple systems; the source servers are identified
by a file consisting of iDRAC IP addresses and FQDNs as input.

import requests
import json

with open("serverList.txt", "r") as serverList:


for server in serverList.readlines():
req = requests.get("https://" + server.rstrip() +
"/redfish/v1/Systems/System.Embedded.1",verify=False,auth=('root','calvin'))
reqJson = req.json()
print "System {}: Health status:
{}".format(reqJson[u'SKU'],reqJson[u'Status'][u'Health'])

View system event log


import requests
import json

system = requests.get('https://<iDRAC
IP>/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Sel',verify=False,auth=('root','calvin'))

systemData = system.json()

for logEntry in systemData[u'Members']:


print "{}: {}".format(logEntry[u'Name'],logEntry[u'Created'])
print " {}\n".format(logEntry[u'Message'])

Output (shortened for brevity):


Log Entry 93: 2016-02-26T09:35:55+09:00
The chassis is closed while the power is off.

Log Entry 92: 2016-02-26T09:35:50+09:00


The chassis is open while the power is off.

Log Entry 91: 2015-09-24T14:04:59+09:00


OEM software event.

Log Entry 90: 2015-09-24T14:04:59+09:00


C: boot completed.

18 Introducing the Dell PowerEdge Redfish API


Check system power state
This script displays the current server power state - on or off.

import requests
import json

response = requests.get('https://<iDRAC
IP>/redfish/v1/Systems/System.Embedded.1',verify=False,auth=('root','calvin'))

data = response.json()

print data[u'PowerState']

Power on a system
Server power is controlled by using a POST operation to the ComputerSystem.Reset URI to request the desired action.

import requests
import json

url = 'https://<iDRAC
IP>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset'
payload = {'ResetType': 'On'}
headers = {'content-type': 'application/json'}

response = requests.post(url, data=json.dumps(payload), headers=headers, verify=False,


auth=('root','calvin'))

Power off a system


import requests
import json

url = 'https://<iDRAC
IP>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset'
payload = {'ResetType': 'ForceOff'}
headers = {'content-type': 'application/json'}

response = requests.post(url, data=json.dumps(payload), headers=headers, verify=False,


auth=('root','calvin'))

19 Introducing the Dell PowerEdge Redfish API


View system power usage
Use this script to view current, average, minimum, and maximum system power consumption.

import requests
import json

system = requests.get('https://<iDRAC
IP>/redfish/v1/Chassis/System.Embedded.1/Power/PowerControl',verify=False,auth=('root','c
alvin'))

systemData = system.json()

print "Consumed power: {}".format(systemData[u'PowerConsumedWatts'])


print "Average reading:
{}".format(systemData[u'PowerMetrics'][u'AverageConsumedWatts'])
print "Max reading: {}".format(systemData[u'PowerMetrics'][u'MaxConsumedWatts'])
print "Min reading: {}".format(systemData[u'PowerMetrics'][u'MinConsumedWatts'])

Output:
Consumed power: 149
Average reading: 155
Max reading: 169
Min reading: 144

Update general System Information with PATCH operation


This example demonstrates how to update the System read/write properties as defined in the Redfish specification.
Users can provide information about the properties in the System and can update single or multiple properties. If the
user provides invalid information for updating a property due to an invalid data type or unacceptable data, the iDRAC
Redfish service provides extended information along with an error indication.

import requests
import json

url = 'https://<iDRAC IP>/redfish/v1/Systems/System.Embedded.1'


payload = {' Hostname ': ' Ubuntu ' }
headers = {'content-type': 'application/json'}

response = requests.patch(url, data=json.dumps(payload), headers=headers, verify=False,


auth=('root','calvin'))

print "Status Code: {}".format(response.status_code)


print "Extended Info Message: {}".format(response.json())

20 Introducing the Dell PowerEdge Redfish API


Output:
Status Code: 200
Extended Info Message: {u'Success': {u'Message': u'Successfully Completed Request',
u'Resolution': u'None', u'Severity': u'Ok', u'MessageId': u'Base.1.0.Success'}}

Using the above script, if the user provides an incorrect type for the input data as shown below, they will receive
extended information specifying the error. For example, if the payload was improperly input as:

payload = {' Hostname ': 1234 } this would result in the following output:

Output:
Status Code: 400
Extended Info Message: {u'error': {u'code': u'Base.1.0.GeneralError', u'message':
u'A general error has occurred. See ExtendedInfo for more information',
u'@Message.ExtendedInfo': [{u'Severity': u'Warning', u'MessageId':
u'Base.1.0.PropertyValueTypeError', u'RelatedProperties': [u'HostName'], u'Message':
u'The value integer or boolean for the property HostName is of a different type than the
property can accept.', u'Resolution': u'Correct the value for the property in the request
body and resubmit the request if the operation failed.', u'MessageArgs': [u'integer or
boolean', u'HostName']}]}}

If there are internal processing errors for a request, a 500 status code will be returned with an internal error message:

Output:
Status Code: 500
Extended Info Message: {u'error': {u'code': u'Base.1.0.GeneralError', u'message':
u'A general error has occurred. See ExtendedInfo for more information',
u'@Message.ExtendedInfo': [{u'Severity': u'Critical', u'MessageId':
u'Base.1.0.InternalError', u'RelatedProperties': [u'HostName'], u'Message': u'The request
failed due to an internal service error. The service is still operational.',
u'Resolution': u'Resubmit the request. If the problem persists, consider resetting the
service.'}]}}

The same approach is implemented for POST and DELETE operations.

Change boot device temporarily


Instructing a server to boot once into BIOS or to boot from an alternate source, such as PXE can be done by
modifying the BootSourceOverrideTarget value. Note that a PATCH action is required because the script updates the
existing boot target value.

import requests
import json

url = 'https://<iDRAC IP>/redfish/v1/Systems/System.Embedded.1'


payload = {'Boot': {'BootSourceOverrideTarget': 'BiosSetup'} }

21 Introducing the Dell PowerEdge Redfish API


headers = {'content-type': 'application/json'}

response = requests.patch(url, data=json.dumps(payload), headers=headers, verify=False,


auth=('root','calvin'))

Update / modify iDRAC user account


The iDRAC has pre-defined slots for internal user accounts. To modify an account, a PATCH action is used rather than
a POST. RoleId is used to specify the type of access permissions to be granted to the user; in this case, the Operator
role is used.

import requests
import json

url = 'https://<iDRAC IP>/redfish/v1/Managers/iDRAC.Embedded.1/Accounts/<Account-id>'

plUserName = {'UserName': 'user03'}


plPass = {'Password': 'calvin'}
plRoleId = {'RoleId': 'Operator'}

headers = {'content-type': 'application/json'}

for payload in plUserName,plPass,plRoleId:


response = requests.patch(url, data=json.dumps(payload), headers=headers,
verify=False, auth=('root','calvin'))

Extended Information
When errors occur during operations, Redfish provides Extended Information detailing the error. iDRAC includes a
Dell-provided Message Registry, accessible by the MessageId returned as part of the Extended Information, that gives
direction for resolution of the error.

The following is a Python scripting example illustrating Extended Information:

import requests
import json

url = 'https://<iDRAC
IP>/redfish/v1/Managers/iDRAC.Embedded.1/SerialInterfaces/iDRAC.Embedded.1%23Serial.1'
payload = {'BitRate':19200}
headers = {'content-type':'application/json'}

response =
requests.patch(url,data=json.dumps(payload),headers=headers,verify=False,auth=('root','ca
lvin'))

print "Status Code:{}".format(response.status_code)

22 Introducing the Dell PowerEdge Redfish API


print "Extended Error Message:{}".format(response.json())

The above script updates the property 'BitRate' to the value 19200, a valid setting.

Output:
Status Code: 200
Extended Error Message:{u'Success': {u'Message': u'Successfully Completed Request',
u'Resolution': u'None', u'Severity': u'Ok', u'MessageId': u'Base.1.0.Success'}}

If the script is modified to attempt an update with an unsupported value, an error will occur and Extended Information
will be returned:

payload = {'BitRate':1900}

Output:
Status Code: 400
Extended Error Message: {u'error': {u'code': u'Base.1.0.GeneralError', u'message':
u'A general error has occurred. See ExtendedInfo for more information',
u'@Message.ExtendedInfo': [{u'Severity': u'Warning', u'MessageId':
u'Base.1.0.PropertyValueNotInList', u'RelatedProperties': [u'BitRate'], u'Message': u'The
value 1900 for the property BitRate is not in the list of acceptable values.',
u'Resolution': u'Choose a value from the enumeration list that the implementation can
support and resubmit the request if the operation failed.', u'MessageArgs': [u'1900',
u'BitRate']}]}}

The following example uses an incorrect data type a text string rather than a numeric value. This illustrates the
distinctive error information and resolutions provided by Extended Information and the Dell Message Registry.

payload = {'BitRate':'19200'}

Output:
Status Code:400
Extended Error Message: {u'error': {u'code': u'Base.1.0.GeneralError', u'message':
u'A general error has occurred. See ExtendedInfo for more information',
u'@Message.ExtendedInfo': [{u'Severity': u'Warning', u'MessageId':
u'Base.1.0.PropertyValueTypeError', u'RelatedProperties': [u'BitRate'], u'Message': u'The
value string or boolean for the property BitRate is of a different type than the property
can accept.', u'Resolution': u'Correct the value for the property in the request body and
resubmit the request if the operation failed.', u'MessageArgs': [u'string or boolean',
u'BitRate']}]}}

23 Introducing the Dell PowerEdge Redfish API


Summary
The DMTF Redfish standard is emerging as a key new tool for efficient, scalable, and secure server management.
Utilizing an industry-standard interface and data format, Redfish supports rapid development of automation for one-
to-many server management. System administrators and IT developers will appreciate Redfishs features that can
increase efficiency, lower costs and boost productivity across their organizations.

Dell is a committed leader in the development and implementation of open, industry standards. Supporting Redfish
within the iDRAC with Lifecycle Controller further enhances the manageability of PowerEdge servers, providing
another powerful tool to help IT administrators reduce complexity and help save time and money.

24 Introducing the Dell PowerEdge Redfish API


Dell Customer Solution Centers
This white paper was produced with the assistance of the Dell Customer Solution Center, Tokyo. Dell Customer
Solution Centers are a global network of connected labs that enable Dell customers to strategize, architect, validate
and build solutions, from the data center to the edge of the network. With centers located around the globe, they can
help customers whether through an informal 30-60 minute briefing, a half-day workshop, or a proof-of-concept that
enables kicking the tires of a solution prior to a purchase decision. Customers can contact their Dell account team to
initiate an engagement with a Solution Center. To learn more visit www.dell.com/solutioncenters.

Bangalore

Figure 6 Dell Customer Solution Center locations

25 Introducing the Dell PowerEdge Redfish API


Additional Information
DMTF white papers, Redfish Schemas, specifications, webinars and work-in-progress documents

https://www.dmtf.org/standards/redfish

The Redfish standard specification is available from the DMTF website

http://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.0.1.pdf

The iDRAC with Lifecycle Controller home page on Dell TechCenter provides access to product documents, technical
white papers, how-to videos and more

http://en.community.dell.com/techcenter/systems-management/w/wiki/3204

JSON lightweight data interchange format

http://www.json.org/

OData4 open protocol standard for the definition and exchange of information using RESTful APIs

http://www.odata.org/

Acronyms
API Application Programming Interface
BMC Baseboard Management Controller
DMTF Distributed Management Task Force
DSP DMTF Standard Publications
FQDD Fully Qualified Device Descriptor
HTTP Hyper Text Transfer Protocol
HTTPS HTTP Secure or HTTP over TLS/SSL
iDRAC Integrated Dell Remote Access Controller
IPMI Intelligent Platform Management Interface
JSON Java Script Object Notation
LC Lifecycle Controller
OData Open Data Protocol
OOB Out-of-Band
REST Representational State Transfer
SNMP Simple Network Management Protocol
SPMF Scalable Platforms Management Forum
SSL Secure Sockets Layer
TLS Transport Layer Security
URI Uniform Resource Identifier

26 Introducing the Dell PowerEdge Redfish API


Definitions
cURL: an open source command line tool and library for transferring data with URL Syntax
DMTF: Distributed Management Task Force, defines management standards supported by numerous
hardware, software and service vendors.(www.dmtf.org )
Redfish Client: Name for the functionality that communicates with a Redfish Service and accesses one or
more resources or functions of the Service.
Event: A record that corresponds to an individual alert.
Subscription: The act of registering a destination for the reception of events.
Notification: One-way message sent to indicate that an event has occurred
Redfish Event Listener: The name for the functionality that receives alerts from a Redfish Service. This
functionality is typically software running on a remote system that is separate from the managed system.

27 Introducing the Dell PowerEdge Redfish API

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy