1 resource operations – HP OneView User Manual

Page 71

Advertising
background image

5 Using the REST APIs and other programmatic interfaces

REST (Representational State Transfer) is a web service that uses basic CRUD (Create, Read, Update
and Delete) operations performed on resources using HTTP POST, GET, PUT, and DELETE. To
learn more about REST concepts, see

http://en.wikipedia.org/wiki/Representational_state_transfer

.

The appliance has a resource-oriented architecture that provides a uniform REST interface. Every
resource has one URI (Uniform Resource Identifier) and represents a physical device or logical
construct. You can use REST APIs to manipulate resources.

For general information about REST APIs, see the following topics:

“Resource operations” (page 71)

“Return codes” (page 72)

“URI format” (page 72)

“Resource model format” (page 72)

“Log in to the appliance using REST APIs” (page 72)

“REST API version” (page 72)

“Asynchronous versus synchronous operations” (page 73)

“Task resource” (page 73)

“Error handling” (page 73)

“Concurrency control using etags” (page 73)

“Querying resources using common REST API parameters” (page 74)

“State Change Message Bus” (page 74)

“Developer tools in a web browser” (page 74)

“Using Python and Windows PowerShell commands (technical preview)” (page 74)

5.1 Resource operations

RESTful APIs are stateless. The resource manager maintains the resource state that is reported as
the resource representation. The client maintains the application state and the client might manipulate
the resource locally, but until a PUT or POST is made, the resource as known by the resource
manager is not changed.

Description

HTTP Verb

Operation

Creates new resources. A synchronous POST returns the newly created
resource. An asynchronous POST returns a TaskResource URI in the
Location

header. This URI tracks the progress of the POST operation.

POST

resource URI (payload =

resource data)

Create

Returns the requested resource representation(s)

GET

resource URI

Read

Updates an existing resource

PUT

resource URI (payload =

update data)

Update

Deletes the specified resource

DELETE

resource URI

Delete

5.1 Resource operations

71

Advertising