beautypg.com

4 resource model format, 5 log in to the appliance using rest apis, 6 rest api version and backward compatibility – HP OneView User Manual

Page 78: Supported rest api versions

background image

5.4 Resource model format

The resources support JSON (JavaScript Object Notation) for exchanging data using a REST API.
If not otherwise specified in the REST API operation, the default is JSON.

5.5 Log in to the appliance using REST APIs

When you log in to the appliance using the login-sessions REST API, a session ID is returned.
You use the session ID in all subsequent REST API operations in the auth header, except as noted
in REST API Request Headers. The session ID is valid for 24 hours.

Log out

Log in

Operation

DELETE

API

/rest/login-sessions

Request headers

auth:{YourSessionID}

REST API Request Headers

Request body

None

Response

204 No Content

Operation

POST

API

/rest/login-sessions

Request headers

REST API Request Headers

Request body

{"userName":"YourUserName","password":"YourPassword"}

NOTE:

This is an example of a local log in on the

appliance. If you are using a directory service, you must
add the following attributes: authnHost and
authLoginDomain

.

Response

The LoginSessionIdDTO that includes the session ID

5.6 REST API version and backward compatibility

When you perform a REST API operation, an X-API-Version header is required. This version
header corresponds to the REST API version of software currently running on the appliance. To
determine the correct REST API version, perform /rest/version. This GET operation does not
require an X-API-Version header. If multiple appliances are running in your environment, you
need to determine the REST API version required by each appliance.

The requests documented in the HP OneView 1.10 REST API scripting help correspond to a
versionNumber

of 101. Requests specifying API version 101 always provide the behavior

documented here. Future API changes will introduce higher version numbers.

Supported REST API versions

This release of HP OneView supports the new REST API version 101 in addition to supporting the
REST API version 3 (minimum) that was supported in previous releases of HP OneView.

The HP OneView REST API documentation for older REST API versions is available online at

http://

www.hp.com/go/oneview/docs

, and the documentation for the current version of supported REST

APIs is included with the online help for this release as well as online.

78

Using the REST APIs and other programmatic interfaces