List Storage Switches of a Storage Site

The List Storage Switches of a Storage Site operation lists the storage switches associated with the storage site with the given identifier.

HTTP method and URI

GET /api/storage-sites/{storage-site-id}/storage-switches

In this request, the URI variable {storage-site-id} is the object-id of the Storage Site object.

Query parameters:

Name Type Rqd/Opt Description
name String Optional Filter pattern (regular expression) to limit returned objects to those that have a matching name property.
domain-id String Optional Filter pattern (regular expression) to limit returned objects to those that have a matching domain-id property.
storage-fabric-uri String/ URI Optional Filter string to limit returned objects to those that have a matching storage-fabric-uri property.

Response body contents

On successful completion, the response body is a JSON object with the following fields:

Field name Type Description
storage-switches Array of storage-switch-info objects Array of storage-switch-info objects, described in the next table. The returned array may be empty.

Each nested storage-switch-info object contains the following fields:

Field name Type Description
object-uri String/ URI Canonical URI path (object-uri) of the Storage Switch object.
name String The name property of the Storage Switch object.
domain-id String The domain-id property of the Storage Switch object.
storage-fabric-uri String/ URI The storage-fabric-uri property of the Storage Switch object.

Description

This operation lists the storage switches that are associated with the identified storage site. The object URI, name, domain ID and associated storage fabric are provided for each.

If the object ID {storage-site-id} does not identify a Storage Site object on the HMC, a 404 (Not Found) status code is returned.

If the name or domain-id query parameters are specified, the returned list is limited to those storage switches that have the same-named property matching the specified filter pattern. If any parameter is omitted, this filtering on that property is not done.

If the storage-fabric-uri query parameter is specified, the returned list is limited to those storage switches that have a matching storage-fabric-uri property. If the storage-fabric-uri parameter is omitted, this filtering is not done.

A storage switch is included in the list only if the API user has task permission for the Configure Storage – System Programmer or Configure Storage – Storage Administrator tasks. If the specified storage site is associated with a storage switch but the API user does not have permission to it, that object is simply omitted from the list but no error status code results.

If no storage switches are to be included in the results due to filtering or lack of task permission, an empty list is provided and the operation completes successfully.

Authorization requirements

This operation has the following authorization requirement:
  • Action/task permission to the Configure Storage – System Programmer or Configure Storage – Storage Administrator tasks.

HTTP status and reason codes

On success, HTTP status code 200 (OK) is returned and the response body is provided as described in Response body contents.

The following HTTP status codes are returned for the indicated errors. The response body is a standard error response body providing the reason code indicated and any associated error message.

Table 1. List Storage Switches of a Storage Site: HTTP status and reason codes
HTTP error status code Reason code Description
400 (Bad Request) Various Errors were detected during common request validation. See Common request validation reason codes for a list of the possible reason codes.
14 A query parameter defines an invalid value.
404 (Not Found) 1 The storage site with the object ID {storage-site-id} does not exist on the HMC.

Additional standard status and reason codes can be returned, as described in Invoking API operations.

Example HTTP interaction

Figure 1. List Storage Switches of a Storage Site: Request
GET /api/storage-sites/0336a208-9434-11e8-9c43-fa163e27d492/storage-switches 
  HTTP/1.1
x-api-session: 158gv9ldjh8x0yarl3qjx5o7xhemmtku20ejfi92rtk8hb3yln
Figure 2. List Storage Switches of a Storage Site: Response
200 OK
server: Hardware management console API web server / 2.0
cache-control: no-cache
date: Mon, 30 Jul 2018 20:39:12 GMT
content-type: application/json;charset=UTF-8
content-length: 424
{
   "storage-switches":[
      {
         "domain-id":"11",
         "name":"Storage switch 11",
         "object-uri":"/api/storage-switches/fdc68064-9437-11e8-8ffe-fa163e27d492",
         "storage-fabric-uri":"/api/storage-fabrics/08ad557c-9436-11e8-9c43-fa163e27d492"
      },
      {
         "domain-id":"21",
         "name":"Storage switch 21",
         "object-uri":"/api/storage-switches/0e261690-9438-11e8-8ffe-fa163e27d492",
         "storage-fabric-uri":"/api/storage-fabrics/24c1b2a8-9436-11e8-9c43-fa163e27d492"
      }
   ]
}