HP 3PAR StoreServ 7450 4-node HP 3PAR Web Service API 1.2 Developer's - Page 16

Deleting a Session Key, Session Key Deletion Success, HTTP Status and Error Codes, The code Member

Page 16 highlights

Host: InServ1:8008 Accept: */* X-HP3PAR-WSAPI-SessionKey: 48A70B8A8301C458037E0821 Supported JSON sub-objects for the Accept: */* header are shown in Table 1 (page 12). Deleting a Session Key When a client is finished making requests to the server it should delete the session keys it created. This frees up server resources and allows for better server performance. NOTE: Unused session keys expire automatically after fifteen minutes. To delete a session key, send a request with the HTTP DELETE method and the URI: https://:8080/api/v1/credentials/ where is the key that is returned in the process of creating a session key. For more information, see "Creating Credentials" (page 14). Session Key Deletion Success A successful session key deletion returns the HTTP status code 200 OK, without a message body. Session Key Deletion Errors An error condition returns an error object as a message body. Example To delete credentials using cURL, enter the following command (as a single line): curl -X DELETE -H "Accept: application/json" https://:8080/api/v1/credentials/1-c86aedb2e7e98b41-b06d2d50 HTTP Status and Error Codes When an operation is successful, the system returns one of the following HTTP status codes: • 200 OK • 201 Created When an operation fails, one of several HTTP status codes is returned. Also, the message body contains a JSON object with information specific to the HP 3PAR WSAPI. The JSON object contains the members code, desc, and, when relevant, ref. The code member is a number and the rest are strings. The JSON object contains the following members: The code Member Just as is the case with CLI text, the text in the desc member (see Table 5 (page 17)) is subject to change and cannot be relied upon. To avoid that problem, the WSAPI provides a reliable code for an error. The error code member is a JSON numeric type. Only codes that are defined in the table below will be returned. For applications that change behavior based on errors, only the code member should be relied on. For ease of reading documentation, a symbol is defined for each numeric code, but the symbol is not part of the API. The numeric value is the contract between client and server. The codes are described in Table 5 (page 17). Generic codes for the WSAPI are described in Table 5 (page 17). 16 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

Host: InServ1:8008
Accept: */*
X-HP3PAR-WSAPI-SessionKey: 48A70B8A8301C458037E0821
Supported JSON sub-objects for the
Accept: */*
header are shown in
Table 1 (page 12)
.
Deleting a Session Key
When a client is finished making requests to the server it should delete the session keys it created.
This frees up server resources and allows for better server performance.
NOTE:
Unused session keys expire automatically after fifteen minutes.
To delete a session key, send a request with the HTTP DELETE method and the URI:
https://
<storage system>
:8080/api/v1/credentials/
<session key>
where
<session key>
is the key that is returned in the process of creating a session key. For
more information, see
“Creating Credentials” (page 14)
.
Session Key Deletion Success
A successful session key deletion returns the HTTP status code
200 OK
, without a message body.
Session Key Deletion Errors
An error condition returns an error object as a message body.
Example
To delete credentials using cURL, enter the following command (as a single line):
curl -X DELETE -H "Accept: application/json" https://
<storage
system>
:8080/api/v1/credentials/1-c86aedb2e7e98b41-b06d2d50
HTTP Status and Error Codes
When an operation is successful, the system returns one of the following HTTP status codes:
200 OK
201 Created
When an operation fails, one of several HTTP status codes is returned. Also, the message body
contains a JSON object with information specific to the HP 3PAR WSAPI.
The JSON object contains the members
code
,
desc
, and, when relevant,
ref
. The
code
member
is a number and the rest are strings.
The JSON object contains the following members:
The
code
Member
Just as is the case with CLI text, the text in the
desc
member (see
Table 5 (page 17)
) is subject to
change and cannot be relied upon. To avoid that problem, the WSAPI provides a reliable code
for an error.
The error code member is a JSON numeric type. Only codes that are defined in the table below
will be returned.
For applications that change behavior based on errors, only the
code
member should be relied
on. For ease of reading documentation, a symbol is defined for each numeric code, but the symbol
is not part of the API. The numeric value is the contract between client and server. The codes are
described in
Table 5 (page 17)
.
Generic codes for the WSAPI are described in
Table 5 (page 17)
.
16
Accessing the WSAPI