Skip to content

Commit

Permalink
Merge branch 'release-1.17.10'
Browse files Browse the repository at this point in the history
* release-1.17.10:
  Bumping version to 1.17.10
  Update changelog based on model updates
  Added new CLI examples for WAFv2 and DynamoDB
  New CLI examples for EC2 and Service Quotas
  Run tests not in verbose mode
  New CLI exampeles for EC2 and ECR
  Soft-deprecate `aws ecr get-login`
  adds `aws ecr get-login-password` customization
  • Loading branch information
aws-sdk-python-automation committed Feb 4, 2020
2 parents b8b1b36 + 1eab815 commit bce871b
Show file tree
Hide file tree
Showing 99 changed files with 2,738 additions and 581 deletions.
37 changes: 37 additions & 0 deletions .changes/1.17.10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"category": "``workmail``",
"description": "Update workmail command to latest version",
"type": "api-change"
},
{
"category": "``ssm``",
"description": "Update ssm command to latest version",
"type": "api-change"
},
{
"category": "``kafka``",
"description": "Update kafka command to latest version",
"type": "api-change"
},
{
"category": "``ec2``",
"description": "Update ec2 command to latest version",
"type": "api-change"
},
{
"category": "``storagegateway``",
"description": "Update storagegateway command to latest version",
"type": "api-change"
},
{
"category": "``cloudfront``",
"description": "Update cloudfront command to latest version",
"type": "api-change"
},
{
"category": "``iot``",
"description": "Update iot command to latest version",
"type": "api-change"
}
]
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
CHANGELOG
=========

1.17.10
=======

* api-change:``workmail``: Update workmail command to latest version
* api-change:``ssm``: Update ssm command to latest version
* api-change:``kafka``: Update kafka command to latest version
* api-change:``ec2``: Update ec2 command to latest version
* api-change:``storagegateway``: Update storagegateway command to latest version
* api-change:``cloudfront``: Update cloudfront command to latest version
* api-change:``iot``: Update iot command to latest version


1.17.9
======

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.17.9'
__version__ = '1.17.10'

#
# Get our data path to be added to botocore's search path
Expand Down
32 changes: 27 additions & 5 deletions awscli/customizations/ecr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@


def register_ecr_commands(cli):
cli.register('building-command-table.ecr', _inject_get_login)
cli.register('building-command-table.ecr', _inject_commands)


def _inject_get_login(command_table, session, **kwargs):
def _inject_commands(command_table, session, **kwargs):
command_table['get-login'] = ECRLogin(session)
command_table['get-login-password'] = ECRGetLoginPassword(session)


class ECRLogin(BasicCommand):
"""Log in with docker login"""
"""Log in with 'docker login'"""
NAME = 'get-login'

DESCRIPTION = BasicCommand.FROM_FILE('ecr/get-login_description.rst')
Expand All @@ -49,8 +50,8 @@ class ECRLogin(BasicCommand):
'help_text': (
"Specify if the '-e' flag should be included in the "
"'docker login' command. The '-e' option has been deprecated "
"and is removed in docker version 17.06 and later. You must "
"specify --no-include-email if you're using docker version "
"and is removed in Docker version 17.06 and later. You must "
"specify --no-include-email if you're using Docker version "
"17.06 or later. The default behavior is to include the "
"'-e' flag in the 'docker login' output."),
},
Expand Down Expand Up @@ -83,3 +84,24 @@ def _run_main(self, parsed_args, parsed_globals):
sys.stdout.write(' '.join(command))
sys.stdout.write('\n')
return 0


class ECRGetLoginPassword(BasicCommand):
"""Get a password to be used with container clients such as Docker"""
NAME = 'get-login-password'

DESCRIPTION = BasicCommand.FROM_FILE(
'ecr/get-login-password_description.rst')

def _run_main(self, parsed_args, parsed_globals):
ecr_client = create_client_from_parsed_globals(
self._session,
'ecr',
parsed_globals)
result = ecr_client.get_authorization_token()
auth = result['authorizationData'][0]
auth_token = b64decode(auth['authorizationToken']).decode()
_, password = auth_token.split(':')
sys.stdout.write(password)
sys.stdout.write('\n')
return 0
93 changes: 47 additions & 46 deletions awscli/examples/dynamodb/batch-get-item.rst
Original file line number Diff line number Diff line change
@@ -1,54 +1,55 @@
**To retrieve multiple items from a table**

This example reads multiple items from the *MusicCollection* table using a batch of three GetItem requests. Only the *AlbumTitle* attribute is returned.
The following ``batch-get-items`` example reads multiple items from the ``MusicCollection`` table using a batch of three ``GetItem`` requests. The command returns only the ``AlbumTitle`` attribute. ::

Command::
aws dynamodb batch-get-item \
--request-items file://request-items.json

aws dynamodb batch-get-item --request-items file://request-items.json
Contents of ``request-items.json``::

The arguments for ``--request-items`` are stored in a JSON file, ``request-items.json``. Here are the contents of that file::

{
"MusicCollection": {
"Keys": [
{
"Artist": {"S": "No One You Know"},
"SongTitle": {"S": "Call Me Today"}
},
{
"Artist": {"S": "Acme Band"},
"SongTitle": {"S": "Happy Day"}
},
{
"Artist": {"S": "No One You Know"},
"SongTitle": {"S": "Scared of My Shadow"}
}
],
"ProjectionExpression":"AlbumTitle"
}
}
{
"MusicCollection": {
"Keys": [
{
"Artist": {"S": "No One You Know"},
"SongTitle": {"S": "Call Me Today"}
},
{
"Artist": {"S": "Acme Band"},
"SongTitle": {"S": "Happy Day"}
},
{
"Artist": {"S": "No One You Know"},
"SongTitle": {"S": "Scared of My Shadow"}
}
],
"ProjectionExpression":"AlbumTitle"
}
}

Output::

{
"UnprocessedKeys": {},
"Responses": {
"MusicCollection": [
{
"AlbumTitle": {
"S": "Somewhat Famous"
}
},
{
"AlbumTitle": {
"S": "Blue Sky Blues"
}
},
{
"AlbumTitle": {
"S": "Louder Than Ever"
}
}
]
}
}
{
"UnprocessedKeys": {},
"Responses": {
"MusicCollection": [
{
"AlbumTitle": {
"S": "Somewhat Famous"
}
},
{
"AlbumTitle": {
"S": "Blue Sky Blues"
}
},
{
"AlbumTitle": {
"S": "Louder Than Ever"
}
}
]
}
}

For more information, see `Batch Operations <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#WorkingWithItems.BatchOperations>`__ in the *Amazon DynamoDB Developer Guide*.
79 changes: 40 additions & 39 deletions awscli/examples/dynamodb/batch-write-item.rst
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
**To add multiple items to a table**

This example adds three new items to the *MusicCollection* table using a batch of three PutItem requests.
The following ``batch-write-item`` example adds three new items to the ``MusicCollection`` table using a batch of three ``PutItem`` requests. ::

Command::
aws dynamodb batch-write-item \
--request-items file://request-items.json

aws dynamodb batch-write-item --request-items file://request-items.json
Contents of ``request-items.json``::

The arguments for ``--request-items`` are stored in a JSON file, ``request-items.json``. Here are the contents of that file::

{
"MusicCollection": [
{
"PutRequest": {
"Item": {
"Artist": {"S": "No One You Know"},
"SongTitle": {"S": "Call Me Today"},
"AlbumTitle": {"S": "Somewhat Famous"}
}
}
},
{
"PutRequest": {
"Item": {
"Artist": {"S": "Acme Band"},
"SongTitle": {"S": "Happy Day"},
"AlbumTitle": {"S": "Songs About Life"}
}
}
},
{
"PutRequest": {
"Item": {
"Artist": {"S": "No One You Know"},
"SongTitle": {"S": "Scared of My Shadow"},
"AlbumTitle": {"S": "Blue Sky Blues"}
}
}
}
]
}
{
"MusicCollection": [
{
"PutRequest": {
"Item": {
"Artist": {"S": "No One You Know"},
"SongTitle": {"S": "Call Me Today"},
"AlbumTitle": {"S": "Somewhat Famous"}
}
}
},
{
"PutRequest": {
"Item": {
"Artist": {"S": "Acme Band"},
"SongTitle": {"S": "Happy Day"},
"AlbumTitle": {"S": "Songs About Life"}
}
}
},
{
"PutRequest": {
"Item": {
"Artist": {"S": "No One You Know"},
"SongTitle": {"S": "Scared of My Shadow"},
"AlbumTitle": {"S": "Blue Sky Blues"}
}
}
}
]
}

Output::

{
"UnprocessedItems": {}
}
{
"UnprocessedItems": {}
}
For more information, see `Batch Operations <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#WorkingWithItems.BatchOperations>`__ in the *Amazon DynamoDB Developer Guide*.
80 changes: 42 additions & 38 deletions awscli/examples/dynamodb/create-table.rst
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
**To create a table**

This example creates a table named *MusicCollection*.
The following ``create-table`` example uses the specified attributes and key schema to create a table named ``MusicCollection``. ::

Command::

aws dynamodb create-table --table-name MusicCollection --attribute-definitions AttributeName=Artist,AttributeType=S AttributeName=SongTitle,AttributeType=S --key-schema AttributeName=Artist,KeyType=HASH AttributeName=SongTitle,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
aws dynamodb create-table \
--table-name MusicCollection \
--attribute-definitions AttributeName=Artist,AttributeType=S AttributeName=SongTitle,AttributeType=S \
--key-schema AttributeName=Artist,KeyType=HASH AttributeName=SongTitle,KeyType=RANGE \
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5

Output::

{
"TableDescription": {
"AttributeDefinitions": [
{
"AttributeName": "Artist",
"AttributeType": "S"
},
{
"AttributeName": "SongTitle",
"AttributeType": "S"
}
],
"ProvisionedThroughput": {
"NumberOfDecreasesToday": 0,
"WriteCapacityUnits": 5,
"ReadCapacityUnits": 5
},
"TableSizeBytes": 0,
"TableName": "MusicCollection",
"TableStatus": "CREATING",
"KeySchema": [
{
"KeyType": "HASH",
"AttributeName": "Artist"
},
{
"KeyType": "RANGE",
"AttributeName": "SongTitle"
}
],
"ItemCount": 0,
"CreationDateTime": 1421866952.062
}
}
{
"TableDescription": {
"AttributeDefinitions": [
{
"AttributeName": "Artist",
"AttributeType": "S"
},
{
"AttributeName": "SongTitle",
"AttributeType": "S"
}
],
"ProvisionedThroughput": {
"NumberOfDecreasesToday": 0,
"WriteCapacityUnits": 5,
"ReadCapacityUnits": 5
},
"TableSizeBytes": 0,
"TableName": "MusicCollection",
"TableStatus": "CREATING",
"KeySchema": [
{
"KeyType": "HASH",
"AttributeName": "Artist"
},
{
"KeyType": "RANGE",
"AttributeName": "SongTitle"
}
],
"ItemCount": 0,
"CreationDateTime": 1421866952.062
}
}

For more information, see `Basic Operations for Tables <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.Basics.html>`__ in the *Amazon DynamoDB Developer Guide*.
Loading

0 comments on commit bce871b

Please sign in to comment.