From 6f9c17f8ac11d4406df68c49e5d277727581e7f4 Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Fri, 19 Dec 2014 12:25:56 -0800 Subject: [PATCH 01/14] Update param docs to match actual EC2 docs For comparison: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html Note the FromPort and ToPort documentation. In response to #1066. --- awscli/customizations/ec2secgroupsimplify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awscli/customizations/ec2secgroupsimplify.py b/awscli/customizations/ec2secgroupsimplify.py index 88c800d0070e..78f672960cd5 100644 --- a/awscli/customizations/ec2secgroupsimplify.py +++ b/awscli/customizations/ec2secgroupsimplify.py @@ -95,8 +95,9 @@ def _add_docs(help_command, **kwargs): '

Valid protocol values: tcp, ' 'udp, icmp

') PORT_DOCS = ('

For TCP or UDP: The range of ports to allow.' - ' A single integer or a range (min-max). You can ' - 'specify all to mean all ports

') + ' A single integer or a range (min-max). A value of ' + '-1 indicates all ICMP codes for the ' + 'specified ICMP type.

') CIDR_DOCS = '

The CIDR IP range.

' SOURCEGROUP_DOCS = ('

The name or ID of the source security group. ' 'Cannot be used when specifying a CIDR IP address.') From cdb7c11b00092e029e085b28737fc5f92b8add59 Mon Sep 17 00:00:00 2001 From: kyleknap Date: Fri, 19 Dec 2014 12:48:41 -0800 Subject: [PATCH 02/14] Update changelog --- CHANGELOG.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 211f667547c2..d9e548adae0c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,14 @@ CHANGELOG ========= +Next Release (TBD) +================== + +* bugfix:``aws ec2 run-instances``: Allow binary files to be passed to + ``--user-data`` + (`botocore issue 416 `_) + + 1.6.10 ====== From bcb4bf7fd5e156678e91e1cf65ecc18cbc490b41 Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Fri, 19 Dec 2014 12:49:16 -0800 Subject: [PATCH 03/14] Add test to verify no shadowed builtins This test was actually failing because of an operation hiding the query argument for the cloudsearchdomain suggest operation. --- awscli/customizations/argrename.py | 1 + tests/integration/test_cli.py | 43 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/awscli/customizations/argrename.py b/awscli/customizations/argrename.py index 33f11767cd74..d8415413ebc8 100644 --- a/awscli/customizations/argrename.py +++ b/awscli/customizations/argrename.py @@ -35,6 +35,7 @@ 'emr.*.job-flow-ids': 'cluster-ids', 'emr.*.job-flow-id': 'cluster-id', 'cloudsearchdomain.search.query': 'search-query', + 'cloudsearchdomain.suggest.query': 'suggest-query', 'sns.subscribe.endpoint': 'notification-endpoint', 'deploy.*.s-3-location': 's3-location', 'deploy.*.ec-2-tag-filters': 'ec2-tag-filters', diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 0f5af837be60..28ef476cb43c 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -18,6 +18,49 @@ import botocore.session from awscli.testutils import unittest, aws +from awscli.clidriver import create_clidriver + + +def test_no_shadowed_builtins(): + """Verify no command params are shadowed by the built in param. + + The CLI parses all command line options into a single namespace. + This means that option names must be unique and cannot conflict + with the top level params. + + For example, there's a top level param ``--version``. If an + operation for a service also provides a ``--version`` option, + it can never be called because we'll assume the user meant + the top level ``--version`` param. + + In order to ensure this doesn't happen, this test will go + through every command table and ensure we're not shadowing + any builtins. + + Also, rather than being a test generator, we're going to just + aggregate all the failures in one pass and surface them as + a single test failure. + + """ + driver = create_clidriver() + help_command = driver.create_help_command() + top_level_params = set(driver.create_help_command().arg_table) + errors = [] + for command_name, command_obj in help_command.command_table.items(): + sub_help = command_obj.create_help_command() + if hasattr(sub_help, 'command_table'): + for sub_name, sub_command in sub_help.command_table.items(): + op_help = sub_command.create_help_command() + arg_table = op_help.arg_table + for arg_name in arg_table: + if arg_name in top_level_params: + # Then we're shadowing a built in argument. + errors.append( + 'Shadowing a top level option: %s.%s.%s' % ( + command_name, sub_name, arg_name)) + + if errors: + raise AssertionError('\n' + '\n'.join(errors)) class TestBasicCommandFunctionality(unittest.TestCase): From 65bc4f4fe089ea48062f68e52f272b08ef03aa52 Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Fri, 19 Dec 2014 12:51:32 -0800 Subject: [PATCH 04/14] Update changelog with latest fix --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d9e548adae0c..6cf7fdeed713 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,10 @@ Next Release (TBD) * bugfix:``aws ec2 run-instances``: Allow binary files to be passed to ``--user-data`` (`botocore issue 416 `_) +* bugfix:``aws cloudsearchdomain suggest``: Add ``--suggest-query`` + option to fix the argument being shadowed by the top level + ``--query`` option. + (`issue 1068 `__) 1.6.10 From 0721272ed880251b7952a293d2d1eea25b2c4d0d Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Tue, 30 Dec 2014 13:23:29 -0800 Subject: [PATCH 05/14] Change cwd test to use a tempdir Many system users will not have a homedir, or will have this value set to `/dev/null`, which will break this test. Instead we'll just create a tempdir and cd to that instead. --- .../customizations/s3/test_plugin.py | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/tests/integration/customizations/s3/test_plugin.py b/tests/integration/customizations/s3/test_plugin.py index 75c2970c4b9e..aa2b8563a0a8 100644 --- a/tests/integration/customizations/s3/test_plugin.py +++ b/tests/integration/customizations/s3/test_plugin.py @@ -24,6 +24,8 @@ import signal import string import socket +import tempfile +import shutil import botocore.session from awscli.compat import six @@ -124,7 +126,7 @@ def delete_bucket(self, bucket_name): def remove_all_objects(self, bucket_name): operation = self.service.get_operation('ListObjects') - endpoint = self.service.get_endpoint(self.regions[bucket_name]) + endpoint = self.service.get_endpoint(self.regions[bucket_name]) pages = operation.paginate(endpoint, bucket=bucket_name) parsed = pages.build_full_result() key_names = [obj['Key'] for obj in parsed['Contents']] @@ -516,11 +518,11 @@ def test_sync_with_plus_chars_paginate(self): self.files.create_file('foo +%06d' % i, contents='', mtime=mtime)) - p = aws('s3 sync %s s3://%s/ --page-size 2' % + p = aws('s3 sync %s s3://%s/ --page-size 2' % (self.files.rootdir, bucket_name)) self.assert_no_errors(p) time.sleep(1) - p2 = aws('s3 sync %s s3://%s/ --page-size 2' + p2 = aws('s3 sync %s s3://%s/ --page-size 2' % (self.files.rootdir, bucket_name)) self.assertNotIn('upload:', p2.stdout) self.assertEqual('', p2.stdout) @@ -540,7 +542,7 @@ def test_s3_to_s3_sync_with_plus_char_paginate(self): for key in keynames: self.assertTrue(self.key_exists(bucket_name, key)) - p = aws('s3 sync s3://%s/ s3://%s/ --page-size 2' % + p = aws('s3 sync s3://%s/ s3://%s/ --page-size 2' % (bucket_name, bucket_name_2)) self.assert_no_errors(p) for key in keynames: @@ -550,13 +552,13 @@ def test_s3_to_s3_sync_with_plus_char_paginate(self): (bucket_name, bucket_name_2)) self.assertNotIn('copy:', p2.stdout) self.assertEqual('', p2.stdout) - + def test_sync_no_resync(self): self.files.create_file('xyz123456789', contents='test1') self.files.create_file(os.path.join('xyz1', 'test'), contents='test2') self.files.create_file(os.path.join('xyz', 'test'), contents='test3') bucket_name = self.create_bucket() - + p = aws('s3 sync %s s3://%s' % (self.files.rootdir, bucket_name)) self.assert_no_errors(p) time.sleep(2) @@ -659,12 +661,12 @@ def extra_setup(self): # sequences of characters and joining them with a period and # adding a .com at the end. for i in range(2): - name_comp.append(''.join(random.sample(string.ascii_lowercase + + name_comp.append(''.join(random.sample(string.ascii_lowercase + string.digits,10))) self.src_name = '.'.join(name_comp + ['com']) name_comp = [] for i in range(2): - name_comp.append(''.join(random.sample(string.ascii_lowercase + + name_comp.append(''.join(random.sample(string.ascii_lowercase + string.digits,10))) self.dest_name = '.'.join(name_comp + ['com']) self.src_region = 'us-west-1' @@ -674,21 +676,21 @@ def extra_setup(self): def testFailWithoutRegion(self): self.files.create_file('foo.txt', 'foo') - p = aws('s3 sync %s s3://%s/ --region %s' % + p = aws('s3 sync %s s3://%s/ --region %s' % (self.files.rootdir, self.src_bucket, self.src_region)) self.assert_no_errors(p) - p2 = aws('s3 sync s3://%s/ s3://%s/ --region %s' % + p2 = aws('s3 sync s3://%s/ s3://%s/ --region %s' % (self.src_bucket, self.dest_bucket, self.src_region)) self.assertEqual(p2.rc, 1, p2.stdout) self.assertIn('PermanentRedirect', p2.stderr) def testCpRegion(self): self.files.create_file('foo.txt', 'foo') - p = aws('s3 sync %s s3://%s/ --region %s' % + p = aws('s3 sync %s s3://%s/ --region %s' % (self.files.rootdir, self.src_bucket, self.src_region)) self.assert_no_errors(p) p2 = aws('s3 cp s3://%s/ s3://%s/ --region %s --source-region %s ' - '--recursive' % + '--recursive' % (self.src_bucket, self.dest_bucket, self.dest_region, self.src_region)) self.assertEqual(p2.rc, 0, p2.stdout) @@ -697,7 +699,7 @@ def testCpRegion(self): def testSyncRegion(self): self.files.create_file('foo.txt', 'foo') - p = aws('s3 sync %s s3://%s/ --region %s' % + p = aws('s3 sync %s s3://%s/ --region %s' % (self.files.rootdir, self.src_bucket, self.src_region)) self.assert_no_errors(p) p2 = aws('s3 sync s3://%s/ s3://%s/ --region %s --source-region %s ' % @@ -709,11 +711,11 @@ def testSyncRegion(self): def testMvRegion(self): self.files.create_file('foo.txt', 'foo') - p = aws('s3 sync %s s3://%s/ --region %s' % + p = aws('s3 sync %s s3://%s/ --region %s' % (self.files.rootdir, self.src_bucket, self.src_region)) self.assert_no_errors(p) p2 = aws('s3 mv s3://%s/ s3://%s/ --region %s --source-region %s ' - '--recursive' % + '--recursive' % (self.src_bucket, self.dest_bucket, self.dest_region, self.src_region)) self.assertEqual(p2.rc, 0, p2.stdout) @@ -743,12 +745,12 @@ def testMvLargeFileRegion(self): class TestWarnings(BaseS3CLICommand): def extra_setup(self): self.bucket_name = self.create_bucket() - + def test_no_exist(self): filename = os.path.join(self.files.rootdir, "no-exists-file") p = aws('s3 cp %s s3://%s/' % (filename, self.bucket_name)) self.assertEqual(p.rc, 2, p.stderr) - self.assertIn('warning: Skipping file %s. File does not exist.' % + self.assertIn('warning: Skipping file %s. File does not exist.' % filename, p.stderr) @unittest.skipIf(platform.system() not in ['Darwin', 'Linux'], @@ -759,7 +761,7 @@ def test_no_read_access(self): self.files.create_file('foo.txt', 'foo') filename = os.path.join(self.files.rootdir, 'foo.txt') permissions = stat.S_IMODE(os.stat(filename).st_mode) - # Remove read permissions + # Remove read permissions permissions = permissions ^ stat.S_IREAD os.chmod(filename, permissions) p = aws('s3 cp %s s3://%s/' % (filename, self.bucket_name)) @@ -855,11 +857,11 @@ def test_follow_symlinks_default(self): self.assertEqual(self.get_key_contents(self.bucket_name, key_name='realfiles/foo.txt'), 'foo.txt contents') - + def test_bad_symlink(self): p = aws('s3 sync %s s3://%s/' % (self.files.rootdir, self.bucket_name)) self.assertEqual(p.rc, 2, p.stderr) - self.assertIn('warning: Skipping file %s. File does not exist.' % + self.assertIn('warning: Skipping file %s. File does not exist.' % os.path.join(self.files.rootdir, 'b-badsymlink'), p.stderr) @@ -1009,7 +1011,7 @@ def extra_setup(self): def test_mb_rb(self): p = aws('s3 mb s3://%s' % self.bucket_name) self.assert_no_errors(p) - + # Give the bucket time to form. time.sleep(1) response = self.list_buckets() @@ -1311,7 +1313,9 @@ def test_explicitly_exclude_single_file(self): def test_cwd_doesnt_matter(self): full_path = self.files.create_file('foo.txt', 'this is foo.txt') - with cd(os.path.expanduser('~')): + tempdir = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, tempdir) + with cd(tempdir): p = aws("s3 cp %s s3://random-bucket-name/ --dryrun --exclude '*'" % full_path) self.assert_no_files_would_be_uploaded(p) From a6f10fdba5594910432c81aad17ed70947528912 Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Tue, 30 Dec 2014 13:26:30 -0800 Subject: [PATCH 06/14] Fix flake8 issues --- .../customizations/s3/test_plugin.py | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/integration/customizations/s3/test_plugin.py b/tests/integration/customizations/s3/test_plugin.py index aa2b8563a0a8..94dd6de5723c 100644 --- a/tests/integration/customizations/s3/test_plugin.py +++ b/tests/integration/customizations/s3/test_plugin.py @@ -662,12 +662,12 @@ def extra_setup(self): # adding a .com at the end. for i in range(2): name_comp.append(''.join(random.sample(string.ascii_lowercase + - string.digits,10))) + string.digits, 10))) self.src_name = '.'.join(name_comp + ['com']) name_comp = [] for i in range(2): name_comp.append(''.join(random.sample(string.ascii_lowercase + - string.digits,10))) + string.digits, 10))) self.dest_name = '.'.join(name_comp + ['com']) self.src_region = 'us-west-1' self.dest_region = 'us-east-1' @@ -807,8 +807,8 @@ def extra_setup(self): 'c-goodsymlink')) def test_no_follow_symlinks(self): - p = aws('s3 sync %s s3://%s/ --no-follow-symlinks' % (self.files.rootdir, - self.bucket_name)) + p = aws('s3 sync %s s3://%s/ --no-follow-symlinks' % ( + self.files.rootdir, self.bucket_name)) self.assert_no_errors(p) self.assertTrue(not self.key_exists(self.bucket_name, 'a-goodsymlink')) @@ -1063,7 +1063,8 @@ def test_normal_output_only_show_errors(self): foo_txt = self.files.create_file('foo.txt', 'foo contents') # Copy file into bucket. - p = aws('s3 cp %s s3://%s/ --only-show-errors' % (foo_txt, bucket_name)) + p = aws('s3 cp %s s3://%s/ --only-show-errors' % (foo_txt, + bucket_name)) self.assertEqual(p.rc, 0) # Check that nothing was printed to stdout. self.assertEqual('', p.stdout) @@ -1368,7 +1369,7 @@ def test_s3_filtering(self): def test_exclude_filter_with_delete(self): # Test for: https://github.com/aws/aws-cli/issues/778 bucket_name = self.create_bucket() - first = self.files.create_file('foo.txt', 'contents') + self.files.create_file('foo.txt', 'contents') second = self.files.create_file('bar.py', 'contents') p = aws("s3 sync %s s3://%s/" % (self.files.rootdir, bucket_name)) self.assert_no_errors(p) @@ -1396,7 +1397,7 @@ def test_exclude_filter_with_relative_path(self): # Same test as test_exclude_filter_with_delete, except we don't # use an absolute path on the source dir. bucket_name = self.create_bucket() - first = self.files.create_file('foo.txt', 'contents') + self.files.create_file('foo.txt', 'contents') second = self.files.create_file('bar.py', 'contents') p = aws("s3 sync %s s3://%s/" % (self.files.rootdir, bucket_name)) self.assert_no_errors(p) @@ -1429,8 +1430,8 @@ def test_filter_no_resync(self): # https://github.com/aws/aws-cli/issues/794 bucket_name = self.create_bucket() dir_name = os.path.join(self.files.rootdir, 'temp') - filename = self.files.create_file(os.path.join(dir_name, 'test.txt'), - contents='foo') + self.files.create_file(os.path.join(dir_name, 'test.txt'), + contents='foo') # Sync a local directory to an s3 prefix. p = aws('s3 sync %s s3://%s/temp' % (dir_name, bucket_name)) self.assert_no_errors(p) @@ -1459,8 +1460,8 @@ def test_upload_download_file_with_spaces(self): def test_sync_file_with_spaces(self): bucket_name = self.create_bucket() bucket_name = self.create_bucket() - filename = self.files.create_file( - 'with space.txt', 'contents', mtime=time.time() - 300) + self.files.create_file('with space.txt', + 'contents', mtime=time.time() - 300) p = aws('s3 sync %s s3://%s/' % (self.files.rootdir, bucket_name)) self.assert_no_errors(p) From 15e2c76aaad8ea0fc5d39d9ec0a7bce66f24cbd5 Mon Sep 17 00:00:00 2001 From: kyleknap Date: Tue, 30 Dec 2014 17:50:50 -0800 Subject: [PATCH 07/14] Update changelog with botocore fix --- CHANGELOG.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6cf7fdeed713..45802bab9091 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,9 @@ CHANGELOG Next Release (TBD) ================== +* bugfix:``aws cloudfront wait``: Fix issue where wait commands did not + stop waiting when a success state was reached. + (`botocore issue 426 `_) * bugfix:``aws ec2 run-instances``: Allow binary files to be passed to ``--user-data`` (`botocore issue 416 `_) From 2b9176b80b5c160181a98db098b4bbf750af629d Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Tue, 30 Dec 2014 18:09:41 -0800 Subject: [PATCH 08/14] Add EMR fix to latest changes --- CHANGELOG.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 45802bab9091..5ebbfda03a76 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,9 @@ Next Release (TBD) option to fix the argument being shadowed by the top level ``--query`` option. (`issue 1068 `__) +* bugfix:``aws emr``: Fix issue with endpoints for ``eu-central-1`` and + ``cn-north-1`` + (`botocore issue 423 `__) 1.6.10 From b70ae39b5b97b5b8349e21aad22c8d386dda9c2d Mon Sep 17 00:00:00 2001 From: Ted Timmons Date: Sun, 4 Jan 2015 17:31:01 -0800 Subject: [PATCH 09/14] fix minor typo, ACl -> ACL Simple tyop, I even double-checked that I'm not wrong- AWS documentation is consistent about it being ACL, and the L actually stands for something: http://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html --- awscli/customizations/s3/subcommands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awscli/customizations/s3/subcommands.py b/awscli/customizations/s3/subcommands.py index b296bfe41bcf..57fa827b22a2 100644 --- a/awscli/customizations/s3/subcommands.py +++ b/awscli/customizations/s3/subcommands.py @@ -96,7 +96,7 @@ 'authenticated-read', 'bucket-owner-read', 'bucket-owner-full-control', 'log-delivery-write'], 'help_text': ( - "Sets the ACl for the object when the command is " + "Sets the ACL for the object when the command is " "performed. Only accepts values of ``private``, ``public-read``, " "``public-read-write``, ``authenticated-read``, " "``bucket-owner-read``, ``bucket-owner-full-control`` and " From 906a234c4990878186470463be6307da8345b9a0 Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Tue, 6 Jan 2015 17:54:45 -0800 Subject: [PATCH 10/14] Add #1076 to the changelog --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5ebbfda03a76..5fce28c01324 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,6 +18,10 @@ Next Release (TBD) * bugfix:``aws emr``: Fix issue with endpoints for ``eu-central-1`` and ``cn-north-1`` (`botocore issue 423 `__) +* bugfix:``aws s3``: Fix issue where empty XML nodes are now parsed + as an empty string ``""`` instead of ``null``, which allows for + round tripping ``aws s3 get/put-bucket-lifecycle`` + (`issue 1076 `__) 1.6.10 From aa890a3f374086d09629a4b5eb44b20c1edf1595 Mon Sep 17 00:00:00 2001 From: "Nordlund, Eric" Date: Wed, 17 Dec 2014 20:46:45 -0800 Subject: [PATCH 11/14] Adding Amazon ECS examples. --- awscli/examples/ecs/create-cluster.rst | 17 ++++ .../ecs/deregister-container-instance.rst | 7 ++ awscli/examples/ecs/describe-cluster.rst | 20 ++++ .../ecs/describe-container-instance.rst | 52 +++++++++++ .../examples/ecs/describe-task-definition.rst | 66 +++++++++++++ awscli/examples/ecs/describe-task.rst | 37 ++++++++ awscli/examples/ecs/list-clusters.rst | 17 ++++ .../examples/ecs/list-container-instances.rst | 16 ++++ awscli/examples/ecs/list-task-definitions.rst | 39 ++++++++ awscli/examples/ecs/list-tasks.rst | 32 +++++++ .../examples/ecs/register-task-definition.rst | 92 +++++++++++++++++++ awscli/examples/ecs/run-task.rst | 36 ++++++++ 12 files changed, 431 insertions(+) create mode 100644 awscli/examples/ecs/create-cluster.rst create mode 100644 awscli/examples/ecs/deregister-container-instance.rst create mode 100644 awscli/examples/ecs/describe-cluster.rst create mode 100644 awscli/examples/ecs/describe-container-instance.rst create mode 100644 awscli/examples/ecs/describe-task-definition.rst create mode 100644 awscli/examples/ecs/describe-task.rst create mode 100644 awscli/examples/ecs/list-clusters.rst create mode 100644 awscli/examples/ecs/list-container-instances.rst create mode 100644 awscli/examples/ecs/list-task-definitions.rst create mode 100644 awscli/examples/ecs/list-tasks.rst create mode 100644 awscli/examples/ecs/register-task-definition.rst create mode 100644 awscli/examples/ecs/run-task.rst diff --git a/awscli/examples/ecs/create-cluster.rst b/awscli/examples/ecs/create-cluster.rst new file mode 100644 index 000000000000..d35385b9f8f5 --- /dev/null +++ b/awscli/examples/ecs/create-cluster.rst @@ -0,0 +1,17 @@ +**To create a new cluster** + +This example command creates a cluster in your default region. + +Command:: + + aws ecs create-cluster --cluster-name "dev_preview" + +Output:: + + { + "cluster": { + "clusterName": "dev_preview", + "status": "ACTIVE", + "clusterArn": "arn:aws:ecs:us-west-2::cluster/dev_preview" + } + } diff --git a/awscli/examples/ecs/deregister-container-instance.rst b/awscli/examples/ecs/deregister-container-instance.rst new file mode 100644 index 000000000000..ec154b5c07ba --- /dev/null +++ b/awscli/examples/ecs/deregister-container-instance.rst @@ -0,0 +1,7 @@ +**To deregister a container instance from a cluster** + +This example deregisters a container instance from the specified cluster in your default region. If there are still tasks running on the container instance, you must either stop those tasks before deregistering, or use the force option. + +Command:: + + aws ecs deregister-container-instance --cluster default --container-instance --force diff --git a/awscli/examples/ecs/describe-cluster.rst b/awscli/examples/ecs/describe-cluster.rst new file mode 100644 index 000000000000..3bb0754f2d3a --- /dev/null +++ b/awscli/examples/ecs/describe-cluster.rst @@ -0,0 +1,20 @@ +**To describe a cluster** + +This example command provides a description of the specified cluster in your default region. + +Command:: + + aws ecs describe-cluster --cluster default + +Output:: + + { + "clusters": [ + { + "clusterName": "default", + "status": "ACTIVE", + "clusterArn": "arn:aws:ecs:us-west-2::cluster/default" + } + ], + "failures": [] + } diff --git a/awscli/examples/ecs/describe-container-instance.rst b/awscli/examples/ecs/describe-container-instance.rst new file mode 100644 index 000000000000..11b10804e278 --- /dev/null +++ b/awscli/examples/ecs/describe-container-instance.rst @@ -0,0 +1,52 @@ +**To describe container instance** + +This example command provides a description of the specified container instance in your default region, using the container instance UUID as an identifier. + +Command:: + + aws ecs describe-container-instance --cluster default --container-instance f6bbb147-5370-4ace-8c73-c7181ded911f + +Output:: + + { + "failures": [], + "containerInstances": [ + { + "status": "ACTIVE", + "remainingResources": [ + { + "integerValue": 32748, + "longValue": 0, + "type": "INTEGER", + "name": "CPU", + "doubleValue": 0.0 + }, + { + "integerValue": 60377, + "longValue": 0, + "type": "INTEGER", + "name": "MEMORY", + "doubleValue": 0.0 + } + ], + "registeredResources": [ + { + "integerValue": 32768, + "longValue": 0, + "type": "INTEGER", + "name": "CPU", + "doubleValue": 0.0 + }, + { + "integerValue": 60397, + "longValue": 0, + "type": "INTEGER", + "name": "MEMORY", + "doubleValue": 0.0 + } + ], + "containerInstanceArn": "arn:aws:ecs:us-west-2::container-instance/f6bbb147-5370-4ace-8c73-c7181ded911f", + "ec2InstanceId": "i-0f51df05" + } + ] + } diff --git a/awscli/examples/ecs/describe-task-definition.rst b/awscli/examples/ecs/describe-task-definition.rst new file mode 100644 index 000000000000..ef23ca592cc3 --- /dev/null +++ b/awscli/examples/ecs/describe-task-definition.rst @@ -0,0 +1,66 @@ +**To describe a task definition** + +This example command provides a description of the specified task definition. + +Command:: + + aws ecs describe-task-definition --task-definition wordpress:6 + +Output:: + + { + "taskDefinition": { + "taskDefinitionArn": "arn:aws:ecs:us-west-2::task-definition/wordpress:6", + "containerDefinitions": [ + { + "environment": [ + { + "name": "DB_USER", + "value": "root" + }, + { + "name": "DB_PASS", + "value": "pass" + } + ], + "name": "wordpress", + "links": [ + "db" + ], + "image": "tutum/wordpress-stackable", + "essential": true, + "portMappings": [ + { + "containerPort": 80, + "hostPort": 80 + } + ], + "entryPoint": [ + "/bin/sh", + "-c" + ], + "memory": 500, + "cpu": 10 + }, + { + "environment": [ + { + "name": "MYSQL_ROOT_PASSWORD", + "value": "pass" + } + ], + "name": "db", + "image": "mysql", + "cpu": 10, + "portMappings": [], + "entryPoint": [ + "/entrypoint.sh" + ], + "memory": 500, + "essential": true + } + ], + "family": "wordpress", + "revision": 6 + } + } diff --git a/awscli/examples/ecs/describe-task.rst b/awscli/examples/ecs/describe-task.rst new file mode 100644 index 000000000000..34eba13406d0 --- /dev/null +++ b/awscli/examples/ecs/describe-task.rst @@ -0,0 +1,37 @@ +**To describe a task** + +This example command provides a description of the specified task, using the task UUID as an identifier. + +Command:: + + aws ecs describe-task --cluster default --task 0cc43cdb-3bee-4407-9c26-c0e6ea5bee84 + +Output:: + + { + "failures": [], + "tasks": [ + { + "taskArn": "arn:aws:ecs:us-west-2::task/0cc43cdb-3bee-4407-9c26-c0e6ea5bee84", + "overrides": { + "containerOverrides": [ + { + "name": "sleep" + } + ] + }, + "lastStatus": "PENDING", + "containerInstanceArn": "arn:aws:ecs:us-west-2::container-instance/f6bbb147-5370-4ace-8c73-c7181ded911f", + "desiredStatus": "RUNNING", + "taskDefinitionArn": "arn:aws:ecs:us-west-2::task-definition/sleep360:1", + "containers": [ + { + "containerArn": "arn:aws:ecs:us-west-2::container/291bb057-f49c-4bd7-9b50-9c891359083b", + "taskArn": "arn:aws:ecs:us-west-2::task/0cc43cdb-3bee-4407-9c26-c0e6ea5bee84", + "lastStatus": "PENDING", + "name": "sleep" + } + ] + } + ] + } diff --git a/awscli/examples/ecs/list-clusters.rst b/awscli/examples/ecs/list-clusters.rst new file mode 100644 index 000000000000..b37eff06771d --- /dev/null +++ b/awscli/examples/ecs/list-clusters.rst @@ -0,0 +1,17 @@ +**To list your available clusters** + +This example command lists all of your available clusters in your default region. + +Command:: + + aws ecs list-clusters + +Output:: + + { + "clusterArns": [ + "arn:aws:ecs:us-west-2::cluster/test", + "arn:aws:ecs:us-west-2::cluster/default", + "arn:aws:ecs:us-west-2::cluster/My test cluster" + ] + } diff --git a/awscli/examples/ecs/list-container-instances.rst b/awscli/examples/ecs/list-container-instances.rst new file mode 100644 index 000000000000..07b1a8ef242f --- /dev/null +++ b/awscli/examples/ecs/list-container-instances.rst @@ -0,0 +1,16 @@ +**To list your available container instances in a cluster** + +This example command lists all of your available container instances in the specified cluster in your default region. + +Command:: + + aws ecs list-container-instances --cluster default + +Output:: + + { + "containerInstanceArns": [ + "arn:aws:ecs:us-west-2::container-instance/f6bbb147-5370-4ace-8c73-c7181ded911f", + "arn:aws:ecs:us-west-2::container-instance/ffe3d344-77e2-476c-a4d0-bf560ad50acb" + ] + } diff --git a/awscli/examples/ecs/list-task-definitions.rst b/awscli/examples/ecs/list-task-definitions.rst new file mode 100644 index 000000000000..05f6caa2a3cd --- /dev/null +++ b/awscli/examples/ecs/list-task-definitions.rst @@ -0,0 +1,39 @@ +**To list your registered task definitions** + +This example command lists all of your registered task definitions. + +Command:: + + aws ecs list-task-definitions + +Output:: + + { + "taskDefinitionArns": [ + "arn:aws:ecs:us-west-2::task-definition/sleep300:2", + "arn:aws:ecs:us-west-2::task-definition/sleep360:1", + "arn:aws:ecs:us-west-2::task-definition/wordpress:3", + "arn:aws:ecs:us-west-2::task-definition/wordpress:4", + "arn:aws:ecs:us-west-2::task-definition/wordpress:5", + "arn:aws:ecs:us-west-2::task-definition/wordpress:6" + ] + } + +**To list the registered task definitions in a family** + +This example command lists the task definition revisions of a specified family. + +Command:: + + aws ecs list-task-definitions --family-prefix wordpress + +Output:: + + { + "taskDefinitionArns": [ + "arn:aws:ecs:us-west-2::task-definition/wordpress:3", + "arn:aws:ecs:us-west-2::task-definition/wordpress:4", + "arn:aws:ecs:us-west-2::task-definition/wordpress:5", + "arn:aws:ecs:us-west-2::task-definition/wordpress:6" + ] + } diff --git a/awscli/examples/ecs/list-tasks.rst b/awscli/examples/ecs/list-tasks.rst new file mode 100644 index 000000000000..d0c6547a08cb --- /dev/null +++ b/awscli/examples/ecs/list-tasks.rst @@ -0,0 +1,32 @@ +**To list the tasks in a cluster** + +This example command lists all of the tasks in a cluster. + +Command:: + + aws ecs list-tasks --cluster default + +Output:: + + { + "taskArns": [ + "arn:aws:ecs:us-west-2::task/0cc43cdb-3bee-4407-9c26-c0e6ea5bee84", + "arn:aws:ecs:us-west-2::task/6b809ef6-c67e-4467-921f-ee261c15a0a1" + ] + } + +**To list the tasks on a particular container instance** + +This example command lists the tasks of a specified container instance, using the container instance UUID as a filter. + +Command:: + + aws ecs list-tasks --cluster default --container-instance f6bbb147-5370-4ace-8c73-c7181ded911f + +Output:: + + { + "taskArns": [ + "arn:aws:ecs:us-west-2::task/0cc43cdb-3bee-4407-9c26-c0e6ea5bee84" + ] + } diff --git a/awscli/examples/ecs/register-task-definition.rst b/awscli/examples/ecs/register-task-definition.rst new file mode 100644 index 000000000000..94b4db22f2ad --- /dev/null +++ b/awscli/examples/ecs/register-task-definition.rst @@ -0,0 +1,92 @@ +**To register a task definition with a JSON file** + +This example registers a task definition to the specified family with container definitions that are saved in JSON format at the specified file location. + +Command:: + + aws ecs register-task-definition --family sleep360 --container-definitions file:///sleep360.json + +JSON file format:: + + [ + { + "environment": [], + "name": "sleep", + "image": "busybox", + "cpu": 10, + "portMappings": [], + "entryPoint": [ + "/bin/sh" + ], + "memory": 10, + "command": [ + "sleep", + "360" + ], + "essential": true + } + ] + +Output:: + + { + "taskDefinition": { + "taskDefinitionArn": "arn:aws:ecs:us-west-2::task-definition/sleep360:2", + "containerDefinitions": [ + { + "environment": [], + "name": "sleep", + "image": "busybox", + "cpu": 10, + "portMappings": [], + "entryPoint": [ + "/bin/sh" + ], + "memory": 10, + "command": [ + "sleep", + "360" + ], + "essential": true + } + ], + "family": "sleep360", + "revision": 2 + } + } + +**To register a task definition with a JSON string** + +This example registers a the same task definition from the previous example, but the container definitions are in a string format with the double quotes escaped. + +Command:: + + aws ecs register-task-definition --family sleep360 --container-definitions "[{\"environment\":[],\"name\":\"sleep\",\"image\":\"busybox\",\"cpu\":10,\"portMappings\":[],\"entryPoint\":[\"/bin/sh\"],\"memory\":10,\"command\":[\"sleep\",\"360\"],\"essential\":true}]" + +Output:: + + { + "taskDefinition": { + "taskDefinitionArn": "arn:aws:ecs:us-west-2::task-definition/sleep360:3", + "containerDefinitions": [ + { + "environment": [], + "name": "sleep", + "image": "busybox", + "cpu": 10, + "portMappings": [], + "entryPoint": [ + "/bin/sh" + ], + "memory": 10, + "command": [ + "sleep", + "360" + ], + "essential": true + } + ], + "family": "sleep360", + "revision": 3 + } + } diff --git a/awscli/examples/ecs/run-task.rst b/awscli/examples/ecs/run-task.rst new file mode 100644 index 000000000000..61ae08c10e22 --- /dev/null +++ b/awscli/examples/ecs/run-task.rst @@ -0,0 +1,36 @@ +**To run a task on your default cluster** + +This example command runs the specified task definition on your default cluster. + +Command:: + + aws ecs run-task --cluster default --task-definition sleep360:1 + +Output:: + + { + "tasks": [ + { + "taskArn": "arn:aws:ecs:us-west-2::task/a9f21ea7-c9f5-44b1-b8e6-b31f50ed33c0", + "overrides": { + "containerOverrides": [ + { + "name": "sleep" + } + ] + }, + "lastStatus": "PENDING", + "containerInstanceArn": "arn:aws:ecs:us-west-2::container-instance/ffe3d344-77e2-476c-a4d0-bf560ad50acb", + "desiredStatus": "RUNNING", + "taskDefinitionArn": "arn:aws:ecs:us-west-2::task-definition/sleep360:1", + "containers": [ + { + "containerArn": "arn:aws:ecs:us-west-2::container/58591c8e-be29-4ddf-95aa-ee459d4c59fd", + "taskArn": "arn:aws:ecs:us-west-2::task/a9f21ea7-c9f5-44b1-b8e6-b31f50ed33c0", + "lastStatus": "PENDING", + "name": "sleep" + } + ] + } + ] + } From 29f321403186c49fb6ff00a8792cff509421ca22 Mon Sep 17 00:00:00 2001 From: kyleknap Date: Thu, 8 Jan 2015 12:56:18 -0800 Subject: [PATCH 12/14] Update changelog with new features --- CHANGELOG.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5fce28c01324..c31e56f5030d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,13 @@ CHANGELOG Next Release (TBD) ================== +* feature:``aws cloudhsm``: Add support for AWS CloudHSM. +* feature:``aws ecs``: Add support for ``aws ecs``, the Amazon EC2 + Container Service (ECS) +* feature:``aws rds``: Add Encryption at Rest and CloudHSM Support. +* feature:``aws ec2``: Add Classic Link support +* feature:``aws cloudsearch``: Update ``aws cloudsearch`` command + to latest version * bugfix:``aws cloudfront wait``: Fix issue where wait commands did not stop waiting when a success state was reached. (`botocore issue 426 `_) From 73a0574e4ac34144262392aefc713a6e43cacb3e Mon Sep 17 00:00:00 2001 From: kyleknap Date: Thu, 8 Jan 2015 12:58:14 -0800 Subject: [PATCH 13/14] Update completer test for new services --- tests/unit/test_completer.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/unit/test_completer.py b/tests/unit/test_completer.py index b6e6a5dcf577..df3df9d1b468 100644 --- a/tests/unit/test_completer.py +++ b/tests/unit/test_completer.py @@ -28,17 +28,18 @@ '--query', '--no-sign-request'] COMPLETIONS = [ - ('aws ', -1, set(['autoscaling', 'cloudformation', 'cloudsearch', - 'cloudsearchdomain', 'cloudtrail', 'cloudwatch', - 'cognito-identity', 'cognito-sync', 'configservice', - 'configure', 'datapipeline', 'deploy', 'directconnect', - 'dynamodb', 'ec2', 'elasticache', 'elasticbeanstalk', + ('aws ', -1, set(['autoscaling', 'cloudformation', 'cloudhsm', + 'cloudsearch', 'cloudsearchdomain', 'cloudtrail', + 'cloudwatch', 'cognito-identity', 'cognito-sync', + 'configservice', 'configure', 'datapipeline', 'deploy', + 'directconnect', 'dynamodb', 'glacier', 'ec2', 'ecs', + 'elasticache', 'elasticbeanstalk', 'elastictranscoder', 'elb', 'emr', 'iam', 'importexport', 'kinesis', 'kms', 'lambda', 'logs', 'opsworks', 'rds', 'redshift', 'route53', 'route53domains', 's3', 's3api', 'ses', 'sns', 'sqs', 'storagegateway', 'sts', 'support', 'swf'])), - ('aws cloud', -1, set(['cloudformation', 'cloudsearch', + ('aws cloud', -1, set(['cloudformation', 'cloudhsm', 'cloudsearch', 'cloudsearchdomain', 'cloudtrail', 'cloudwatch'])), ('aws cloudf', -1, set(['cloudformation'])), ('aws cloudfr', -1, set([])), From a7656a6169ef50ed2617f321affa29e44bfad3e9 Mon Sep 17 00:00:00 2001 From: AWS Date: Thu, 8 Jan 2015 13:52:21 -0800 Subject: [PATCH 14/14] Bumping version to 1.7.0 --- CHANGELOG.rst | 4 ++-- awscli/__init__.py | 2 +- doc/source/conf.py | 4 ++-- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c31e56f5030d..64cf05f28853 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,8 +2,8 @@ CHANGELOG ========= -Next Release (TBD) -================== +1.7.0 +===== * feature:``aws cloudhsm``: Add support for AWS CloudHSM. * feature:``aws ecs``: Add support for ``aws ecs``, the Amazon EC2 diff --git a/awscli/__init__.py b/awscli/__init__.py index d955fd7ac840..64b499961f57 100644 --- a/awscli/__init__.py +++ b/awscli/__init__.py @@ -17,7 +17,7 @@ """ import os -__version__ = '1.6.10' +__version__ = '1.7.0' # # Get our data path to be added to botocore's search path diff --git a/doc/source/conf.py b/doc/source/conf.py index b579567cf436..6293c67794f5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -50,9 +50,9 @@ # built documents. # # The short X.Y version. -version = '1.6.' +version = '1.7' # The full version, including alpha/beta/rc tags. -release = '1.6.10' +release = '1.7.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index 1e2ba7b157a1..88b5979db11d 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ import awscli -requires = ['botocore>=0.80.0,<0.81.0', +requires = ['botocore>=0.81.0,<0.82.0', 'bcdoc>=0.12.0,<0.13.0', 'colorama==0.2.5', 'docutils>=0.10',