[ aws . glacier ]

set-data-retrieval-policy

Description

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 .

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

Synopsis

  set-data-retrieval-policy
--account-id <value>
[--policy <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--cli-auto-prompt <value>]

Options

--account-id (string)

The AccountId value is the AWS account ID. This value must match the AWS account ID associated with the credentials used to sign the request. 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 specify your account ID, do not include any hyphens (‘-‘) in the ID.

--policy (structure)

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.

(structure)

Data retrieval policy rule.

Strategy -> (string)

The type of data retrieval policy to set.

Valid values: BytesPerHour|FreeTier|None

BytesPerHour -> (long)

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.

Shorthand Syntax:

Rules=[{Strategy=string,BytesPerHour=long},{Strategy=string,BytesPerHour=long}]

JSON Syntax:

{
  "Rules": [
    {
      "Strategy": "string",
      "BytesPerHour": long
    }
    ...
  ]
}

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

--cli-auto-prompt (boolean) Automatically prompt for CLI input parameters.

See ‘aws help’ for descriptions of global parameters.

Examples

The following command configures a data retrieval policy for the in-use account:

aws glacier set-data-retrieval-policy --account-id - --policy file://data-retrieval-policy.json

data-retrieval-policy.json is a JSON file in the current folder that specifies a data retrieval policy:

{
  "Rules":[
     {
         "Strategy":"BytesPerHour",
         "BytesPerHour":10737418240
      }
   ]
}

Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.

The following command sets the data retrieval policy to FreeTier using inline JSON:

aws glacier set-data-retrieval-policy --account-id - --policy '{"Rules":[{"Strategy":"FreeTier"}]}'

See Set Data Retrieval Policy in the Amazon Glacier API Reference for details on the policy format.

Output

None