Skip to content

Commit

Permalink
Merge branch 'release-1.10.14'
Browse files Browse the repository at this point in the history
* release-1.10.14:
  Bumping version to 1.10.14
  Update CHANGELOG.rst
  Fix spelling error in the add model command docs
  Add option to force an attempt at downloading glacier objects
  Database Migration Service examples
  Add api_versions support
  • Loading branch information
AWS committed Mar 17, 2016
2 parents 94587bd + 2bb4cad commit d3f9f89
Show file tree
Hide file tree
Showing 19 changed files with 352 additions and 12 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
CHANGELOG
=========

1.10.14
=======

* feature:``meteringmarketplace``: The AWS Marketplace Metering Service enables
sellers to price their products along new pricing dimensions. After a
integrating their product with the AWS Marketplace Metering Service, that
product will emit an hourly record capturing the usage of any single pricing
dimension. Buyers can easily subscribe to software priced by this new
dimension on the AWS Marketplace website and only pay for what they use.
* feature:``s3api``: Added support for delete marker and abort multipart upload
lifecycle configuration.
* feature:``iot``: Added support for Amazon Elasticsearch Service and
Amazon Cloudwatch actions for the AWS IoT rules engine.
* feature:``cloudhsm``: Added support for tagging resources.


1.10.13
=======

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.10.13'
__version__ = '1.10.14'

#
# Get our data path to be added to botocore's search path
Expand Down
4 changes: 3 additions & 1 deletion awscli/clidriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ def _get_command_table(self):

def _get_service_model(self):
if self._service_model is None:
api_version = self.session.get_config_variable('api_versions').get(
self._service_name, None)
self._service_model = self.session.get_service_model(
self._service_name)
self._service_name, api_version=api_version)
return self._service_model

def __call__(self, args, parsed_globals):
Expand Down
2 changes: 1 addition & 1 deletion awscli/customizations/configure/addmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_model_location(session, service_definition, service_name=None):

class AddModelCommand(BasicCommand):
NAME = 'add-model'
DESCRITPION = (
DESCRIPTION = (
'Adds a service JSON model to the appropriate location in '
'~/.aws/models. Once the model gets added, CLI commands and Boto3 '
'clients will be immediately available for the service JSON model '
Expand Down
6 changes: 4 additions & 2 deletions awscli/customizations/s3/s3handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def __init__(self, session, params, result_queue=None,
'content_language': None, 'expires': None, 'grants': None,
'only_show_errors': False, 'is_stream': False,
'paths_type': None, 'expected_size': None, 'metadata': None,
'metadata_directive': None, 'ignore_glacier_warnings': False
'metadata_directive': None, 'ignore_glacier_warnings': False,
'force_glacier_transfer': False
}
self.params['region'] = params['region']
for key in self.params.keys():
Expand Down Expand Up @@ -186,7 +187,8 @@ def _enqueue_tasks(self, files):
message=warning_message)
self.result_queue.put(warning)
# Warn and skip over glacier incompatible tasks.
elif not filename.is_glacier_compatible():
elif not self.params.get('force_glacier_transfer') and \
not filename.is_glacier_compatible():
LOGGER.debug(
'Encountered glacier object s3://%s. Not performing '
'%s on object.' % (filename.src, filename.operation_name))
Expand Down
11 changes: 10 additions & 1 deletion awscli/customizations/s3/subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,23 @@
}


FORCE_GLACIER_TRANSFER = {
'name': 'force-glacier-transfer', 'action': 'store_true',
'help_text': (
'Forces a transfer request on all Glacier objects in a sync or '
'recursive copy.'
)
}


TRANSFER_ARGS = [DRYRUN, QUIET, INCLUDE, EXCLUDE, ACL,
FOLLOW_SYMLINKS, NO_FOLLOW_SYMLINKS, NO_GUESS_MIME_TYPE,
SSE, SSE_C, SSE_C_KEY, SSE_KMS_KEY_ID, SSE_C_COPY_SOURCE,
SSE_C_COPY_SOURCE_KEY, STORAGE_CLASS, GRANTS,
WEBSITE_REDIRECT, CONTENT_TYPE, CACHE_CONTROL,
CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE,
EXPIRES, SOURCE_REGION, ONLY_SHOW_ERRORS,
PAGE_SIZE, IGNORE_GLACIER_WARNINGS]
PAGE_SIZE, IGNORE_GLACIER_WARNINGS, FORCE_GLACIER_TRANSFER]


def get_client(session, region, endpoint_url, verify, config=None):
Expand Down
19 changes: 19 additions & 0 deletions awscli/examples/dms/create-endpoint.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The following command creates a source endpoint for a MySQL RDS DB instance named ``mydb.cx1llnox7iyx.uswest-2.rds.amazonaws.com``::

aws dms create-endpoint --endpoint-identifier test-endpoint-1 --endpoint-type source --engine-name mysql --username username --password password --server-name mydb.cx1llnox7iyx.uswest-2.rds.amazonaws.com --port 3306

Output::

{
"Endpoint": {
"Username": "username",
"Status": "active",
"EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:RAAR3R22XSH46S3PWLC3NJAWKM",
"ServerName": "mydb.cx1llnox7iyx.us-west-2.rds.amazonaws.com",
"EndpointType": "SOURCE",
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/4c1731d6-5435-ed4d-be13-d53411a7cfbd",
"EngineName": "mysql",
"EndpointIdentifier": "test-endpoint-1",
"Port": 3306
}
}
52 changes: 52 additions & 0 deletions awscli/examples/dms/create-replication-instance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
The following command creates a replication instance named ``my-replication-db`` with 5GB of storage::

aws dms create-replication-instance --replication-instance-identifier my-replication-db --replication-instance-class dms.t2.micro --allocated-storage 5

Output::

{
"ReplicationInstance": {
"PubliclyAccessible": true,
"ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ ",
"ReplicationInstanceClass": "dms.t2.micro",
"ReplicationSubnetGroup": {
"ReplicationSubnetGroupDescription": "default",
"Subnets": [{
"SubnetStatus": "Active",
"SubnetIdentifier": "subnet-f6dd91af",
"SubnetAvailabilityZone": {
"Name": "us-east-1d"
}
}, {
"SubnetStatus": "Active",
"SubnetIdentifier": "subnet-3605751d",
"SubnetAvailabilityZone": {
"Name": "us-east-1b"
}
}, {
"SubnetStatus": "Active",
"SubnetIdentifier": "subnet-c2daefb5",
"SubnetAvailabilityZone": {
"Name": "us-east-1c"
}
}, {
"SubnetStatus": "Active",
"SubnetIdentifier": "subnet-85e90cb8",
"SubnetAvailabilityZone": {
"Name": "us-east-1e"
}
}],
"VpcId": "vpc-6741a603",
"SubnetGroupStatus": "Complete",
"ReplicationSubnetGroupIdentifier": "default"
},
"AutoMinorVersionUpgrade": true,
"ReplicationInstanceStatus": "creating",
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/4c1731d6-5435-ed4d-be13-d53411a7cfbd",
"AllocatedStorage": 5,
"EngineVersion": "1.5.0",
"ReplicationInstanceIdentifier": "test-rep-1",
"PreferredMaintenanceWindow": "sun:06:00-sun:14:00",
"PendingModifiedValues": {}
}
}
58 changes: 58 additions & 0 deletions awscli/examples/dms/create-replication-task.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
The following command creates a replication task to copy data from one DB instance behind a DMS endpoint to another using a replication instance::

aws dms create-replication-task --replicationtask-identifier my-replication-task --target-endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:HTWNT57CLN2WGVBUJQXJZASXWE --source-endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE --replication-instance-arn arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ --migration-type full-load --table-mappings 'file://table-mappings.json'

The file ``table-mappings.json`` is a JSON document in the current folder that specifies table mappings::

{
"TableMappings": [
{
"Type": "Include",
"SourceSchema": "company",
"SourceTable": “emp%"
},
{
"Type": "Include",
"SourceSchema": “employees",
"SourceTable": “%"
},
{
"Type": "Exclude",
"SourceSchema": “source101",
"SourceTable": “dep%"
},
{
"Type": "Exclude",
"SourceSchema": “source102",
"SourceTable": “%"
},
{
"Type": "Explicit",
"SourceSchema": "company",
"SourceTable": "managers"
},
{
"Type": "Explicit",
"SourceSchema": "company",
"SourceTable": "locations"
}
]
}


Output::

{
"ReplicationTask": {
"SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE",
"ReplicationTaskIdentifier": "task1",
"ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ",
"TableMappings": "{\n \"TableMappings\": [\n {\n \"Type\":\"Include\",\n \"SourceSchema\": \"/\",\n \"SourceTable\": \"/\"\n}\n ]\n}\n\n",
"Status": "creating",
"ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:OEAMB3NXSTZ6LFYZFEPPBBXPYM",
"ReplicationTaskCreationDate": 1457658407.492,
"MigrationType": "full-load",
"TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:ASXWXJZLNWNT5HTWCGV2BUJQ7E",
"ReplicationTaskSettings": "{\"TargetMetadata\":{\"TargetSchema\":\"\",\"SupportLobs\":true,\"FullLobMode\":true,\"LobChunkSize\":64,\"LimitedSizeLobMode\":false,\"LobMaxSize\":0},\"FullLoadSettings\":{\"FullLoadEnabled\":true,\"ApplyChangesEnabled\":false,\"TargetTablePrepMode\":\"DROP_AND_CREATE\",\"CreatePkAfterFullLoad\":false,\"StopTaskCachedChangesApplied\":false,\"StopTaskCachedChangesNotApplied\":false,\"ResumeEnabled\":false,\"ResumeMinTableSize\":100000,\"ResumeOnlyClusteredPKTables\":true,\"MaxFullLoadSubTasks\":8,\"TransactionConsistencyTimeout\":600,\"CommitRate\":10000},\"Logging\":{\"EnableLogging\":false}}"
}
}
17 changes: 17 additions & 0 deletions awscli/examples/dms/describe-connections.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
The following command describes connections for an endpoint specified by ARN::

aws dms describe-connections --filters Name="endpoint-arn",Values="arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE"

Output::

{
"Connections": [
{
"Status": "successful",
"ReplicationInstanceIdentifier": "test",
"EndpointArn": "arn:aws:dms:us-east-arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE",
"EndpointIdentifier": "testsrc1",
"ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ"
}
]
}
31 changes: 31 additions & 0 deletions awscli/examples/dms/describe-endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
The following command describes source endpoints in your account::

aws dms describe-endpoints --filters Name="endpoint-type",Values="source"

Output::

{
"Endpoints": [{
"Username": "dms",
"Status": "active",
"EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:SF2WOFLWYWKVEOHID2EKLP3SJI",
"ServerName": "ec2-52-32-48-61.us-west-2.compute.amazonaws.com",
"EndpointType": "SOURCE",
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/94d5c4e7-4e4c-44be-b58a-c8da7adf57cd",
"DatabaseName": "test",
"EngineName": "mysql",
"EndpointIdentifier": "pri100",
"Port": 8193
}, {
"Username": "admin",
"Status": "active",
"EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:TJJZCIH3CJ24TJRU4VC32WEWFR",
"ServerName": "test.example.com",
"EndpointType": "SOURCE",
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/2431021b-1cf2-a2d4-77b2-59a9e4bce323",
"DatabaseName": "EMPL",
"EngineName": "oracle",
"EndpointIdentifier": "test",
"Port": 1521
}]
}
23 changes: 23 additions & 0 deletions awscli/topics/config-vars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,29 @@ Example configuration::
Service Specific Configuration
==============================

API Versions
------------

The API version to use for a service can be set using the ``api_versions``
key. To specify an API version, set the API version to the name of the service
as a sub value for ``api_versions``.

Example configuration::

[profile development]
aws_access_key_id=foo
aws_secret_access_key=bar
api_versions =
ec2 = 2015-03-01
cloudfront = 2015-09-17

By setting an API version for a service, it ensures that the interface for
that service's commands is representative of the specified API version.

In the example configuration, the ``ec2`` CLI commands will be representative
of Amazon EC2's ``2015-03-01`` API version and the ``cloudfront`` CLI commands
will be representative of Amazon CloudFront's ``2015-09-17`` API version.


aws s3
------
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# The short X.Y version.
version = '1.10.'
# The full version, including alpha/beta/rc tags.
release = '1.10.13'
release = '1.10.14'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ universal = 1

[metadata]
requires-dist =
botocore==1.4.4
botocore==1.4.5
colorama>=0.2.5,<=0.3.3
docutils>=0.10
rsa>=3.1.2,<=3.3.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import awscli


requires = ['botocore==1.4.4',
requires = ['botocore==1.4.5',
'colorama>=0.2.5,<=0.3.3',
'docutils>=0.10',
'rsa>=3.1.2,<=3.3.0',
Expand Down
39 changes: 39 additions & 0 deletions tests/functional/s3/test_cp_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,45 @@ def test_cp_fails_with_utime_errors_but_continues(self):
_, err, _ = self.run_cmd(cmdline, expected_rc=1)
self.assertIn('attempting to modify the utime', err)

def test_recursive_glacier_download_with_force_glacier(self):
self.parsed_responses = [
{
'Contents': [
{'Key': 'foo/bar.txt', 'ContentLength': '100',
'LastModified': '00:00:00Z',
'StorageClass': 'GLACIER',
'Size': 100},
],
'CommonPrefixes': []
},
{'ETag': '"foo-1"', 'Body': six.BytesIO(b'foo')},
]
cmdline = '%s s3://bucket/foo %s --recursive --force-glacier-transfer'\
% (self.prefix, self.files.rootdir)
self.run_cmd(cmdline, expected_rc=0)
self.assertEqual(len(self.operations_called), 2, self.operations_called)
self.assertEqual(self.operations_called[0][0].name, 'ListObjects')
self.assertEqual(self.operations_called[1][0].name, 'GetObject')

def test_recursive_glacier_download_without_force_glacier(self):
self.parsed_responses = [
{
'Contents': [
{'Key': 'foo/bar.txt', 'ContentLength': '100',
'LastModified': '00:00:00Z',
'StorageClass': 'GLACIER',
'Size': 100},
],
'CommonPrefixes': []
}
]
cmdline = '%s s3://bucket/foo %s --recursive' % (
self.prefix, self.files.rootdir)
_, stderr, _ = self.run_cmd(cmdline, expected_rc=2)
self.assertEqual(len(self.operations_called), 1, self.operations_called)
self.assertEqual(self.operations_called[0][0].name, 'ListObjects')
self.assertIn('GLACIER', stderr)

def test_warns_on_glacier_incompatible_operation(self):
self.parsed_responses = [
{'ContentLength': '100', 'LastModified': '00:00:00Z',
Expand Down
Loading

0 comments on commit d3f9f89

Please sign in to comment.