Skip to content

describe_tapes async

describe_tapes(
    gateway_arn: GatewayARN,
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
    tape_ar_ns: Optional[TapeARNs] = None,
    marker: Optional[Marker] = None,
    limit: Optional[PositiveIntObject] = None,
) -> DescribeTapesOutput

Returns a description of virtual tapes that correspond to the specified Amazon Resource Names (ARNs). If TapeARN is not specified, returns a description of the virtual tapes associated with the specified gateway. This operation is only supported for the tape gateway type.

The operation supports pagination. By default, the operation returns a maximum of up to 100 tapes. You can optionally specify the Limit field 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 field. You can use this Marker value in your subsequent request to retrieve the next set of tapes.

Parameters:

  • tape_ar_ns (Optional[TapeARNs], default: None ) –

    Specifies one or more unique Amazon Resource Names (ARNs) that represent the virtual tapes you want to describe. If this parameter is not specified, Tape gateway returns a description of all virtual tapes associated with the specified gateway.

  • marker (Optional[Marker], default: None ) –

    A marker value, obtained in a previous call to DescribeTapes. This marker indicates which page of results to retrieve.

    If not specified, the first page of results is retrieved.

  • limit (Optional[PositiveIntObject], default: None ) –

    Specifies that the number of virtual tapes described be limited to the specified number.

    Amazon Web Services may impose its own limit, if this field is not set.

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.

Examples:

To describe virtual tape(s) associated with gateway Returns a description of the specified Amazon Resource Name (ARN) of virtual tapes. If a TapeARN is not specified, returns a description of all virtual tapes.

>>> await client.describe_tapes(gateway_arn='arn:aws:storagegateway:us-east-1:999999999999:gateway/sgw-12A3456B', tape_ar_ns=['arn:aws:storagegateway:us-east-1:999999999999:tape/TEST04A2A1', 'arn:aws:storagegateway:us-east-1:999999999999:tape/TEST05A2A0'], marker='1', limit=2)
Source code in docs_src/capo_storage_gateway/_services/async_storage_gateway.py
async def describe_tapes(
    self,
    gateway_arn: "capo_storage_gateway.types.gateway_arn.GatewayARN",
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = 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.describe_tapes_output.DescribeTapesOutput":
    """<p>Returns a description of virtual tapes that correspond to the specified Amazon Resource Names (ARNs). If <code>TapeARN</code> is not specified, returns a description of the virtual tapes associated with the specified gateway. This operation is only supported for the tape gateway type.</p> <p>The operation supports pagination. By default, the operation returns a maximum of up to 100 tapes. You can optionally specify the <code>Limit</code> field 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> field. You can use this <code>Marker</code> value in your subsequent request to retrieve the next set of tapes.</p>

    Args:
        tape_ar_ns: <p>Specifies one or more unique Amazon Resource Names (ARNs) that represent the virtual tapes you want to describe. If this parameter is not specified, Tape gateway returns a description of all virtual tapes associated with the specified gateway.</p>
        marker: <p>A marker value, obtained in a previous call to <code>DescribeTapes</code>. This marker indicates which page of results to retrieve.</p> <p>If not specified, the first page of results is retrieved.</p>
        limit: <p>Specifies that the number of virtual tapes described be limited to the specified number.</p> <note> <p>Amazon Web Services may impose its own limit, if this field is not set.</p> </note>

    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.

    Examples:
        To describe virtual tape(s) associated with gateway
        Returns a description of the specified Amazon Resource Name (ARN) of virtual tapes. If a TapeARN is not specified, returns a description of all virtual tapes.

        >>> await client.describe_tapes(gateway_arn='arn:aws:storagegateway:us-east-1:999999999999:gateway/sgw-12A3456B', tape_ar_ns=['arn:aws:storagegateway:us-east-1:999999999999:tape/TEST04A2A1', 'arn:aws:storagegateway:us-east-1:999999999999:tape/TEST05A2A0'], marker='1', limit=2)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_storage_gateway.types.describe_tapes_input.DescribeTapesInput]",
    ) -> AsyncOperationResponse[
        "capo_storage_gateway.types.describe_tapes_output.DescribeTapesOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.describe_tapes

        (
            output,
            http_response,
        ) = await capo_storage_gateway._operations.storage_gateway_20130630.describe_tapes.async_describe_tapes(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeTapes")
    )
    input_: capo_storage_gateway.types.describe_tapes_input.DescribeTapesInput = {
        "gateway_arn": gateway_arn
    }
    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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output