HP OneView Deployment and Management Guide 1.10

Technical white paper | HP OneView Deployment and Management Guide
149
view the list of resources, see HP Converged Infrastructure Controller REST API Reference located in the Online Help of the
appliance [https://{ip}/help/cic/en/content/images/api/].
Resource operations
Basic Create, Read, Update and Delete (CRUD) operations are performed on the appliance resources via the standard HTTP
POST, GET, PUT and DELETE methods. RESTful interfaces are based on the World Wide Web standards, thus most modern
web servers can support these operations without modification.
Restful APIs are stateless. The resource state is maintained by the resource manager and is reported as the resource
representation. Any application state must be maintained by the client and it may manipulate the resource locally, but until
a PUT or POST is made, the resource as known by the resource manager is not changed.
Table 10. REST HTTP Operations
Operation
HTTP Verb
Description
Create
POST URI <Payload = Resource data>
New resources are created using the POST operation and
including relevant data in the payload. On Success the
Resource URI is returned.
Read
GET URI
Returns the requested resource representation(s)
Update
PUT URI <Payload = Update data>
Update an existing resource using the update data.
Delete
DELETE URI
Delete the addressed resource
URI format
All the appliance URIs point to resources and the client does not need to modify or create URIs. The URI for specific resource
is static and follows this format: https://{appl}/rest/{resource name}. The three parts are described below.
Table 11. URI Format
The appliance address.
Type of URI.
Name of the appliance resource such as server-
profile.
Data transfer format
The appliance resources support JSON (JavaScript Object Notation) as the standard for exchanging data using a REST API. If
JSON is not specified in the REST API call, then the default is JSON.
To learn more about JSON, go to www.json.org.
Accessing the ReST API with PowerShell
The HP OneView PowerShell Library is available for download at https://hponeview.codeplex.com, both the source code and
a pre-built installer. The library requires at least the Windows Management Framework 3.0 (aka PowerShell 3.0) to be
installed, and the .Net 4.0 Client Framework. Windows Management Framework 4.0 (aka PowerShell 4.0) that ships with
Windows 8.1/8.1 Update is supported. The HP OneView POSH Library Installer will assist you with the installation of these
two required components if not found on the system.
Please visit the HP OneView Online Documentation page (https://hponeview.codeplex.com/documentation), or use the get-
help PowerShell cmdlet, for all available CMDLETs and the associated help.
Using PowerShell
Note
The following example assumes the HP OneView POSH Library is installed with the available install package.