List Tape Libraries

The List Tape Libraries operation lists the tape libraries known to the target Console.

HTTP method and URI

GET /api/tape-libraries

Query parameters:

Name Type Rqd/Opt Description
cpc-uri String/ URI Optional Filter string to limit returned objects to those that have a matching cpc-uri property.
name String Optional Filter pattern (regular expression) to limit returned objects to those that have a matching name property.
state String Enum Optional Filter string to limit the returned objects to those that have a matching state property.

Value must be a valid tape library state property value.

Response body contents

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

Field name Type Description
tape-libraries Array of tape-library-info objects Array of tape-library-info objects, described in the next table. The returned array may be empty.

Each nested tape-library-info object contains the following fields:

Field name Type Description
object-uri String/ URI Canonical URI path (object-uri) of the Tape Library object.
name String The name property of the Tape Library object.
cpc-uri String/ URI The cpc-uri property of the Tape Library object.
state String Enum The state property of the Tape Library object.

Description

This operation lists the tape libraries that are known to the target Console. The object URI, name, state and the URI of its associated CPC are provided for each.

If the name query parameter is specified, the returned list is limited to those tape libraries that have a name property matching the specified filter pattern. If the name parameter is omitted, this filtering is not done.

If the state query parameter is specified, the parameter is validated to ensure it is a valid value for the tape library state property according to the data model. If the value is not valid, a 400 (Bad Request) is returned. If the value is valid, the returned list is limited to those tape libraries that have a state property matching the specified value. If the state parameter is omitted, this filtering is not done.

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

A tape library is included in the list only if the API user has object-access permission for that object. If the API user does not have permission to a tape library, that object is simply omitted from the list but no error status code results.

If no tape libraries are to be included in the results due to filtering or lack of object-access permission, an empty list is provided and the operation completes successfully.

Authorization requirements

This operation has the following authorization requirement:
  • Object-access permission to each Tape Library object to be included in the result.

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 Tape Libraries: 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.

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

Example HTTP interaction

Figure 1. List Tape Libraries: Request
GET /api/tape-libraries HTTP/1.1
x-api-session: 58zctc8jvhdh9hd8dji9wvuoh80t0l2rdk4bvrp95rmht2o8tq
Figure 2. List Tape Libraries: Response
200 OK
server: Hardware management console API web server / 2.0
cache-control: no-cache
date: Wed, 20 Jan 2021 16:04:00 GMT
content-type: application/json;charset=UTF-8
content-length: 207
{
   "tape-libraries":[
      {
         "cpc-uri":"/api/cpcs/406a206e-e4ae-3277-bcc2-30c136208dd9",
         "name":"3573-TL 00L2U78Z8185_LL0",
         "object-uri":"/api/tape-libraries/031e2350-5b37-11eb-b81d-fa163e11e9ec",
         "state":"available"
      }
   ]
}