Skip to content

Commit

Permalink
Merge branch 'release-1.7.41'
Browse files Browse the repository at this point in the history
* release-1.7.41:
  Bumping version to 1.7.41
  Update CHANGELOG
  Fix preview snippet for operation commands
  fix formatting errors
  glacier get-job-output example
  new SNS examples
  More examples
  New examples for Amazon Glacier
  • Loading branch information
AWS committed Jul 28, 2015
2 parents 1f4f889 + c28891f commit 664c78a
Show file tree
Hide file tree
Showing 31 changed files with 428 additions and 15 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
CHANGELOG
=========

1.7.41
======

* feature:``aws s3api``: Add support for more types of event notifications.
* feature:``aws s3api``: Add support for GET/HEAD storage class response
headers.
* feature:``aws logs``: Add destination API support.


1.7.40
======

Expand Down
2 changes: 1 addition & 1 deletion awscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""
import os

__version__ = '1.7.40'
__version__ = '1.7.41'

#
# Get our data path to be added to botocore's search path
Expand Down
5 changes: 4 additions & 1 deletion awscli/customizations/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ def update_description_with_preview(help_command, **kwargs):
# So for now we're just going to add the configure command
# to enable this.
style.doc.write("You can enable this service by running: ")
style.code("aws configure set preview.%s true" % help_command.name)
# The service name will always be the first element in the
# event class for the help object
service_name = help_command.event_class.split('.')[0]
style.code("aws configure set preview.%s true" % service_name)
style.end_note()


Expand Down
5 changes: 5 additions & 0 deletions awscli/examples/glacier/add-tags-to-vault.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The following command adds two tags to a vault named ``my-vault``::

aws glacier add-tags-to-vault --account-id - --vault-name my-vault --tags id=1234,date=july2015

Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
20 changes: 20 additions & 0 deletions awscli/examples/glacier/describe-job.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The following command retrieves information about an inventory retrieval job on a vault named ``my-vault``::

aws glacier describe-job --account-id - --vault-name my-vault --job-id zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW

Output::

{
"InventoryRetrievalParameters": {
"Format": "JSON"
},
"VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault",
"Completed": false,
"JobId": "zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW",
"Action": "InventoryRetrieval",
"CreationDate": "2015-07-17T20:23:41.616Z",
"StatusCode": "InProgress"
}

The job ID can be found in the output of ``aws glacier initiate-job`` and ``aws glacier list-jobs``.
Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
18 changes: 18 additions & 0 deletions awscli/examples/glacier/get-data-retrieval-policy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
The following command gets the data retrieval policy for the in-use account::

aws glacier get-data-retrieval-policy --account-id -

Output::

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

Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
17 changes: 17 additions & 0 deletions awscli/examples/glacier/get-job-output.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
The following command saves the output from a vault inventory job to a file in the current directory named ``output.json``::

aws glacier get-job-output --account-id - --vault-name my-vault --job-id zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW output.json

The ``job-id`` is available in the output of ``aws glacier list-jobs``. Note that the output file name is a positional argument that is not prefixed by an option name. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.

Output::

{
"status": 200,
"acceptRanges": "bytes",
"contentType": "application/json"
}

``output.json``::

{"VaultARN":"arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault","InventoryDate":"2015-04-07T00:26:18Z","ArchiveList":[{"ArchiveId":"kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw","ArchiveDescription":"multipart upload test","CreationDate":"2015-04-06T22:24:34Z","Size":3145728,"SHA256TreeHash":"9628195fcdbcbbe76cdde932d4646fa7de5f219fb39823836d81f0cc0e18aa67"}]}
17 changes: 17 additions & 0 deletions awscli/examples/glacier/get-vault-notifications.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
The following command gets a description of the notification configuration for a vault named ``my-vault``::

aws glacier get-vault-notifications --account-id - --vault-name my-vault

Output::

{
"vaultNotificationConfig": {
"Events": [
"InventoryRetrievalCompleted",
"ArchiveRetrievalCompleted"
],
"SNSTopic": "arn:aws:sns:us-west-2:0123456789012:my-vault"
}
}

If no notifications have been configured for the vault, an error is returned. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
38 changes: 38 additions & 0 deletions awscli/examples/glacier/initiate-job.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
The following command initiates a job to get an inventory of the vault ``my-vault``::

aws glacier initiate-job --account-id - --vault-name my-vault --job-parameters '{"Type": "inventory-retrieval"}'

Output::

{
"location": "/0123456789012/vaults/my-vault/jobs/zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW",
"jobId": "zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW"
}

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 initiates a job to retrieve an archive from the vault ``my-vault``::

aws glacier initiate-job --account-id - --vault-name my-vault --job-parameters file://job-archive-retrieval.json

``job-archive-retrieval.json`` is a JSON file in the local folder that specifies the type of job, archive ID, and some optional parameters::

{
"Type": "archive-retrieval",
"ArchiveId": "kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw",
"Description": "Retrieve archive on 2015-07-17",
"SNSTopic": "arn:aws:sns:us-west-2:0123456789012:my-topic"
}

Archive IDs are available in the output of ``aws glacier upload-archive`` and ``aws glacier get-job-output``.

Output::

{
"location": "/011685312445/vaults/mwunderl/jobs/l7IL5-EkXyEY9Ws95fClzIbk2O5uLYaFdAYOi-azsX_Z8V6NH4yERHzars8wTKYQMX6nBDI9cMNHzyZJO59-8N9aHWav",
"jobId": "l7IL5-EkXy2O5uLYaFdAYOiEY9Ws95fClzIbk-azsX_Z8V6NH4yERHzars8wTKYQMX6nBDI9cMNHzyZJO59-8N9aHWav"
}

See `Initiate Job`_ in the *Amazon Glacier API Reference* for details on the job parameters format.

.. _`Initiate Job`: http://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html
38 changes: 38 additions & 0 deletions awscli/examples/glacier/list-jobs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
The following command lists in-progress and recently completed jobs for a vault named ``my-vault``::

aws glacier list-jobs --account-id - --vault-name my-vault

Output::

{
"JobList": [
{
"VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault",
"RetrievalByteRange": "0-3145727",
"SNSTopic": "arn:aws:sns:us-west-2:0123456789012:my-vault",
"Completed": false,
"SHA256TreeHash": "9628195fcdbcbbe76cdde932d4646fa7de5f219fb39823836d81f0cc0e18aa67",
"JobId": "l7IL5-EkXyEY9Ws95fClzIbk2O5uLYaFdAYOi-azsX_Z8V6NH4yERHzars8wTKYQMX6nBDI9cMNHzyZJO59-8N9aHWav",
"ArchiveId": "kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw",
"JobDescription": "Retrieve archive on 2015-07-17",
"ArchiveSizeInBytes": 3145728,
"Action": "ArchiveRetrieval",
"ArchiveSHA256TreeHash": "9628195fcdbcbbe76cdde932d4646fa7de5f219fb39823836d81f0cc0e18aa67",
"CreationDate": "2015-07-17T21:16:13.840Z",
"StatusCode": "InProgress"
},
{
"InventoryRetrievalParameters": {
"Format": "JSON"
},
"VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault",
"Completed": false,
"JobId": "zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW",
"Action": "InventoryRetrieval",
"CreationDate": "2015-07-17T20:23:41.616Z",
"StatusCode": ""InProgress""
}
]
}

Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
28 changes: 28 additions & 0 deletions awscli/examples/glacier/list-parts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
The following command lists the uploaded parts for a multipart upload to a vault named ``my-vault``::

aws glacier list-parts --account-id - --vault-name my-vault --upload-id "SYZi7qnL-YGqGwAm8Kn3BLP2ElNCvnB-5961R09CSaPmPwkYGHOqeN_nX3-Vhnd2yF0KfB5FkmbnBU9GubbdrCs8ut-D"

Output::

{
"MultipartUploadId": "SYZi7qnL-YGqGwAm8Kn3BLP2ElNCvnB-5961R09CSaPmPwkYGHOqeN_nX3-Vhnd2yF0KfB5FkmbnBU9GubbdrCs8ut-D",
"Parts": [
{
"RangeInBytes": "0-1048575",
"SHA256TreeHash": "e1f2a7cd6e047350f69b9f8cfa60fa606fe2f02802097a9a026360a7edc1f553"
},
{
"RangeInBytes": "1048576-2097151",
"SHA256TreeHash": "43cf3061fb95796aed99a11a6aa3cd8f839eed15e655ab0a597126210636aee6"
}
],
"VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault",
"CreationDate": "2015-07-18T00:05:23.830Z",
"PartSizeInBytes": 1048576
}

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

For more information on multipart uploads to Amazon Glacier using the AWS CLI, see `Using Amazon Glacier`_ in the *AWS CLI User Guide*.

.. _`Using Amazon Glacier`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-glacier.html
14 changes: 14 additions & 0 deletions awscli/examples/glacier/list-tags-for-vault.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The following command lists the tags applied to a vault named ``my-vault``::

aws glacier list-tags-for-vault --account-id - --vault-name my-vault

Output::

{
"Tags": {
"date": "july2015",
"id": "1234"
}
}

Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
20 changes: 20 additions & 0 deletions awscli/examples/glacier/list-vaults.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The following command lists the vaults in the default account and region::

aws glacier list-vaults --account-id -

Output::

{
"VaultList": [
{
"SizeInBytes": 3178496,
"VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault",
"LastInventoryDate": "2015-04-07T00:26:19.028Z",
"VaultName": "my-vault",
"NumberOfArchives": 1,
"CreationDate": "2015-04-06T21:23:45.708Z"
}
]
}

Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
5 changes: 5 additions & 0 deletions awscli/examples/glacier/remove-tags-from-vault.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The following command removes a tag with the key ``date`` from a vault named ``my-vault``::

aws glacier remove-tags-from-vault --account-id - --vault-name my-vault --tag-keys date

Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
24 changes: 24 additions & 0 deletions awscli/examples/glacier/set-data-retrieval-policy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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.

.. _`Set Data Retrieval Policy`: http://docs.aws.amazon.com/amazonglacier/latest/dev/api-SetDataRetrievalPolicy.html
12 changes: 12 additions & 0 deletions awscli/examples/glacier/set-vault-notifications.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The following command configures SNS notifications for a vault named ``my-vault``::

aws glacier set-vault-notifications --account-id - --vault-name my-vault --vault-notification-config file://notificationconfig.json

``notificationconfig.json`` is a JSON file in the current folder that specifies an SNS topic and the events to publish::

{
"SNSTopic": "arn:aws:sns:us-west-2:0123456789012:my-vault",
"Events": ["ArchiveRetrievalCompleted", "InventoryRetrievalCompleted"]
}

Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
13 changes: 13 additions & 0 deletions awscli/examples/glacier/upload-archive.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
The following command uploads an archive in the current folder named ``archive.zip`` to a vault named ``my-vault``::

aws glacier upload-archive --account-id - --vault-name my-vault --body archive.zip

Output::

{
"archiveId": "kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw",
"checksum": "969fb39823836d81f0cc028195fcdbcbbe76cdde932d4646fa7de5f21e18aa67",
"location": "/0123456789012/vaults/my-vault/archives/kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw"
}

Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
11 changes: 11 additions & 0 deletions awscli/examples/sns/confirm-subscription.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The following command confirms a subscription to an SNS topic named ``my-topic``::

aws sns confirm-subscription --topic-arn arn:aws:sns:us-west-2:0123456789012:my-topic --token 2336412f37fb687f5d51e6e241d7700ae02f7124d8268910b858cb4db727ceeb2474bb937929d3bdd7ce5d0cce19325d036bc858d3c217426bcafa9c501a2cace93b83f1dd3797627467553dc438a8c974119496fc3eff026eaa5d14472ded6f9a5c43aec62d83ef5f49109da7176391

The token is included in the confirmation message sent to the notification endpoint specified in the subscribe call.

Output::

{
"SubscriptionArn": "arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f"
}
10 changes: 4 additions & 6 deletions awscli/examples/sns/create-topic.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
**To create an SNS Topic**
The following command creates an SNS topic named ``my-topic``::

The following ``create-topic`` command creates an SNS topic::
aws sns create-topic --name my-topic

aws sns create-topic --name MyTopic

The topic ARN is returned::
Output::

{
"ResponseMetadata": {
"RequestId": "1469e8d7-1642-564e-b85d-a19b4b341f83"
},
"TopicArn": "arn:aws:sns:us-east-1:123456789012:MyTopic"
"TopicArn": "arn:aws:sns:us-west-2:0123456789012:my-topic"
}

For more information, see `Using the AWS Command Line Interface with Amazon SQS and Amazon SNS`_ in the *AWS Command Line Interface User Guide*.
Expand Down
3 changes: 3 additions & 0 deletions awscli/examples/sns/delete-topic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The following command deletes an SNS topic named ``my-topic``::

aws sns delete-topic --topic-arn "arn:aws:sns:us-west-2:0123456789012:my-topic"
19 changes: 19 additions & 0 deletions awscli/examples/sns/get-subscription-attributes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The following command gets the attributes of a subscription to a topic named ``my-topic``::

aws sns get-subscription-attributes --subscription-arn "arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f"

The ``subscription-arn`` is available in the output of ``aws sns list-subscriptions``.

Output::

{
"Attributes": {
"Endpoint": "[email protected]",
"Protocol": "email",
"RawMessageDelivery": "false",
"ConfirmationWasAuthenticated": "false",
"Owner": "0123456789012",
"SubscriptionArn": "arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f",
"TopicArn": "arn:aws:sns:us-west-2:0123456789012:my-topic"
}
}
Loading

0 comments on commit 664c78a

Please sign in to comment.