Amazon Glacier

2014/12/11 - Amazon Glacier - 2 new api methods

SetDataRetrievalPolicy (new) Link ¶

This operation sets and then enacts a data retrieval policy in the region specified in the PUT request. You can set one policy per region for an AWS account. The policy is enacted within a few minutes of a successful PUT operation.

The set policy operation does not affect retrieval jobs that were in progress before the policy was enacted. For more information about data retrieval policies, see Amazon Glacier Data Retrieval Policies.

Request Syntax

client.set_data_retrieval_policy(
    accountId='string',
    Policy={
        'Rules': [
            {
                'Strategy': 'string',
                'BytesPerHour': 123
            },
        ]
    }
)
type accountId

string

param accountId

[REQUIRED]

The AccountId is the AWS Account ID. You can specify either the AWS Account ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID associated with the credentials used to sign the request. If you specify your Account ID, do not include the dashes in it.

type Policy

dict

param Policy

The data retrieval policy in JSON format.

  • Rules (list) --

    The policy rule. Although this is a list type, currently there must be only one rule, which contains a Strategy field and optionally a BytesPerHour field.

    • (dict) --

      Data retrieval policy rule.

      • Strategy (string) --

        The type of data retrieval policy to set.

        Valid values: BytesPerHour|FreeTier|None

      • BytesPerHour (integer) --

        The maximum number of bytes that can be retrieved in an hour.

        This field is required only if the value of the Strategy field is BytesPerHour . Your PUT operation will be rejected if the Strategy field is not set to BytesPerHour and you set this field.

returns

None

GetDataRetrievalPolicy (new) Link ¶

This operation returns the current data retrieval policy for the account and region specified in the GET request. For more information about data retrieval policies, see Amazon Glacier Data Retrieval Policies.

Request Syntax

client.get_data_retrieval_policy(
    accountId='string'
)
type accountId

string

param accountId

[REQUIRED]

The AccountId is the AWS Account ID. You can specify either the AWS Account ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID associated with the credentials used to sign the request. If you specify your Account ID, do not include the dashes hyphens in it.

rtype

dict

returns

Response Syntax

{
    'Policy': {
        'Rules': [
            {
                'Strategy': 'string',
                'BytesPerHour': 123
            },
        ]
    }
}

Response Structure

  • (dict) --

    Contains the Amazon Glacier response to the GetDataRetrievalPolicy request.

    • Policy (dict) --

      Contains the returned data retrieval policy in JSON format.

      • Rules (list) --

        The policy rule. Although this is a list type, currently there must be only one rule, which contains a Strategy field and optionally a BytesPerHour field.

        • (dict) --

          Data retrieval policy rule.

          • Strategy (string) --

            The type of data retrieval policy to set.

            Valid values: BytesPerHour|FreeTier|None

          • BytesPerHour (integer) --

            The maximum number of bytes that can be retrieved in an hour.

            This field is required only if the value of the Strategy field is BytesPerHour . Your PUT operation will be rejected if the Strategy field is not set to BytesPerHour and you set this field.