Query responses

RESTful API returns a response to a query with a structure that varies based on the system resource and the status of the operation.

RESTful API returns responses that are specific to the requested query.

GET response structure

The successful response displays data pertaining to the properties of the specified resource. If the query is unsuccessful, server information is displayed.
counts
Displays the response count and total count of objects
data_count
Holds the number of objects in this response data.
total_count
Holds the number of total objects.
data
Displays the queried resource (for example, "volumes") followed by its properties.
server
Displays the status of the requested query, a failure code, and a corresponding error message.

Example: Successful response to a volume query

GET /v1/volumes/0000
"counts":
{
 "data_counts": "",
 "total_counts": ""
},
“data”
{
 “volumes”:
  [
   {
	“link” : { “rel” : “self”, “href” : “https://{hmc}:8452/api/v1/volumes/0000” },
	“id” : “0000”,
	“name” : “mytest”,
	“state” : "pinned“ | "readonly“ | "inaccessible“ | "indeterminate_data_loss“ |
	"rank_failed“ | "rank_repairing“ | "rank_repaired“ | "global_inaccessible“ |
	"global_lost“ | "virtual_space_fault“ | "nvs_inaccessible“ | "normal“ |
	"configuring“ | "reconfiguring“ | "migrating“ | "deconfiguring“ | "config_error“ |
	"reconfig_error“ | "migration_error" | "deconfig_error“ | "merging“ |
	"migration_paused“ | "migration_cancelled“ | "transposition_error“ | "unknown"
	“cap” : ”322122547200”,
	“stgtype” : “fb” | “ckd”,
	“VOLSER” : “”,
	“lss” : { “id” : “00”,  “link” : { “rel” : “self”, “href” : “https://{hmc}:
	8452/api/lss/00” } },
	“allocmethod” : “legacy” | “rotatevols” | “rotateexts” | “managed” | “”,
	“tp” : ”none”,
	“capalloc” : “134217728”,
	“MTM” : “2107-900”,
	“datatype” : “FB 512” | “FB 512T” | “FB 520P” | "FB 520U“ | "FB 520PV“ |
	"FB 520UV“ | "3380“ | "3390“ | "3390-A“ | “”,
	“easytier” : “managed” | “none” | “unknown”,
	“tieralloc” : 
	[
	{ “tier” : “ENT” , “allocated” : “34502” }
	],
	“pool” : { “id” : “P2”, “link” : { “rel” : “self”, “href” : “https://{hmc}:
	8452/api/v1/pools/P2” }}
  }
 ]
}

Example: Unsuccessful response to an invalid query

The request GET /myvolumes returns the following response because the query is not valid.
GET /myvolumes

 {
 “server” :
  {
   “status” : ”failed”,
   “code” : “BE7A001D”,
   “message” : ”Failed to get bundle version.”
  }
 }