Lists virtual tapes in your virtual tape library (VTL) and your virtual tape shelf (VTS). You specify the tapes to list by specifying one or more tape Amazon Resource Names (ARNs). If you don't specify a tape ARN, the operation lists all virtual tapes in both your VTL and VTS.
This operation supports pagination. By default, the operation returns a maximum of up to 100 tapes. You can optionally specify the Limit parameter in the body to limit the number of tapes in the response. If the number of tapes returned in the response is truncated, the response includes a Marker element that you can use in your subsequent request to retrieve the next set of tapes. This operation is only supported in the tape gateway type.
Parameters:
-
marker
(Optional[Marker], default:
None
)
–
A string that indicates the position at which to begin the returned list of tapes.
-
limit
(Optional[PositiveIntObject], default:
None
)
–
An optional number limit for the tapes in the list returned by this call.
Raises:
-
InternalServerError
–
An internal server error has occurred during the request. For more information, see the error and message fields.
-
InvalidGatewayRequestException
–
An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_storage_gateway/_services/storage_gateway.py
| def list_tapes(
self,
*,
config_overrides: Optional[StorageGatewayClientConfig] = None,
tape_ar_ns: Optional["capo_storage_gateway.types.tape_ar_ns.TapeARNs"] = None,
marker: Optional["capo_storage_gateway.types.marker.Marker"] = None,
limit: Optional[
"capo_storage_gateway.types.positive_int_object.PositiveIntObject"
] = None,
) -> "capo_storage_gateway.types.list_tapes_output.ListTapesOutput":
"""<p>Lists virtual tapes in your virtual tape library (VTL) and your virtual tape shelf (VTS). You specify the tapes to list by specifying one or more tape Amazon Resource Names (ARNs). If you don't specify a tape ARN, the operation lists all virtual tapes in both your VTL and VTS.</p> <p>This operation supports pagination. By default, the operation returns a maximum of up to 100 tapes. You can optionally specify the <code>Limit</code> parameter in the body to limit the number of tapes in the response. If the number of tapes returned in the response is truncated, the response includes a <code>Marker</code> element that you can use in your subsequent request to retrieve the next set of tapes. This operation is only supported in the tape gateway type.</p>
Args:
marker: <p>A string that indicates the position at which to begin the returned list of tapes.</p>
limit: <p>An optional number limit for the tapes in the list returned by this call.</p>
Raises:
capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_storage_gateway.types.list_tapes_input.ListTapesInput]",
) -> OperationResponse[
"capo_storage_gateway.types.list_tapes_output.ListTapesOutput"
]:
import capo_storage_gateway._operations.storage_gateway_20130630.list_tapes
output, http_response = (
capo_storage_gateway._operations.storage_gateway_20130630.list_tapes.list_tapes(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListTapes")
)
input_: capo_storage_gateway.types.list_tapes_input.ListTapesInput = {}
if tape_ar_ns is not None:
input_["tape_ar_ns"] = tape_ar_ns
if marker is not None:
input_["marker"] = marker
if limit is not None:
input_["limit"] = limit
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|