Skip to content

Commit

Permalink
Merge branch 'release-1.7.12'
Browse files Browse the repository at this point in the history
* release-1.7.12:
  Bumping version to 1.7.12
  Update changelog with service updates
  Bumped CLI dependancy of bcdoc
  Add #1172 to the changelog
  Honor --endpoint-url in s3/s3api commands
  Remove unnecessary --recursive from sync command
  Update dependencies
  Update dependencies
  Prefix doc references with "cli:"
  Update event names to new bcdoc event names
  Add reference label and changed breadcrumbs
  Switched event class to use full name of command
  dynamo db examples
  Remove status code checks from s3 tests
  Update s3 end to end integration test to clients
  • Loading branch information
AWS committed Feb 24, 2015
2 parents 6d7e89c + 631ab7d commit b8b75b8
Show file tree
Hide file tree
Showing 34 changed files with 736 additions and 100 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
CHANGELOG
=========

1.7.12
======

* feature:``aws datapipeline``: Add support for tagging.
* feature:``aws route53``: Add support for listing hosted zones by name and
getting the hosted zone count.
* bugfix:``aws s3 sync``: Remove ``--recursive`` parameter. The ``sync``
command is always a recursive operation meaning the inclusion or
exclusion of ``--recursive`` had no effect on the ``sync`` command.
(`issue 1171 <https://github.com/aws/aws-cli/pull/1168>`__)
* bugfix:``aws s3``: Fix issue where ``--endpoint-url`` was being ignored
(`issue 1142 <https://github.com/aws/aws-cli/pull/1172>`__)


1.7.11
======

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.11'
__version__ = '1.7.12'

#
# Get our data path to be added to botocore's search path
Expand Down
42 changes: 22 additions & 20 deletions awscli/clidocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,27 @@ def unregister(self):

# These are default doc handlers that apply in the general case.

def doc_breadcrumbs(self, help_command, **kwargs):
doc = help_command.doc
if doc.target != 'man':
cmd_names = help_command.event_class.split('.')
doc.write('[ ')
doc.write(':ref:`aws <cli:aws>`')
full_cmd_list = ['aws']
for cmd in cmd_names[:-1]:
doc.write(' . ')
full_cmd_list.append(cmd)
full_cmd_name = ' '.join(full_cmd_list)
doc.write(':ref:`%s <cli:%s>`' % (cmd, full_cmd_name))
doc.write(' ]')

def doc_title(self, help_command, **kwargs):
doc = help_command.doc
doc.style.new_paragraph()
reference = help_command.event_class.replace('.', ' ')
if reference != 'aws':
reference = 'aws ' + reference
doc.writeln('.. _cli:%s:' % reference)
doc.style.h1(help_command.name)

def doc_description(self, help_command, **kwargs):
Expand Down Expand Up @@ -144,6 +163,9 @@ def doc_option(self, arg_name, help_command, **kwargs):

class ProviderDocumentEventHandler(CLIDocumentEventHandler):

def doc_breadcrumbs(self, help_command, event_name, **kwargs):
pass

def doc_synopsis_start(self, help_command, **kwargs):
doc = help_command.doc
doc.style.h2('Synopsis')
Expand Down Expand Up @@ -215,10 +237,6 @@ def doc_option_example(self, arg_name, help_command, **kwargs):
def doc_options_end(self, help_command, **kwargs):
pass

def doc_title(self, help_command, **kwargs):
doc = help_command.doc
doc.style.h1(help_command.name)

def doc_description(self, help_command, **kwargs):
doc = help_command.doc
service = help_command.obj
Expand Down Expand Up @@ -256,22 +274,6 @@ def build_translation_map(self):
d[operation.name] = operation.cli_name
return d

def doc_breadcrumbs(self, help_command, event_name, **kwargs):
doc = help_command.doc
if doc.target != 'man':
l = event_name.split('.')
if len(l) > 1:
service_name = l[1]
doc.write('[ ')
doc.style.ref('aws', '../index')
doc.write(' . ')
doc.style.ref(service_name, 'index')
doc.write(' ]')

def doc_title(self, help_command, **kwargs):
doc = help_command.doc
doc.style.h1(help_command.name)

def doc_description(self, help_command, **kwargs):
doc = help_command.doc
operation = help_command.obj
Expand Down
4 changes: 2 additions & 2 deletions awscli/clidriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def create_help_command(self):
obj=service_object,
command_table=command_table,
arg_table=None,
event_class='Operation',
event_class='.'.join(self.lineage_names),
name=self._name)

def _create_parser(self):
Expand Down Expand Up @@ -544,7 +544,7 @@ def create_help_command(self):
return OperationHelpCommand(
self._service_object.session, self._service_object,
self._operation_object, arg_table=self.arg_table,
name=self._name, event_class=self._parent_name)
name=self._name, event_class='.'.join(self.lineage_names))

def _add_help(self, parser):
# The 'help' output is processed a little differently from
Expand Down
5 changes: 2 additions & 3 deletions awscli/customizations/addexamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ def add_examples(help_command, **kwargs):
os.path.dirname(
os.path.abspath(__file__))), 'examples')
doc_path = os.path.join(doc_path,
help_command.event_class)
file_name = '%s.rst' % (help_command.name)
doc_path = os.path.join(doc_path, file_name)
help_command.event_class.replace('.', os.path.sep))
doc_path = doc_path + '.rst'
LOG.debug("Looking for example file at: %s", doc_path)
if os.path.isfile(doc_path):
help_command.doc.style.h2('Examples')
Expand Down
6 changes: 4 additions & 2 deletions awscli/customizations/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ def lineage(self, value):


class BasicHelp(HelpCommand):
event_class = 'command'

def __init__(self, session, command_object, command_table, arg_table,
event_handler_class=None):
super(BasicHelp, self).__init__(session, command_object,
Expand Down Expand Up @@ -325,6 +323,10 @@ def synopsis(self):
def examples(self):
return self._get_doc_contents('_examples')

@property
def event_class(self):
return '.'.join(self.obj.lineage_names)

def _get_doc_contents(self, attr_name):
value = getattr(self, attr_name)
if isinstance(value, BasicCommand.FROM_FILE):
Expand Down
2 changes: 1 addition & 1 deletion awscli/customizations/datapipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def register_customizations(cli):
cli.register(
'building-command-table.datapipeline',
register_commands)
cli.register(
cli.register_last(
'doc-output.datapipeline.get-pipeline-definition',
document_translation)

Expand Down
7 changes: 4 additions & 3 deletions awscli/customizations/s3/subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
'Using a lower value may help if an operation times out.')}


TRANSFER_ARGS = [DRYRUN, QUIET, RECURSIVE, INCLUDE, EXCLUDE, ACL,
TRANSFER_ARGS = [DRYRUN, QUIET, INCLUDE, EXCLUDE, ACL,
FOLLOW_SYMLINKS, NO_FOLLOW_SYMLINKS, NO_GUESS_MIME_TYPE,
SSE, STORAGE_CLASS, GRANTS, WEBSITE_REDIRECT, CONTENT_TYPE,
CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_ENCODING,
Expand Down Expand Up @@ -526,7 +526,8 @@ class CpCommand(S3TransferCommand):
USAGE = "<LocalPath> <S3Path> or <S3Path> <LocalPath> " \
"or <S3Path> <S3Path>"
ARG_TABLE = [{'name': 'paths', 'nargs': 2, 'positional_arg': True,
'synopsis': USAGE}] + TRANSFER_ARGS + [EXPECTED_SIZE]
'synopsis': USAGE}] + TRANSFER_ARGS + \
[EXPECTED_SIZE, RECURSIVE]
EXAMPLES = BasicCommand.FROM_FILE('s3/cp.rst')


Expand All @@ -537,7 +538,7 @@ class MvCommand(S3TransferCommand):
USAGE = "<LocalPath> <S3Path> or <S3Path> <LocalPath> " \
"or <S3Path> <S3Path>"
ARG_TABLE = [{'name': 'paths', 'nargs': 2, 'positional_arg': True,
'synopsis': USAGE}] + TRANSFER_ARGS
'synopsis': USAGE}] + TRANSFER_ARGS + [RECURSIVE]
EXAMPLES = BasicCommand.FROM_FILE('s3/mv.rst')


Expand Down
2 changes: 1 addition & 1 deletion awscli/customizations/s3endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ def on_top_level_args_parsed(parsed_args, event_handler, **kwargs):
# is disabled.
if parsed_args.command in ['s3', 's3api'] and \
parsed_args.endpoint_url is not None:
event_handler.unregister('before-auth.s3', fix_s3_host)
event_handler.unregister('before-sign.s3', fix_s3_host)
54 changes: 54 additions & 0 deletions awscli/examples/dynamodb/batch-get-item.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
**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.

Command::

aws dynamodb batch-get-item --request-items file://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"
}
}

Output::

{
"UnprocessedKeys": {},
"Responses": {
"MusicCollection": [
{
"AlbumTitle": {
"S": "Somewhat Famous"
}
},
{
"AlbumTitle": {
"S": "Blue Sky Blues"
}
},
{
"AlbumTitle": {
"S": "Louder Than Ever"
}
}
]
}
}
47 changes: 47 additions & 0 deletions awscli/examples/dynamodb/batch-write-item.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
**To add multiple items to a table**

This 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

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"}
}
}
}
]
}

Output::

{
"UnprocessedItems": {}
}
44 changes: 44 additions & 0 deletions awscli/examples/dynamodb/create-table.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
**To create a table**

This example creates 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

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
}
}
23 changes: 23 additions & 0 deletions awscli/examples/dynamodb/delete-item.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**To delete an item**

This example deletes an item from the *MusicCollection* table.

Command::

aws dynamodb delete-item --table-name MusicCollection --key file://key.json

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

{
"Artist": {"S": "No One You Know"},
"SongTitle": {"S": "Scared of My Shadow"}
}

Output::

{
"ConsumedCapacity": {
"CapacityUnits": 1.0,
"TableName": "MusicCollection"
}
}
23 changes: 23 additions & 0 deletions awscli/examples/dynamodb/delete-table.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**To delete a table**

This example deletes the *MusicCollection* table.

Command::

aws dynamodb delete-table --table-name MusicCollection

Output::

{
"TableDescription": {
"TableStatus": "DELETING",
"TableSizeBytes": 0,
"ItemCount": 0,
"TableName": "MusicCollection",
"ProvisionedThroughput": {
"NumberOfDecreasesToday": 0,
"WriteCapacityUnits": 5,
"ReadCapacityUnits": 5
}
}
}
Loading

0 comments on commit b8b75b8

Please sign in to comment.