From aa890a3f374086d09629a4b5eb44b20c1edf1595 Mon Sep 17 00:00:00 2001 From: "Nordlund, Eric" Date: Wed, 17 Dec 2014 20:46:45 -0800 Subject: [PATCH 1/4] 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 2/4] 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 3/4] 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 4/4] 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',