Skip to content

purchase_provisioned_capacity

purchase_provisioned_capacity(
    account_id: string, *, config_overrides: Optional[GlacierClientConfig] = None
) -> PurchaseProvisionedCapacityOutput

This operation purchases a provisioned capacity unit for an AWS account.

Parameters:

  • account_id (string) –

    The AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, don't include any hyphens ('-') in the ID.

Raises:

Examples:

To purchases a provisioned capacity unit for an AWS account The example purchases provisioned capacity unit for an AWS account.

>>> client.purchase_provisioned_capacity(account_id='-')
Source code in docs_src/capo_glacier/_services/glacier.py
def purchase_provisioned_capacity(
    self,
    account_id: "capo_glacier.types.string.string",
    *,
    config_overrides: Optional[GlacierClientConfig] = None,
) -> "capo_glacier.types.purchase_provisioned_capacity_output.PurchaseProvisionedCapacityOutput":
    """<p>This operation purchases a provisioned capacity unit for an AWS account. </p>

    Args:
        account_id: <p>The AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, don't include any hyphens ('-') in the ID. </p>

    Raises:
        capo_glacier.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Returned if a parameter of the request is incorrectly specified.</p>
        capo_glacier.errors.limit_exceeded_exception.LimitExceededException: <p>Returned if the request results in a vault or account limit being exceeded.</p>
        capo_glacier.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Returned if a required header or parameter is missing from the request.</p>
        capo_glacier.errors.no_longer_supported_exception.NoLongerSupportedException: <p>Returned if the request was made by a customer with no Amazon Glacier storage. The request is denied as the API is no longer supported for new customers. Please use Amazon S3 Glacier storage classes instead.</p>
        capo_glacier.errors.service_unavailable_exception.ServiceUnavailableException: <p>Returned if the service cannot complete the request.</p>
        capo_glacier.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To purchases a provisioned capacity unit for an AWS account
        The example purchases provisioned capacity unit for an AWS account.

        >>> client.purchase_provisioned_capacity(account_id='-')
    """

    def _handler(
        req: "OperationRequest[capo_glacier.types.purchase_provisioned_capacity_input.PurchaseProvisionedCapacityInput]",
    ) -> OperationResponse[
        "capo_glacier.types.purchase_provisioned_capacity_output.PurchaseProvisionedCapacityOutput"
    ]:
        import capo_glacier._operations.glacier.purchase_provisioned_capacity

        output, http_response = (
            capo_glacier._operations.glacier.purchase_provisioned_capacity.purchase_provisioned_capacity(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PurchaseProvisionedCapacity")
    )
    input_: capo_glacier.types.purchase_provisioned_capacity_input.PurchaseProvisionedCapacityInput = {
        "account_id": account_id
    }

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