HP 3PAR StoreServ 7400 4-node HP 3PAR Web Service API 1.2 Developer's - Page 14

Supported HTTP Methods, General URI Format, System Access, Creating Credentials

Page 14 highlights

Supported HTTP Methods This section summarizes the HTTP methods currently supported by the HP 3PAR WSAPI. These include: GET The HTTP GET method retrieves information identified by the request-URI. POST The HTTP POST method requests that an object described by the body of the request be created in the collection identified by the URI. PUT The HTTP PUT method requests that an entity identified by the Request-URI be modified. DELETE The HTTP DELETE method requests that the server delete the resource identified by the request URI. General URI Format All operations of the API are performed using an HTTP method (GET, POST, PUT, or DELETE) and a Uniform Resource Identifier (URI). In this example, the URI corresponds to the volume named projectXvol residing on the HP 3PAR storage system with the hostname storsys1.example.com: https://storsys1.example.com:8080/api/v1/volumes/projectXvol System Access This section discusses the use of session keys with the WSAPI. Session keys enable access to the HTTP methods for a single session. Creating Credentials In order to use the Web Services, you must create a session key by providing a username and password. The username and password are the same that you would use to access the HP 3PAR storage server through the HP 3PAR Command Line Interface (CLI) or the HP 3PAR Management Console (MC). The authorization carries the same user permissions for the WSAPI as for the CLI or MC, in that you have permission to perform the same operations through the API (where available) as you would with the CLI or MC. 1. Create a session key using the HTTP POST method with a URI of the following format: https://:8080/api/v1/credentials 2. The message body of the request is a JSON object, with members as shown in Table 3 (page 14). Table 3 Session Key Message Body Member JSON Objects Member user password JSON Type string string Value Username User's password Description User's name. User's password. NOTE: For error output for this and other conditions, see "HTTP Status and Error Codes" (page 16). About Multiple Session Keys A multi-threaded client application can use one session key in multiple threads concurrently. However, the requested operations will be serialized by the server. When true concurrency is needed, a client can create a session key for each concurrent thread. NOTE: This increases server resource usage and should be kept to a small number to avoid affecting server performance. 14 Accessing the WSAPI

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107

Supported HTTP Methods
This section summarizes the HTTP methods currently supported by the HP 3PAR WSAPI. These
include:
GET
The HTTP GET method retrieves information identified by the request-URI.
POST
The HTTP POST method requests that an object described by the body of the request
be created in the collection identified by the URI.
PUT
The HTTP PUT method requests that an entity identified by the Request-URI be modified.
DELETE
The HTTP DELETE method requests that the server delete the resource identified by the
request URI.
General URI Format
All operations of the API are performed using an HTTP method (GET, POST, PUT, or DELETE) and
a Uniform Resource Identifier (URI). In this example, the URI corresponds to the volume named
projectXvol
residing on the HP 3PAR storage system with the hostname
storsys1.example.com
:
System Access
This section discusses the use of session keys with the WSAPI. Session keys enable access to the
HTTP methods for a single session.
Creating Credentials
In order to use the Web Services, you must create a session key by providing a username and
password. The username and password are the same that you would use to access the HP 3PAR
storage server through the HP 3PAR Command Line Interface (CLI) or the HP 3PAR Management
Console (MC). The authorization carries the same user permissions for the WSAPI as for the CLI
or MC, in that you have permission to perform the same operations through the API (where available)
as you would with the CLI or MC.
1.
Create a session key using the HTTP POST method with a URI of the following format:
https://
<storage system>
:8080/api/v1/credentials
2.
The message body of the request is a JSON object, with members as shown in
Table 3 (page
14)
.
Table 3 Session Key Message Body Member JSON Objects
Description
Value
JSON Type
Member
User’s name.
Username
string
user
User’s password.
User's password
string
password
NOTE:
For error output for this and other conditions, see
“HTTP Status and Error Codes” (page 16)
.
About Multiple Session Keys
A multi-threaded client application can use one session key in multiple threads concurrently.
However, the requested operations will be serialized by the server. When true concurrency is
needed, a client can create a session key for each concurrent thread.
NOTE:
This increases server resource usage and should be kept to a small number to avoid
affecting server performance.
14
Accessing the WSAPI