Skip to content

assign_tape_pool

assign_tape_pool(
    tape_arn: TapeARN,
    pool_id: PoolId,
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    bypass_governance_retention: Optional[Boolean2] = None,
) -> AssignTapePoolOutput

Assigns a tape to a tape pool for archiving. The tape assigned to a pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the S3 storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.

Parameters:

  • tape_arn (TapeARN) –

    The unique Amazon Resource Name (ARN) of the virtual tape that you want to add to the tape pool.

  • pool_id (PoolId) –

    The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the 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.

  • bypass_governance_retention (Optional[Boolean2], default: None ) –

    Set permissions to bypass governance retention. If the lock type of the archived tape is Governance, the tape's archived age is not older than RetentionLockInDays, and the user does not already have BypassGovernanceRetention, setting this to TRUE enables the user to bypass the retention lock. This parameter is set to true by default for calls from the console.

    Valid values: TRUE | FALSE

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 assign_tape_pool(
    self,
    tape_arn: "capo_storage_gateway.types.tape_arn.TapeARN",
    pool_id: "capo_storage_gateway.types.pool_id.PoolId",
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    bypass_governance_retention: Optional[
        "capo_storage_gateway.types.boolean2.Boolean2"
    ] = None,
) -> "capo_storage_gateway.types.assign_tape_pool_output.AssignTapePoolOutput":
    """<p>Assigns a tape to a tape pool for archiving. The tape assigned to a pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the S3 storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>

    Args:
        tape_arn: <p>The unique Amazon Resource Name (ARN) of the virtual tape that you want to add to the tape pool.</p>
        pool_id: <p>The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the 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>
        bypass_governance_retention: <p>Set permissions to bypass governance retention. If the lock type of the archived tape is <code>Governance</code>, the tape's archived age is not older than <code>RetentionLockInDays</code>, and the user does not already have <code>BypassGovernanceRetention</code>, setting this to TRUE enables the user to bypass the retention lock. This parameter is set to true by default for calls from the console.</p> <p>Valid values: <code>TRUE</code> | <code>FALSE</code> </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.assign_tape_pool_input.AssignTapePoolInput]",
    ) -> OperationResponse[
        "capo_storage_gateway.types.assign_tape_pool_output.AssignTapePoolOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.assign_tape_pool

        output, http_response = (
            capo_storage_gateway._operations.storage_gateway_20130630.assign_tape_pool.assign_tape_pool(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssignTapePool")
    )
    input_: capo_storage_gateway.types.assign_tape_pool_input.AssignTapePoolInput = {
        "tape_arn": tape_arn,
        "pool_id": pool_id,
    }
    if bypass_governance_retention is not None:
        input_["bypass_governance_retention"] = bypass_governance_retention

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output