Skip to content

create_tape_pool async

create_tape_pool(
    pool_name: PoolName,
    storage_class: TapeStorageClass,
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
    retention_lock_type: Optional[RetentionLockType] = None,
    retention_lock_time_in_days: Optional[RetentionLockTimeInDays] = None,
    tags: Optional[Tags] = None,
) -> CreateTapePoolOutput

Creates a new custom tape pool. You can use custom tape pool to enable tape retention lock on tapes that are archived in the custom pool.

Parameters:

  • pool_name (PoolName) –

    The name of the new custom tape pool.

  • storage_class (TapeStorageClass) –

    The storage class that is associated with the new custom pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.

  • retention_lock_type (Optional[RetentionLockType], default: None ) –

    Tape retention lock can be configured in two modes. When configured in governance mode, Amazon Web Services accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root Amazon Web Services account.

  • retention_lock_time_in_days (Optional[RetentionLockTimeInDays], default: None ) –

    Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days).

  • tags (Optional[Tags], default: None ) –

    A list of up to 50 tags that can be assigned to tape pool. Each tag is a key-value pair.

    Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.

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/async_storage_gateway.py
async def create_tape_pool(
    self,
    pool_name: "capo_storage_gateway.types.pool_name.PoolName",
    storage_class: "capo_storage_gateway.types.tape_storage_class.TapeStorageClass",
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
    retention_lock_type: Optional[
        "capo_storage_gateway.types.retention_lock_type.RetentionLockType"
    ] = None,
    retention_lock_time_in_days: Optional[
        "capo_storage_gateway.types.retention_lock_time_in_days.RetentionLockTimeInDays"
    ] = None,
    tags: Optional["capo_storage_gateway.types.tags.Tags"] = None,
) -> "capo_storage_gateway.types.create_tape_pool_output.CreateTapePoolOutput":
    """<p>Creates a new custom tape pool. You can use custom tape pool to enable tape retention lock on tapes that are archived in the custom pool.</p>

    Args:
        pool_name: <p>The name of the new custom tape pool.</p>
        storage_class: <p>The storage class that is associated with the new custom pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>
        retention_lock_type: <p>Tape retention lock can be configured in two modes. When configured in governance mode, Amazon Web Services accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root Amazon Web Services account.</p>
        retention_lock_time_in_days: <p>Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days).</p>
        tags: <p>A list of up to 50 tags that can be assigned to tape pool. Each tag is a key-value pair.</p> <note> <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_storage_gateway.types.create_tape_pool_input.CreateTapePoolInput]",
    ) -> AsyncOperationResponse[
        "capo_storage_gateway.types.create_tape_pool_output.CreateTapePoolOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.create_tape_pool

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTapePool")
    )
    input_: capo_storage_gateway.types.create_tape_pool_input.CreateTapePoolInput = {
        "pool_name": pool_name,
        "storage_class": storage_class,
    }
    if retention_lock_type is not None:
        input_["retention_lock_type"] = retention_lock_type
    if retention_lock_time_in_days is not None:
        input_["retention_lock_time_in_days"] = retention_lock_time_in_days
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output