diff --git a/awscli/customizations/s3/subcommands.py b/awscli/customizations/s3/subcommands.py index 9e3692d979bb..06422d6c2004 100644 --- a/awscli/customizations/s3/subcommands.py +++ b/awscli/customizations/s3/subcommands.py @@ -249,11 +249,11 @@ STORAGE_CLASS = {'name': 'storage-class', 'choices': ['STANDARD', 'REDUCED_REDUNDANCY', 'STANDARD_IA', - 'ONEZONE_IA'], + 'ONEZONE_IA', 'INTELLIGENT_TIERING'], 'help_text': ( "The type of storage to use for the object. " "Valid choices are: STANDARD | REDUCED_REDUNDANCY " - "| STANDARD_IA | ONEZONE_IA. " + "| STANDARD_IA | ONEZONE_IA | INTELLIGENT_TIERING. " "Defaults to 'STANDARD'")} diff --git a/tests/functional/s3/test_cp_command.py b/tests/functional/s3/test_cp_command.py index 644fe51b69b4..eadff9641c54 100644 --- a/tests/functional/s3/test_cp_command.py +++ b/tests/functional/s3/test_cp_command.py @@ -99,6 +99,21 @@ def test_upload_expires(self): self.assertEqual(self.operations_called[0][1]['Bucket'], 'bucket') self.assertEqual(self.operations_called[0][1]['Expires'], '90') + def test_upload_standard_ia(self): + full_path = self.files.create_file('foo.txt', 'mycontent') + cmdline = ('%s %s s3://bucket/key.txt --storage-class STANDARD_IA' % + (self.prefix, full_path)) + self.parsed_responses = \ + [{'ETag': '"c8afdb36c52cf4727836669019e69222"'}] + self.run_cmd(cmdline, expected_rc=0) + self.assertEqual(len(self.operations_called), 1, + self.operations_called) + self.assertEqual(self.operations_called[0][0].name, 'PutObject') + args = self.operations_called[0][1] + self.assertEqual(args['Key'], 'key.txt') + self.assertEqual(args['Bucket'], 'bucket') + self.assertEqual(args['StorageClass'], 'STANDARD_IA') + def test_upload_onezone_ia(self): full_path = self.files.create_file('foo.txt', 'mycontent') cmdline = ('%s %s s3://bucket/key.txt --storage-class ONEZONE_IA' % @@ -114,6 +129,21 @@ def test_upload_onezone_ia(self): self.assertEqual(args['Bucket'], 'bucket') self.assertEqual(args['StorageClass'], 'ONEZONE_IA') + def test_upload_intelligent_tiering(self): + full_path = self.files.create_file('foo.txt', 'mycontent') + cmdline = ('%s %s s3://bucket/key.txt --storage-class INTELLIGENT_TIERING' % + (self.prefix, full_path)) + self.parsed_responses = \ + [{'ETag': '"c8afdb36c52cf4727836669019e69222"'}] + self.run_cmd(cmdline, expected_rc=0) + self.assertEqual(len(self.operations_called), 1, + self.operations_called) + self.assertEqual(self.operations_called[0][0].name, 'PutObject') + args = self.operations_called[0][1] + self.assertEqual(args['Key'], 'key.txt') + self.assertEqual(args['Bucket'], 'bucket') + self.assertEqual(args['StorageClass'], 'INTELLIGENT_TIERING') + def test_operations_used_in_download_file(self): self.parsed_responses = [ {"ContentLength": "100", "LastModified": "00:00:00Z"},