diff --git a/check_metadata.py b/check_metadata.py index a0ee31737c3..e7bc45358fd 100644 --- a/check_metadata.py +++ b/check_metadata.py @@ -1,40 +1,60 @@ +# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# This file is licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. A copy of the +# License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +# OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +# +# This script is used to validate metadata in the awsdocs/aws-doc-sdk-examples/ repository on Github. +# + import os, fnmatch, sys -def checkFile(directory, filePattern, warn, quiet): - filecount = 0; - for path, dirs, files in os.walk(os.path.abspath(directory)): +def checkFile(filePattern): + filepath = "" + filecount = 0 + for path, dirs, files in os.walk(os.path.abspath(root)): for filename in fnmatch.filter(files, filePattern): # Ignore this file if filename == sys.argv[0]: continue - wordcount = 0; + if filename in doNotScan: + if not quiet: + print("\nFile: " + filepath + ' is skipped') + continue + wordcount = 0 filecount += 1 errors = [] filepath = os.path.join(path, filename) - if quiet == False: + if not quiet: print("\nChecking File: " + filepath) with open(filepath) as f: s = f.read() words = s.split() for word in words: - checkStringLength(word, warn) - wordcount +=1; + checkStringLength(word) + wordcount +=1 # Check for mismatched Snippet start and end. snippets = s.split('snippet-') # Check Metadata for optional metadata errors.append(snippetStartCheck(words, filepath)) - errors.append(snippetAuthorCheck(snippets, warn)) - errors.append(snippetServiceCheck(snippets, warn)) - errors.append(snippetDescriptionCheck(snippets, warn)) - errors.append(snippetTypeCheck(snippets, warn)) - errors.append(snippetDateCheck(snippets, warn)) - errors.append(snippetKeywordCheck(snippets, warn)) + errors.append(snippetAuthorCheck(snippets)) + errors.append(snippetServiceCheck(snippets)) + errors.append(snippetDescriptionCheck(snippets)) + errors.append(snippetTypeCheck(snippets)) + errors.append(snippetDateCheck(snippets)) + errors.append(snippetKeywordCheck(snippets)) f.close() - if quiet == False: + if not quiet: print(str(wordcount) + " words found.") - if warn == True: + if warn: # Filter to only warning messages errors = list(filter(None, errors)) # print out file name, if warnings found @@ -43,14 +63,14 @@ def checkFile(directory, filePattern, warn, quiet): for error in errors: if error: print(error) - print(str(filecount) + " files scanned in " + directory) + print(str(filecount) + " files scanned in " + root) print("") -def checkStringLength (word, warn): +def checkStringLength (word): length = len(word) if length == 40 or length == 20: - if warn == True: + if warn: return "WARNING -- " + word + " is " + str(length) + " characters long" @@ -58,56 +78,50 @@ def snippetStartCheck(words, filelocation): #print (words) snippetStart = 'snippet-start:[' snippetEnd = 'snippet-end:[' - if any(snippetStart in word for word in words) : - matching = [s for s in words if snippetStart in s] - Endmatching = [s for s in words if snippetEnd in s] - #print(matching) - snippettags = [] - for string in Endmatching: - snippettags += string.split(snippetEnd) - if '//' in snippettags: snippettags.remove('//') - if '#' in snippettags: snippettags.remove('#') - #print(snippettags) - #print(Endmatching) - for string in matching: - match = False - for end in snippettags: - if string.endswith(end): - match = True - #return "True: "+ string + " has matching end tag." ) - if match == False: + snippetTags = set() + for s in words: + if snippetStart in s: + s = s.split('[')[1] + snippetTags.add(s) + elif snippetEnd in s: + s = s.split('[')[1] + if s in snippetTags: + snippetTags.remove(s) + else: print("ERROR -- Found in " + filelocation) - sys.exit("ERROR -- " + string + "'s matching end tag not found.") - else: - #return "WARNING -- Snippet Start not detected" - return False + sys.exit("ERROR -- " + s + "'s matching start tag not found.") + + if len(snippetTags) > 0 : + print("ERROR -- Found in " + filelocation) + print(snippetTags) + sys.exit("ERROR -- " + snippetTags.pop() + "'s matching end tag not found.") -def snippetAuthorCheck(words, warn): +def snippetAuthorCheck(words): author = 'sourceauthor:[' matching = [s for s in words if author in s] - if matching == []: - if warn == True: + if not matching: + if warn: return "WARNING -- Missing snippet-sourceauthor:[Your Name]" -def snippetServiceCheck(words, warn): +def snippetServiceCheck(words): service = 'service:[' matching = [s for s in words if service in s] - if matching == []: - if warn == True: + if not matching: + if warn: return "WARNING -- Missing snippet-service:[AWS service name] \nFind a list of AWS service names under AWS Service Namespaces in the General Reference Guide: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html" -def snippetDescriptionCheck(words, warn): +def snippetDescriptionCheck(words): desc = 'sourcedescription:[' matching = [s for s in words if desc in s] - if matching == []: - if warn == True: + if not matching: + if warn: return "WARNING -- Missing snippet-sourcedescription:[Filename demonstrates how to ... ]" -def snippetTypeCheck(words, warn): +def snippetTypeCheck(words): author = 'sourcetype:[' matching = [s for s in words if author in s] containsType = False - if matching == []: + if not matching: containsType = False for match in matching: if match.startswith('sourcetype:[full-example'): @@ -117,75 +131,75 @@ def snippetTypeCheck(words, warn): containsType = True break if not containsType: - if warn == True: + if warn: return "WARNING -- Missing snippet-sourcetype:[full-example] or snippet-sourcetype:[snippet]" -def snippetDateCheck(words, warn): +def snippetDateCheck(words): datetag = 'sourcedate:[' matching = [s for s in words if datetag in s] - if matching == []: - if warn == True: + if not matching: + if warn: return "WARNING -- Missing snippet-sourcedate:[YYYY-MM-DD]" -def snippetKeywordCheck(words, warn): +def snippetKeywordCheck(words): snippetkeyword = 'keyword:[' matching = [s for s in words if snippetkeyword in s] # print(matching) codeSample = [s for s in words if 'keyword:[Code Sample]\n' in s] if not codeSample: - if warn == True: + if warn: return "WARNING -- Missing snippet-keyword:[Code Sample]" - keywordServiceName(matching, warn) - keywordLanguageCheck(matching, warn) - keywordSDKCheck(matching, warn) + keywordServiceName(matching) + keywordLanguageCheck(matching) + keywordSDKCheck(matching) -def keywordServiceName(words, warn): - containsServiceTag = False; +def keywordServiceName(words): + containsServiceTag = False AWS = 'keyword:[AWS' matching = [s for s in words if AWS in s] if matching: - containsServiceTag = True; + containsServiceTag = True Amazon = 'keyword:[Amazon' matching = [s for s in words if Amazon in s] if matching: - containsServiceTag = True; + containsServiceTag = True if not containsServiceTag: - if warn == True: + if warn: return "WARNING -- Missing snippet-keyword:[FULL SERVICE NAME]" -def keywordLanguageCheck(words, warn): +def keywordLanguageCheck(words): languages = ['C++', 'C', '.NET', 'Go', 'Java', 'JavaScript', 'PHP', 'Python', 'Ruby','TypeScript' ] - containsLanguageTag = False; + containsLanguageTag = False for language in languages: languagekeyword = [s for s in words if 'keyword:[' + language + ']' in s] if languagekeyword: - containsLanguageTag = True; + containsLanguageTag = True break - if containsLanguageTag == False: - if warn == True: + if not containsLanguageTag: + if warn: return "WARNING -- Missing snippet-keyword:[Language] \nOptions include:" + ', '.join(languages) -def keywordSDKCheck(words, warn): +def keywordSDKCheck(words): sdkVersions = ['AWS SDK for PHP v3', 'AWS SDK for Python (Boto3)', 'CDK V0.14.1' ] - containsSDKTag = False; + containsSDKTag = False for sdk in sdkVersions: sdkkeyword = [s for s in words if 'keyword:[' + sdk + ']'] if sdkkeyword: - containsSDKTag = True; + containsSDKTag = True break - if containsSDKTag == False: - if warn == True: + if not containsSDKTag: + if warn: return "WARNING -- Missing snippet-keyword:[SDK Version used] \nOptions include:" + ', '.join(sdkVersions) # We allow two args: # -w to suppress warnings # -q to suppress name of file we are parsing (quiet mode) -warn = True; -quiet = False; +warn = True +quiet = False -i = 0; +i = 0 while i < len(sys.argv): if sys.argv[i] == "-w": @@ -194,22 +208,29 @@ def keywordSDKCheck(words, warn): quiet = True i += 1 +# Whitelist of files to never check +# +doNotScan = {'AssemblyInfo.cs', 'CMakeLists.txt', 'check_metadata.py'} +root = './' + print ('----------\n\nRun Tests\n') print ('----------\n\nC++ Code Examples(*.cpp)\n') -checkFile( './', '*.cpp', warn, quiet) +checkFile('*.cpp') print ('----------\n\nC# Code Examples (*.cs)\n') -checkFile( './', '*.cs', warn, quiet) +checkFile('*.cs') +# checkFile( './', '*.txt', warn, quiet, doNotScan) print ('----------\n\nGo Code Examples (*.go)\n') -checkFile( './', '*.go', warn, quiet) +checkFile('*.go') print ('----------\n\nJava Code Examples (*.java)\n') -checkFile( './', '*.java', warn, quiet) +checkFile('*.java') print ('----------\n\nJavaScript Code Examples (*.js)\n') -checkFile( './', '*.js', warn, quiet) +checkFile('*.js') +checkFile('*.html') print ('----------\n\nPHP Code Examples (*.php)\n') -checkFile( './', '*.php', warn, quiet) +checkFile('*.php') print ('----------\n\nPython Code Examples (*.py)\n') -checkFile( './', '*.py', warn, quiet) +checkFile('*.py') print ('----------\n\nRuby Code Examples (*.rb)\n') -checkFile( './', '*.rb', warn, quiet) +checkFile('*.rb') print ('----------\n\nTypeScript Code Examples (*.ts)\n') -checkFile( './', '*.ts', warn, quiet) +checkFile('*.ts') diff --git a/cpp/example_code/s3/s3-demo.cpp b/cpp/example_code/s3/s3-demo.cpp new file mode 100644 index 00000000000..72bb145afac --- /dev/null +++ b/cpp/example_code/s3/s3-demo.cpp @@ -0,0 +1,197 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[s3-demo.cpp demonstrates how to list, create, and delete a bucket in Amazon S3.] +// snippet-service:[s3] +// snippet-keyword:[C++] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ListBuckets] +// snippet-keyword:[CreateBucket] +// snippet-keyword:[DeleteBucket] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-01-11] +// snippet-sourceauthor:[AWS] +// snippet-start:[s3.cpp.bucket_operations.list_create_delete] +#include +#include +#include +#include +#include +#include +#include + +bool ListMyBuckets(Aws::S3::S3Client s3_client); +bool CreateMyBucket(Aws::S3::S3Client s3_client, Aws::String bucket_name, + Aws::S3::Model::BucketLocationConstraint region); +bool DeleteMyBucket(Aws::S3::S3Client s3_client, Aws::String bucket_name); +void Cleanup(Aws::SDKOptions options); + +int main(int argc, char** argv) { + + if (argc < 3) { + std::cout << "Usage: ./s3-demo " << std::endl + << "Example: ./s3-demo my-test-bucket us-west-1" << std::endl; + return false; + } + + Aws::String bucket_name = argv[1]; + Aws::Client::ClientConfiguration client_configuration; + Aws::S3::Model::BucketLocationConstraint region; + + // Set the AWS Region to use, based on the user's AWS Region input ID. + if (strcmp(argv[2], "ap-northeast-1") == 0) { + client_configuration.region = Aws::Region::AP_NORTHEAST_1; + region = Aws::S3::Model::BucketLocationConstraint::ap_northeast_1; + } else if (strcmp(argv[2], "ap-northeast-2") == 0) { + client_configuration.region = Aws::Region::AP_NORTHEAST_2; + region = Aws::S3::Model::BucketLocationConstraint::ap_northeast_2; + } else if (strcmp(argv[2], "ap-south-1") == 0) { + client_configuration.region = Aws::Region::AP_SOUTH_1; + region = Aws::S3::Model::BucketLocationConstraint::ap_south_1; + } else if (strcmp(argv[2], "ap-southeast-1") == 0) { + client_configuration.region = Aws::Region::AP_SOUTHEAST_1; + region = Aws::S3::Model::BucketLocationConstraint::ap_southeast_1; + } else if (strcmp(argv[2], "ap-southeast-2") == 0) { + client_configuration.region = Aws::Region::AP_SOUTHEAST_2; + region = Aws::S3::Model::BucketLocationConstraint::ap_southeast_2; + } else if (strcmp(argv[2], "cn-north-1") == 0) { + client_configuration.region = Aws::Region::CN_NORTH_1; + region = Aws::S3::Model::BucketLocationConstraint::cn_north_1; + } else if (strcmp(argv[2], "eu-central-1") == 0) { + client_configuration.region = Aws::Region::EU_CENTRAL_1; + region = Aws::S3::Model::BucketLocationConstraint::eu_central_1; + } else if (strcmp(argv[2], "eu-west-1") == 0) { + client_configuration.region = Aws::Region::EU_WEST_1; + region = Aws::S3::Model::BucketLocationConstraint::eu_west_1; + } else if (strcmp(argv[2], "sa-east-1") == 0) { + client_configuration.region = Aws::Region::SA_EAST_1; + region = Aws::S3::Model::BucketLocationConstraint::sa_east_1; + } else if (strcmp(argv[2], "us-west-1") == 0) { + client_configuration.region = Aws::Region::US_WEST_1; + region = Aws::S3::Model::BucketLocationConstraint::us_west_1; + } else if (strcmp(argv[2], "us-west-2") == 0) { + client_configuration.region = Aws::Region::US_WEST_2; + region = Aws::S3::Model::BucketLocationConstraint::us_west_2; + } else { + std::cout << "Unrecognized AWS Region ID '" << argv[2] << "'" << std::endl; + return false; + } + + Aws::SDKOptions options; + + Aws::InitAPI(options); + { + Aws::S3::S3Client s3_client(client_configuration); + + if (!ListMyBuckets(s3_client)) { + Cleanup(options); + } + + if (!CreateMyBucket(s3_client, bucket_name, region)) { + Cleanup(options); + } + + if (!ListMyBuckets(s3_client)) { + Cleanup(options); + } + + if (!DeleteMyBucket(s3_client, bucket_name)) { + Cleanup(options); + } + + if (!ListMyBuckets(s3_client)) { + Cleanup(options); + } + } + Cleanup(options); +} + +// List all of your available buckets. +bool ListMyBuckets(Aws::S3::S3Client s3_client) { + auto outcome = s3_client.ListBuckets(); + + if (outcome.IsSuccess()) { + std::cout << "My buckets now are:" << std::endl << std::endl; + + Aws::Vector bucket_list = + outcome.GetResult().GetBuckets(); + + for (auto const &bucket: bucket_list) { + std::cout << bucket.GetName() << std::endl; + } + + std::cout << std::endl; + return true; + } else { + std::cout << "ListBuckets error: " + << outcome.GetError().GetExceptionName() << std::endl + << outcome.GetError().GetMessage() << std::endl; + + return false; + } +} + +// Create a bucket in this AWS Region. +bool CreateMyBucket(Aws::S3::S3Client s3_client, Aws::String bucket_name, + Aws::S3::Model::BucketLocationConstraint region) { + std::cout << "Creating a new bucket named '" + << bucket_name + << "'..." << std::endl << std::endl; + + Aws::S3::Model::CreateBucketConfiguration bucket_configuration; + bucket_configuration.WithLocationConstraint(region); + + Aws::S3::Model::CreateBucketRequest bucket_request; + bucket_request.WithBucket(bucket_name).WithCreateBucketConfiguration(bucket_configuration); + + auto outcome = s3_client.CreateBucket(bucket_request); + + if (outcome.IsSuccess()) { + return true; + } else { + std::cout << "CreateBucket error: " + << outcome.GetError().GetExceptionName() << std::endl + << outcome.GetError().GetMessage() << std::endl; + + return false; + } +} + +// Delete the bucket you just created. +bool DeleteMyBucket(Aws::S3::S3Client s3_client, Aws::String bucket_name) { + std::cout << "Deleting the bucket named '" + << bucket_name + << "'..." << std::endl << std::endl; + + Aws::S3::Model::DeleteBucketRequest bucket_request; + bucket_request.WithBucket(bucket_name); + + auto outcome = s3_client.DeleteBucket(bucket_request); + + if (outcome.IsSuccess()) { + return true; + } else { + std::cout << "DeleteBucket error: " + << outcome.GetError().GetExceptionName() << std::endl + << outcome.GetError().GetMessage() << std::endl; + + return false; + } +} + +void Cleanup(Aws::SDKOptions options) { + Aws::ShutdownAPI(options); +} +// snippet-end:[s3.cpp.bucket_operations.list_create_delete] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/CreateTablesLoadData.cs b/dotnet/example_code/DynamoDB/CreateTablesLoadData.cs index 8813d7d2db6..54a3e7bfd0b 100644 --- a/dotnet/example_code/DynamoDB/CreateTablesLoadData.cs +++ b/dotnet/example_code/DynamoDB/CreateTablesLoadData.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[CreateTablesLoadData.cs demonstrates how to ] +// snippet-sourcedescription:[CreateTablesLoadData.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.CreateTablesLoadData] +// snippet-start:[dynamodb.dotNET.CodeExample.CreateTablesLoadData] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/00b_DDB_Attributes.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/00b_DDB_Attributes.cs index ced53dce285..1bdb46fe6ff 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/00b_DDB_Attributes.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/00b_DDB_Attributes.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[00b_DDB_Attributes.cs demonstrates how to ] +// snippet-sourcedescription:[00b_DDB_Attributes.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.00b_DDB_Attributes] +// snippet-start:[dynamodb.dotNET.CodeExample.00b_DDB_Attributes] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/01_CreateClient.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/01_CreateClient.cs index b9557dbe96f..0feab14338c 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/01_CreateClient.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/01_CreateClient.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[01_CreateClient.cs demonstrates how to ] +// snippet-sourcedescription:[01_CreateClient.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.01_CreateClient] +// snippet-start:[dynamodb.dotNET.CodeExample.01_CreateClient] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/02_CreatingTable.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/02_CreatingTable.cs index 947df9a8268..949c4e88727 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/02_CreatingTable.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/02_CreatingTable.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[02_CreatingTable.cs demonstrates how to ] +// snippet-sourcedescription:[02_CreatingTable.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.02_CreatingTable] +// snippet-start:[dynamodb.dotNET.CodeExample.02_CreatingTable] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/03_LoadingData.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/03_LoadingData.cs index db6cd7b1add..5f8a1463fbb 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/03_LoadingData.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/03_LoadingData.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[03_LoadingData.cs demonstrates how to ] +// snippet-sourcedescription:[03_LoadingData.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.03_LoadingData] +// snippet-start:[dynamodb.dotNET.CodeExample.03_LoadingData] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/04_WritingNewItem.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/04_WritingNewItem.cs index 35751071c6a..1760839aaed 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/04_WritingNewItem.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/04_WritingNewItem.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[04_WritingNewItem.cs demonstrates how to ] +// snippet-sourcedescription:[04_WritingNewItem.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.04_WritingNewItem] +// snippet-start:[dynamodb.dotNET.CodeExample.04_WritingNewItem] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/05_ReadingItem.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/05_ReadingItem.cs index 62756f31de0..8fe4b40160d 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/05_ReadingItem.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/05_ReadingItem.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[05_ReadingItem.cs demonstrates how to ] +// snippet-sourcedescription:[05_ReadingItem.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.05_ReadingItem] +// snippet-start:[dynamodb.dotNET.CodeExample.05_ReadingItem] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/06_UpdatingItem.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/06_UpdatingItem.cs index fa62a6ba2fc..cd199e2d121 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/06_UpdatingItem.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/06_UpdatingItem.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[06_UpdatingItem.cs demonstrates how to ] +// snippet-sourcedescription:[06_UpdatingItem.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.06_UpdatingItem] +// snippet-start:[dynamodb.dotNET.CodeExample.06_UpdatingItem] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/07_DeletingItem.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/07_DeletingItem.cs index f4fba490362..4cb521f3c5e 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/07_DeletingItem.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/07_DeletingItem.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[07_DeletingItem.cs demonstrates how to ] +// snippet-sourcedescription:[07_DeletingItem.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.07_DeletingItem] +// snippet-start:[dynamodb.dotNET.CodeExample.07_DeletingItem] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/08_Querying.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/08_Querying.cs index a41070fc68c..d041093c99c 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/08_Querying.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/08_Querying.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[08_Querying.cs demonstrates how to ] +// snippet-sourcedescription:[08_Querying.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.08_Querying] +// snippet-start:[dynamodb.dotNET.CodeExample.08_Querying] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/09_Scanning.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/09_Scanning.cs index ba2dc538005..eb5ccece07b 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/09_Scanning.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/09_Scanning.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[09_Scanning.cs demonstrates how to ] +// snippet-sourcedescription:[09_Scanning.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.09_Scanning] +// snippet-start:[dynamodb.dotNET.CodeExample.09_Scanning] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/10_DeletingTable.cs b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/10_DeletingTable.cs index d5024d98661..152e1ae7396 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/10_DeletingTable.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/DynamoDB_intro/DynamoDB_intro/10_DeletingTable.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[10_DeletingTable.cs demonstrates how to ] +// snippet-sourcedescription:[10_DeletingTable.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.10_DeletingTable] +// snippet-start:[dynamodb.dotNET.CodeExample.10_DeletingTable] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/DeleteItem/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/DeleteItem/Program.cs index 600e49c67a4..b3d3a3df71f 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/DeleteItem/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/DeleteItem/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.DeleteItem] +// snippet-start:[dynamodb.dotNET.CodeExample.DeleteItem] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/DeleteTable/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/DeleteTable/Program.cs index 1e094ab2713..9269e483838 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/DeleteTable/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/DeleteTable/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.DeleteTable] +// snippet-start:[dynamodb.dotNET.CodeExample.DeleteTable] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/LoadJsonMovieData/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/LoadJsonMovieData/Program.cs index fdadc1894e4..6e2fcb7db21 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/LoadJsonMovieData/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/LoadJsonMovieData/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LoadJsonMovieData] +// snippet-start:[dynamodb.dotNET.CodeExample.LoadJsonMovieData] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/MoviesCreateTable/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/MoviesCreateTable/Program.cs index 6a2e97884c5..75516fafc2e 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/MoviesCreateTable/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/MoviesCreateTable/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.MoviesCreateTable] +// snippet-start:[dynamodb.dotNET.CodeExample.MoviesCreateTable] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/PutItem_A/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/PutItem_A/Program.cs index cbdc8d546ec..0938bc7c679 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/PutItem_A/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/PutItem_A/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.PutItem_A] +// snippet-start:[dynamodb.dotNET.CodeExample.PutItem_A] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/PutItem_B/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/PutItem_B/Program.cs index e919485b2bd..65afb568fb6 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/PutItem_B/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/PutItem_B/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.PutItem_B] +// snippet-start:[dynamodb.dotNET.CodeExample.PutItem_B] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/Query/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/Query/Program.cs index d7a25c460b7..ff1b6f2fa1a 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/Query/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/Query/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.Query] +// snippet-start:[dynamodb.dotNET.CodeExample.Query] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/Scan/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/Scan/Program.cs index 7ef15238dfe..0e879a6a155 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/Scan/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/Scan/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.Scan] +// snippet-start:[dynamodb.dotNET.CodeExample.Scan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_A/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_A/Program.cs index 9488b53bf4c..4b13bf9f329 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_A/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_A/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.UpdateItem_A] +// snippet-start:[dynamodb.dotNET.CodeExample.UpdateItem_A] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_B/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_B/Program.cs index bd39566fe79..5287b566eb9 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_B/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_B/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.UpdateItem_B] +// snippet-start:[dynamodb.dotNET.CodeExample.UpdateItem_B] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_C/Program.cs b/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_C/Program.cs index ad0d475ef14..e1532b1e941 100644 --- a/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_C/Program.cs +++ b/dotnet/example_code/DynamoDB/GettingStarted/old/UpdateItem_C/Program.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[Program.cs demonstrates how to ] +// snippet-sourcedescription:[Program.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.UpdateItem_C] +// snippet-start:[dynamodb.dotNET.CodeExample.UpdateItem_C] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/HighLevelBatchWriteItem.cs b/dotnet/example_code/DynamoDB/HighLevelBatchWriteItem.cs index d1938372904..ebc72303bde 100644 --- a/dotnet/example_code/DynamoDB/HighLevelBatchWriteItem.cs +++ b/dotnet/example_code/DynamoDB/HighLevelBatchWriteItem.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[HighLevelBatchWriteItem.cs demonstrates how to ] +// snippet-sourcedescription:[HighLevelBatchWriteItem.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.HighLevelBatchWriteItem] +// snippet-start:[dynamodb.dotNET.CodeExample.HighLevelBatchWriteItem] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/HighLevelItemCRUD.cs b/dotnet/example_code/DynamoDB/HighLevelItemCRUD.cs index 62f557bbe52..dedbd0f9560 100644 --- a/dotnet/example_code/DynamoDB/HighLevelItemCRUD.cs +++ b/dotnet/example_code/DynamoDB/HighLevelItemCRUD.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[HighLevelItemCRUD.cs demonstrates how to ] +// snippet-sourcedescription:[HighLevelItemCRUD.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.HighLevelItemCRUD] +// snippet-start:[dynamodb.dotNET.CodeExample.HighLevelItemCRUD] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/HighLevelMappingArbitraryData.cs b/dotnet/example_code/DynamoDB/HighLevelMappingArbitraryData.cs index 1fdb32bc071..1d2bd073c3c 100644 --- a/dotnet/example_code/DynamoDB/HighLevelMappingArbitraryData.cs +++ b/dotnet/example_code/DynamoDB/HighLevelMappingArbitraryData.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[HighLevelMappingArbitraryData.cs demonstrates how to ] +// snippet-sourcedescription:[HighLevelMappingArbitraryData.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.HighLevelMappingArbitraryData] +// snippet-start:[dynamodb.dotNET.CodeExample.HighLevelMappingArbitraryData] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/HighLevelQueryAndScan.cs b/dotnet/example_code/DynamoDB/HighLevelQueryAndScan.cs index 8c7ea49a995..9e31ffd7be8 100644 --- a/dotnet/example_code/DynamoDB/HighLevelQueryAndScan.cs +++ b/dotnet/example_code/DynamoDB/HighLevelQueryAndScan.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[HighLevelQueryAndScan.cs demonstrates how to ] +// snippet-sourcedescription:[HighLevelQueryAndScan.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.HighLevelQueryAndScan] +// snippet-start:[dynamodb.dotNET.CodeExample.HighLevelQueryAndScan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/LowLevelBatchGet.cs b/dotnet/example_code/DynamoDB/LowLevelBatchGet.cs index 0c067e614e4..3a24b724d2f 100644 --- a/dotnet/example_code/DynamoDB/LowLevelBatchGet.cs +++ b/dotnet/example_code/DynamoDB/LowLevelBatchGet.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelBatchGet.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelBatchGet.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelBatchGet] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelBatchGet] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/LowLevelBatchWrite.cs b/dotnet/example_code/DynamoDB/LowLevelBatchWrite.cs index 1bafeb29ce8..6a5ea5a04de 100644 --- a/dotnet/example_code/DynamoDB/LowLevelBatchWrite.cs +++ b/dotnet/example_code/DynamoDB/LowLevelBatchWrite.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelBatchWrite.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelBatchWrite.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelBatchWrite] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelBatchWrite] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/LowLevelGlobalSecondaryIndexExample.cs b/dotnet/example_code/DynamoDB/LowLevelGlobalSecondaryIndexExample.cs index 419a5336cec..a9b592da3eb 100644 --- a/dotnet/example_code/DynamoDB/LowLevelGlobalSecondaryIndexExample.cs +++ b/dotnet/example_code/DynamoDB/LowLevelGlobalSecondaryIndexExample.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelGlobalSecondaryIndexExample.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelGlobalSecondaryIndexExample.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelGlobalSecondaryIndexExample] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelGlobalSecondaryIndexExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -22,19 +22,19 @@ * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -using System; -using System.Collections.Generic; -using System.Linq; -using Amazon.DynamoDBv2; -using Amazon.DynamoDBv2.DataModel; -using Amazon.DynamoDBv2.DocumentModel; -using Amazon.DynamoDBv2.Model; -using Amazon.Runtime; -using Amazon.SecurityToken; - -namespace com.amazonaws.codesamples -{ - class LowLevelGlobalSecondaryIndexExample +using System; +using System.Collections.Generic; +using System.Linq; +using Amazon.DynamoDBv2; +using Amazon.DynamoDBv2.DataModel; +using Amazon.DynamoDBv2.DocumentModel; +using Amazon.DynamoDBv2.Model; +using Amazon.Runtime; +using Amazon.SecurityToken; + +namespace com.amazonaws.codesamples +{ + class LowLevelGlobalSecondaryIndexExample { private static AmazonDynamoDBClient client = new AmazonDynamoDBClient(); public static String tableName = "Issues"; @@ -57,36 +57,36 @@ public static void Main(string[] args) private static void CreateTable() { // Attribute definitions - var attributeDefinitions = new List() - { - {new AttributeDefinition { - AttributeName = "IssueId", AttributeType = "S" - }}, - {new AttributeDefinition { - AttributeName = "Title", AttributeType = "S" - }}, - {new AttributeDefinition { - AttributeName = "CreateDate", AttributeType = "S" - }}, - {new AttributeDefinition { - AttributeName = "DueDate", AttributeType = "S" - }} + var attributeDefinitions = new List() + { + {new AttributeDefinition { + AttributeName = "IssueId", AttributeType = "S" + }}, + {new AttributeDefinition { + AttributeName = "Title", AttributeType = "S" + }}, + {new AttributeDefinition { + AttributeName = "CreateDate", AttributeType = "S" + }}, + {new AttributeDefinition { + AttributeName = "DueDate", AttributeType = "S" + }} }; // Key schema for table - var tableKeySchema = new List() { - { - new KeySchemaElement { - AttributeName= "IssueId", - KeyType = "HASH" //Partition key - } - }, - { - new KeySchemaElement { - AttributeName = "Title", - KeyType = "RANGE" //Sort key - } - } + var tableKeySchema = new List() { + { + new KeySchemaElement { + AttributeName= "IssueId", + KeyType = "HASH" //Partition key + } + }, + { + new KeySchemaElement { + AttributeName = "Title", + KeyType = "RANGE" //Sort key + } + } }; // Initial provisioned throughput settings for the indexes @@ -101,19 +101,19 @@ private static void CreateTable() { IndexName = "CreateDateIndex", ProvisionedThroughput = ptIndex, - KeySchema = { - new KeySchemaElement { - AttributeName = "CreateDate", KeyType = "HASH" //Partition key - }, - new KeySchemaElement { - AttributeName = "IssueId", KeyType = "RANGE" //Sort key - } + KeySchema = { + new KeySchemaElement { + AttributeName = "CreateDate", KeyType = "HASH" //Partition key + }, + new KeySchemaElement { + AttributeName = "IssueId", KeyType = "RANGE" //Sort key + } }, Projection = new Projection { ProjectionType = "INCLUDE", - NonKeyAttributes = { - "Description", "Status" + NonKeyAttributes = { + "Description", "Status" } } }; @@ -123,13 +123,13 @@ private static void CreateTable() { IndexName = "TitleIndex", ProvisionedThroughput = ptIndex, - KeySchema = { - new KeySchemaElement { - AttributeName = "Title", KeyType = "HASH" //Partition key - }, - new KeySchemaElement { - AttributeName = "IssueId", KeyType = "RANGE" //Sort key - } + KeySchema = { + new KeySchemaElement { + AttributeName = "Title", KeyType = "HASH" //Partition key + }, + new KeySchemaElement { + AttributeName = "IssueId", KeyType = "RANGE" //Sort key + } }, Projection = new Projection { @@ -142,11 +142,11 @@ private static void CreateTable() { IndexName = "DueDateIndex", ProvisionedThroughput = ptIndex, - KeySchema = { - new KeySchemaElement { - AttributeName = "DueDate", - KeyType = "HASH" //Partition key - } + KeySchema = { + new KeySchemaElement { + AttributeName = "DueDate", + KeyType = "HASH" //Partition key + } }, Projection = new Projection { @@ -166,8 +166,8 @@ private static void CreateTable() }, AttributeDefinitions = attributeDefinitions, KeySchema = tableKeySchema, - GlobalSecondaryIndexes = { - createDateIndex, titleIndex, dueDateIndex + GlobalSecondaryIndexes = { + createDateIndex, titleIndex, dueDateIndex } }; @@ -417,7 +417,7 @@ private static void WaitForTableToBeDeleted(string tableName) } } } - } -} - + } +} + // snippet-end:[dynamodb.dotNET.CodeExample.LowLevelGlobalSecondaryIndexExample] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/LowLevelItemBinaryExample.cs b/dotnet/example_code/DynamoDB/LowLevelItemBinaryExample.cs index 8967ff4a65e..d0448c92d47 100644 --- a/dotnet/example_code/DynamoDB/LowLevelItemBinaryExample.cs +++ b/dotnet/example_code/DynamoDB/LowLevelItemBinaryExample.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelItemBinaryExample.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelItemBinaryExample.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelItemBinaryExample] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelItemBinaryExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/LowLevelItemCRUDExample.cs b/dotnet/example_code/DynamoDB/LowLevelItemCRUDExample.cs index 3c601e35f61..bc2f097f376 100644 --- a/dotnet/example_code/DynamoDB/LowLevelItemCRUDExample.cs +++ b/dotnet/example_code/DynamoDB/LowLevelItemCRUDExample.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelItemCRUDExample.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelItemCRUDExample.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelItemCRUDExample] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelItemCRUDExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/LowLevelLocalSecondaryIndexExample.cs b/dotnet/example_code/DynamoDB/LowLevelLocalSecondaryIndexExample.cs index 037f4bf4a30..8b5b060e551 100644 --- a/dotnet/example_code/DynamoDB/LowLevelLocalSecondaryIndexExample.cs +++ b/dotnet/example_code/DynamoDB/LowLevelLocalSecondaryIndexExample.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelLocalSecondaryIndexExample.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelLocalSecondaryIndexExample.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelLocalSecondaryIndexExample] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelLocalSecondaryIndexExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -22,19 +22,19 @@ * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -using System; -using System.Collections.Generic; -using System.Linq; -using Amazon.DynamoDBv2; -using Amazon.DynamoDBv2.DataModel; -using Amazon.DynamoDBv2.DocumentModel; -using Amazon.DynamoDBv2.Model; -using Amazon.Runtime; -using Amazon.SecurityToken; - -namespace com.amazonaws.codesamples -{ - class LowLevelLocalSecondaryIndexExample +using System; +using System.Collections.Generic; +using System.Linq; +using Amazon.DynamoDBv2; +using Amazon.DynamoDBv2.DataModel; +using Amazon.DynamoDBv2.DocumentModel; +using Amazon.DynamoDBv2.Model; +using Amazon.Runtime; +using Amazon.SecurityToken; + +namespace com.amazonaws.codesamples +{ + class LowLevelLocalSecondaryIndexExample { private static AmazonDynamoDBClient client = new AmazonDynamoDBClient(); private static string tableName = "CustomerOrders"; @@ -74,35 +74,35 @@ private static void CreateTable() } }; - var attributeDefinitions = new List() - { - // Attribute definitions for table primary key - { new AttributeDefinition() { - AttributeName = "CustomerId", AttributeType = "S" - } }, - { new AttributeDefinition() { - AttributeName = "OrderId", AttributeType = "N" - } }, - // Attribute definitions for index primary key - { new AttributeDefinition() { - AttributeName = "OrderCreationDate", AttributeType = "N" - } }, - { new AttributeDefinition() { - AttributeName = "IsOpen", AttributeType = "N" - }} + var attributeDefinitions = new List() + { + // Attribute definitions for table primary key + { new AttributeDefinition() { + AttributeName = "CustomerId", AttributeType = "S" + } }, + { new AttributeDefinition() { + AttributeName = "OrderId", AttributeType = "N" + } }, + // Attribute definitions for index primary key + { new AttributeDefinition() { + AttributeName = "OrderCreationDate", AttributeType = "N" + } }, + { new AttributeDefinition() { + AttributeName = "IsOpen", AttributeType = "N" + }} }; createTableRequest.AttributeDefinitions = attributeDefinitions; // Key schema for table - var tableKeySchema = new List() - { - { new KeySchemaElement() { - AttributeName = "CustomerId", KeyType = "HASH" - } }, //Partition key - { new KeySchemaElement() { - AttributeName = "OrderId", KeyType = "RANGE" - } } //Sort key + var tableKeySchema = new List() + { + { new KeySchemaElement() { + AttributeName = "CustomerId", KeyType = "HASH" + } }, //Partition key + { new KeySchemaElement() { + AttributeName = "OrderId", KeyType = "RANGE" + } } //Sort key }; createTableRequest.KeySchema = tableKeySchema; @@ -116,14 +116,14 @@ private static void CreateTable() }; // Key schema for OrderCreationDateIndex - var indexKeySchema = new List() - { - { new KeySchemaElement() { - AttributeName = "CustomerId", KeyType = "HASH" - } }, //Partition key - { new KeySchemaElement() { - AttributeName = "OrderCreationDate", KeyType = "RANGE" - } } //Sort key + var indexKeySchema = new List() + { + { new KeySchemaElement() { + AttributeName = "CustomerId", KeyType = "HASH" + } }, //Partition key + { new KeySchemaElement() { + AttributeName = "OrderCreationDate", KeyType = "RANGE" + } } //Sort key }; orderCreationDateIndex.KeySchema = indexKeySchema; @@ -135,10 +135,10 @@ private static void CreateTable() ProjectionType = "INCLUDE" }; - var nonKeyAttributes = new List() - { - "ProductCategory", - "ProductName" + var nonKeyAttributes = new List() + { + "ProductCategory", + "ProductName" }; projection.NonKeyAttributes = nonKeyAttributes; @@ -154,14 +154,14 @@ LocalSecondaryIndex isOpenIndex }; // Key schema for IsOpenIndex - indexKeySchema = new List() - { - { new KeySchemaElement() { - AttributeName = "CustomerId", KeyType = "HASH" - }}, //Partition key - { new KeySchemaElement() { - AttributeName = "IsOpen", KeyType = "RANGE" - }} //Sort key + indexKeySchema = new List() + { + { new KeySchemaElement() { + AttributeName = "CustomerId", KeyType = "HASH" + }}, //Partition key + { new KeySchemaElement() { + AttributeName = "IsOpen", KeyType = "RANGE" + }} //Sort key }; // Projection (all attributes) for IsOpenIndex @@ -198,10 +198,10 @@ public static void Query(string indexName) String keyConditionExpression = "CustomerId = :v_customerId"; - Dictionary expressionAttributeValues = new Dictionary { - {":v_customerId", new AttributeValue { - S = "bob@example.com" - }} + Dictionary expressionAttributeValues = new Dictionary { + {":v_customerId", new AttributeValue { + S = "bob@example.com" + }} }; @@ -711,7 +711,7 @@ private static void WaitForTableToBeDeleted(string tableName) tablePresent = false; } } - } - } -} + } + } +} // snippet-end:[dynamodb.dotNET.CodeExample.LowLevelLocalSecondaryIndexExample] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/LowLevelParallelScan.cs b/dotnet/example_code/DynamoDB/LowLevelParallelScan.cs index 7732375d6cf..5ba4967b670 100644 --- a/dotnet/example_code/DynamoDB/LowLevelParallelScan.cs +++ b/dotnet/example_code/DynamoDB/LowLevelParallelScan.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelParallelScan.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelParallelScan.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelParallelScan] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelParallelScan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/LowLevelQuery.cs b/dotnet/example_code/DynamoDB/LowLevelQuery.cs index 341ba25a812..b1a094420e4 100644 --- a/dotnet/example_code/DynamoDB/LowLevelQuery.cs +++ b/dotnet/example_code/DynamoDB/LowLevelQuery.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelQuery.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelQuery.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelQuery] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelQuery] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/LowLevelScan.cs b/dotnet/example_code/DynamoDB/LowLevelScan.cs index 21c3ad41332..8119d8cc101 100644 --- a/dotnet/example_code/DynamoDB/LowLevelScan.cs +++ b/dotnet/example_code/DynamoDB/LowLevelScan.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelScan.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelScan.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelScan] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelScan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/LowLevelTableExample.cs b/dotnet/example_code/DynamoDB/LowLevelTableExample.cs index 34dd628c8d3..13134507d05 100644 --- a/dotnet/example_code/DynamoDB/LowLevelTableExample.cs +++ b/dotnet/example_code/DynamoDB/LowLevelTableExample.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelTableExample.cs demonstrates how to ] +// snippet-sourcedescription:[LowLevelTableExample.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelTableExample] +// snippet-start:[dynamodb.dotNET.CodeExample.LowLevelTableExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -22,15 +22,15 @@ * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -using System; -using System.Collections.Generic; -using Amazon.DynamoDBv2; -using Amazon.DynamoDBv2.Model; -using Amazon.Runtime; - -namespace com.amazonaws.codesamples -{ - class LowLevelTableExample +using System; +using System.Collections.Generic; +using Amazon.DynamoDBv2; +using Amazon.DynamoDBv2.Model; +using Amazon.Runtime; + +namespace com.amazonaws.codesamples +{ + class LowLevelTableExample { private static AmazonDynamoDBClient client = new AmazonDynamoDBClient(); private static string tableName = "ExampleTable"; @@ -59,31 +59,31 @@ private static void CreateExampleTable() Console.WriteLine("\n*** Creating table ***"); var request = new CreateTableRequest { - AttributeDefinitions = new List() - { - new AttributeDefinition - { - AttributeName = "Id", - AttributeType = "N" - }, - new AttributeDefinition - { - AttributeName = "ReplyDateTime", - AttributeType = "N" - } + AttributeDefinitions = new List() + { + new AttributeDefinition + { + AttributeName = "Id", + AttributeType = "N" + }, + new AttributeDefinition + { + AttributeName = "ReplyDateTime", + AttributeType = "N" + } }, - KeySchema = new List - { - new KeySchemaElement - { - AttributeName = "Id", - KeyType = "HASH" //Partition key - }, - new KeySchemaElement - { - AttributeName = "ReplyDateTime", - KeyType = "RANGE" //Sort key - } + KeySchema = new List + { + new KeySchemaElement + { + AttributeName = "Id", + KeyType = "HASH" //Partition key + }, + new KeySchemaElement + { + AttributeName = "ReplyDateTime", + KeyType = "RANGE" //Sort key + } }, ProvisionedThroughput = new ProvisionedThroughput { @@ -203,7 +203,7 @@ private static void WaitUntilTableReady(string tableName) // get resource not found. So we handle the potential exception. } } while (status != "ACTIVE"); - } - } -} + } + } +} // snippet-end:[dynamodb.dotNET.CodeExample.LowLevelTableExample] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/MidLevelBatchWriteItem.cs b/dotnet/example_code/DynamoDB/MidLevelBatchWriteItem.cs index b091e99c8f7..af333b59766 100644 --- a/dotnet/example_code/DynamoDB/MidLevelBatchWriteItem.cs +++ b/dotnet/example_code/DynamoDB/MidLevelBatchWriteItem.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MidLevelBatchWriteItem.cs demonstrates how to ] +// snippet-sourcedescription:[MidLevelBatchWriteItem.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.MidLevelBatchWriteItem] +// snippet-start:[dynamodb.dotNET.CodeExample.MidLevelBatchWriteItem] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/MidLevelQueryAndScan.cs b/dotnet/example_code/DynamoDB/MidLevelQueryAndScan.cs index b03da700d83..e4be75f558e 100644 --- a/dotnet/example_code/DynamoDB/MidLevelQueryAndScan.cs +++ b/dotnet/example_code/DynamoDB/MidLevelQueryAndScan.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MidLevelQueryAndScan.cs demonstrates how to ] +// snippet-sourcedescription:[MidLevelQueryAndScan.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.MidLevelQueryAndScan] +// snippet-start:[dynamodb.dotNET.CodeExample.MidLevelQueryAndScan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/MidLevelScanOnly.cs b/dotnet/example_code/DynamoDB/MidLevelScanOnly.cs index 131b4d7baec..d127831104f 100644 --- a/dotnet/example_code/DynamoDB/MidLevelScanOnly.cs +++ b/dotnet/example_code/DynamoDB/MidLevelScanOnly.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MidLevelScanOnly.cs demonstrates how to ] +// snippet-sourcedescription:[MidLevelScanOnly.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.MidLevelScanOnly] +// snippet-start:[dynamodb.dotNET.CodeExample.MidLevelScanOnly] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/MidlevelItemCRUD.cs b/dotnet/example_code/DynamoDB/MidlevelItemCRUD.cs index f77ed4fa8cb..eef1c8057f0 100644 --- a/dotnet/example_code/DynamoDB/MidlevelItemCRUD.cs +++ b/dotnet/example_code/DynamoDB/MidlevelItemCRUD.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MidlevelItemCRUD.cs demonstrates how to ] +// snippet-sourcedescription:[MidlevelItemCRUD.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.MidlevelItemCRUD] +// snippet-start:[dynamodb.dotNET.CodeExample.MidlevelItemCRUD] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/SampleDataLoad.cs b/dotnet/example_code/DynamoDB/SampleDataLoad.cs index 403d41cf01e..4ca3c9c548d 100644 --- a/dotnet/example_code/DynamoDB/SampleDataLoad.cs +++ b/dotnet/example_code/DynamoDB/SampleDataLoad.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[SampleDataLoad.cs demonstrates how to ] +// snippet-sourcedescription:[SampleDataLoad.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.SampleDataLoad] +// snippet-start:[dynamodb.dotNET.CodeExample.SampleDataLoad] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/dotnet/example_code/DynamoDB/SampleDataTryQuery.cs b/dotnet/example_code/DynamoDB/SampleDataTryQuery.cs index 1ca7b65764b..d45af3275e2 100644 --- a/dotnet/example_code/DynamoDB/SampleDataTryQuery.cs +++ b/dotnet/example_code/DynamoDB/SampleDataTryQuery.cs @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[SampleDataTryQuery.cs demonstrates how to ] +// snippet-sourcedescription:[SampleDataTryQuery.cs demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[dotNET] // snippet-keyword:[Amazon DynamoDB] @@ -7,7 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.dotNET.CodeExample.SampleDataTryQuery] +// snippet-start:[dynamodb.dotNET.CodeExample.SampleDataTryQuery] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -22,16 +22,16 @@ * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -using System; -using System.Collections.Generic; -using Amazon.DynamoDBv2; -using Amazon.DynamoDBv2.Model; -using Amazon.Runtime; -using Amazon.Util; - -namespace com.amazonaws.codesamples -{ - class SampleDataTryQuery +using System; +using System.Collections.Generic; +using Amazon.DynamoDBv2; +using Amazon.DynamoDBv2.Model; +using Amazon.Runtime; +using Amazon.Util; + +namespace com.amazonaws.codesamples +{ + class SampleDataTryQuery { private static AmazonDynamoDBClient client = new AmazonDynamoDBClient(); @@ -58,11 +58,11 @@ private static void GetBook(int id, string tableName) var request = new GetItemRequest { TableName = tableName, - Key = new Dictionary() - { - { "Id", new AttributeValue { - N = id.ToString() - } } + Key = new Dictionary() + { + { "Id", new AttributeValue { + N = id.ToString() + } } }, ReturnConsumedCapacity = "TOTAL" }; @@ -93,13 +93,13 @@ private static void FindRepliesInLast15DaysWithConfig(string forumName, string t { TableName = "Reply", KeyConditionExpression = "Id = :v_replyId and ReplyDateTime > :v_datetime", - ExpressionAttributeValues = new Dictionary { - {":v_replyId", new AttributeValue { - S = replyId - }}, - {":v_datetime", new AttributeValue { - S = twoWeeksAgoString - }} + ExpressionAttributeValues = new Dictionary { + {":v_replyId", new AttributeValue { + S = replyId + }}, + {":v_datetime", new AttributeValue { + S = twoWeeksAgoString + }} }, // Optional parameter. @@ -151,8 +151,8 @@ private static void PrintItem(Dictionary attributeList) ); } Console.WriteLine("************************************************"); - } - } -} - + } + } +} + // snippet-end:[dynamodb.dotNET.CodeExample.SampleDataTryQuery] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/TryDax/01-CreateTable.cs b/dotnet/example_code/DynamoDB/TryDax/01-CreateTable.cs new file mode 100644 index 00000000000..1685ee93ebf --- /dev/null +++ b/dotnet/example_code/DynamoDB/TryDax/01-CreateTable.cs @@ -0,0 +1,68 @@ +// snippet-sourcedescription:[01-CreateTable.cs demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[dotNET] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.dotNET.trydax.01-CreateTable] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +using Amazon.DynamoDBv2.Model; +using System.Collections.Generic; +using System; +using Amazon.DynamoDBv2; + +namespace ClientTest +{ + class Program + { + static void Main(string[] args) + { + + AmazonDynamoDBClient client = new AmazonDynamoDBClient(); + + var tableName = "TryDaxTable"; + + var request = new CreateTableRequest() + { + TableName = tableName, + KeySchema = new List() + { + new KeySchemaElement{ AttributeName = "pk",KeyType = "HASH"}, + new KeySchemaElement{ AttributeName = "sk",KeyType = "RANGE"} + }, + AttributeDefinitions = new List() { + new AttributeDefinition{ AttributeName = "pk",AttributeType = "N"}, + new AttributeDefinition{ AttributeName = "sk",AttributeType = "N"} + }, + ProvisionedThroughput = new ProvisionedThroughput() + { + ReadCapacityUnits = 10, + WriteCapacityUnits = 10 + } + }; + + var response = client.CreateTableAsync(request).Result; + + Console.WriteLine("Hit to continue..."); + Console.ReadLine(); + } + } +} + +// snippet-end:[dynamodb.dotNET.trydax.01-CreateTable] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/TryDax/02-Write-Data.cs b/dotnet/example_code/DynamoDB/TryDax/02-Write-Data.cs new file mode 100644 index 00000000000..bc80d24cf8d --- /dev/null +++ b/dotnet/example_code/DynamoDB/TryDax/02-Write-Data.cs @@ -0,0 +1,72 @@ +// snippet-sourcedescription:[02-Write-Data.cs demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[dotNET] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.dotNET.trydax.02-Write-Data] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +using Amazon.DynamoDBv2.Model; +using System.Collections.Generic; +using System; +using Amazon.DynamoDBv2; + +namespace ClientTest +{ + class Program + { + static void Main(string[] args) + { + + AmazonDynamoDBClient client = new AmazonDynamoDBClient(); + + var tableName = "TryDaxTable"; + + string someData = new String('X', 1000); + var pkmax = 10; + var skmax = 10; + + for (var ipk = 1; ipk <= pkmax; ipk++) + { + Console.WriteLine("Writing " + skmax + " items for partition key: " + ipk); + for (var isk = 1; isk <= skmax; isk++) + { + var request = new PutItemRequest() + { + TableName = tableName, + Item = new Dictionary() + { + { "pk", new AttributeValue{N = ipk.ToString() } }, + { "sk", new AttributeValue{N = isk.ToString() } }, + { "someData", new AttributeValue{S = someData } } + } + }; + + var response = client.PutItemAsync(request).Result; + + } + } + + Console.WriteLine("Hit to continue..."); + Console.ReadLine(); + } + } +} + +// snippet-end:[dynamodb.dotNET.trydax.02-Write-Data] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/TryDax/03-GetItem-Test.cs b/dotnet/example_code/DynamoDB/TryDax/03-GetItem-Test.cs new file mode 100644 index 00000000000..1040304d963 --- /dev/null +++ b/dotnet/example_code/DynamoDB/TryDax/03-GetItem-Test.cs @@ -0,0 +1,92 @@ +// snippet-sourcedescription:[03-GetItem-Test.cs demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[dotNET] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.dotNET.trydax.03-GetItem-Test] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +using Amazon.Runtime; +using Amazon.DAX; +using Amazon.DynamoDBv2.Model; +using System.Collections.Generic; +using System; +using Amazon.DynamoDBv2; +using Amazon; + +namespace ClientTest +{ + class Program + { + static void Main(string[] args) + { + + String hostName = args[0].Split(':')[0]; + int port = Int32.Parse(args[0].Split(':')[1]); + Console.WriteLine("Using DAX client - hostname=" + hostName + ", port=" + port); + + var clientConfig = new DaxClientConfig(hostName, port) + { + AwsCredentials = FallbackCredentialsFactory.GetCredentials() + + }; + var client = new ClusterDaxClient(clientConfig); + + var tableName = "TryDaxTable"; + + var pk = 1; + var sk = 10; + var iterations = 5; + + var startTime = DateTime.Now; + + for (var i = 0; i < iterations; i++) + { + + for (var ipk = 1; ipk <= pk; ipk++) + { + for (var isk = 1; isk <= sk; isk++) + { + var request = new GetItemRequest() + { + TableName = tableName, + Key = new Dictionary() { + {"pk", new AttributeValue {N = ipk.ToString()} }, + {"sk", new AttributeValue {N = isk.ToString() } } + } + }; + var response = client.GetItemAsync(request).Result; + Console.WriteLine("GetItem succeeded for pk: " + ipk + ", sk: " + isk); + } + } + + } + + var endTime = DateTime.Now; + TimeSpan timeSpan = endTime - startTime; + Console.WriteLine("Total time: " + (int)timeSpan.TotalMilliseconds + " milliseconds"); + + Console.WriteLine("Hit to continue..."); + Console.ReadLine(); + } + } +} + + +// snippet-end:[dynamodb.dotNET.trydax.03-GetItem-Test] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/TryDax/04-Query-Test.cs b/dotnet/example_code/DynamoDB/TryDax/04-Query-Test.cs new file mode 100644 index 00000000000..463236d90d2 --- /dev/null +++ b/dotnet/example_code/DynamoDB/TryDax/04-Query-Test.cs @@ -0,0 +1,88 @@ +// snippet-sourcedescription:[04-Query-Test.cs demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[dotNET] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.dotNET.trydax.04-Query-Test] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +using Amazon.Runtime; +using Amazon.DAX; +using Amazon.DynamoDBv2.Model; +using System.Collections.Generic; +using System; +using Amazon.DynamoDBv2; +using Amazon; + +namespace ClientTest +{ + class Program + { + static void Main(string[] args) + { + + + String hostName = args[0].Split(':')[0]; + int port = Int32.Parse(args[0].Split(':')[1]); + Console.WriteLine("Using DAX client - hostname=" + hostName + ", port=" + port); + + var clientConfig = new DaxClientConfig(hostName, port) + { + AwsCredentials = FallbackCredentialsFactory.GetCredentials() + + }; + var client = new ClusterDaxClient(clientConfig); + + var tableName = "TryDaxTable"; + + var pk = 5; + var sk1 = 2; + var sk2 = 9; + var iterations = 5; + + var startTime = DateTime.Now; + + for (var i = 0; i < iterations; i++) + { + var request = new QueryRequest() + { + TableName = tableName, + KeyConditionExpression = "pk = :pkval and sk between :skval1 and :skval2", + ExpressionAttributeValues = new Dictionary() { + {":pkval", new AttributeValue {N = pk.ToString()} }, + {":skval1", new AttributeValue {N = sk1.ToString()} }, + {":skval2", new AttributeValue {N = sk2.ToString()} } + } + }; + var response = client.QueryAsync(request).Result; + Console.WriteLine(i + ": Query succeeded"); + + } + + var endTime = DateTime.Now; + TimeSpan timeSpan = endTime - startTime; + Console.WriteLine("Total time: " + (int)timeSpan.TotalMilliseconds + " milliseconds"); + + Console.WriteLine("Hit to continue..."); + Console.ReadLine(); + } + } +} + +// snippet-end:[dynamodb.dotNET.trydax.04-Query-Test] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/TryDax/05-Scan-Test.cs b/dotnet/example_code/DynamoDB/TryDax/05-Scan-Test.cs new file mode 100644 index 00000000000..11793bba9b2 --- /dev/null +++ b/dotnet/example_code/DynamoDB/TryDax/05-Scan-Test.cs @@ -0,0 +1,79 @@ +// snippet-sourcedescription:[05-Scan-Test.cs demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[dotNET] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.dotNET.trydax.05-Scan-Test] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +using Amazon.Runtime; +using Amazon.DAX; +using Amazon.DynamoDBv2.Model; +using System.Collections.Generic; +using System; +using Amazon.DynamoDBv2; +using Amazon; + +namespace ClientTest +{ + class Program + { + static void Main(string[] args) + { + + + String hostName = args[0].Split(':')[0]; + int port = Int32.Parse(args[0].Split(':')[1]); + Console.WriteLine("Using DAX client - hostname=" + hostName + ", port=" + port); + + + var clientConfig = new DaxClientConfig(hostName, port) + { + AwsCredentials = FallbackCredentialsFactory.GetCredentials( + + }; + var client = new ClusterDaxClient(clientConfig); + + var tableName = "TryDaxTable"; + + var iterations = 5; + + var startTime = DateTime.Now; + + for (var i = 0; i < iterations; i++) + { + var request = new ScanRequest() + { + TableName = tableName + }; + var response = client.ScanAsync(request).Result; + Console.WriteLine(i + ": Scan succeeded"); + } + + var endTime = DateTime.Now; + TimeSpan timeSpan = endTime - startTime; + Console.WriteLine("Total time: " + (int)timeSpan.TotalMilliseconds + " milliseconds"); + + Console.WriteLine("Hit to continue..."); + Console.ReadLine(); + } + } +} + +// snippet-end:[dynamodb.dotNET.trydax.05-Scan-Test] \ No newline at end of file diff --git a/dotnet/example_code/DynamoDB/TryDax/06-DeleteTable.cs b/dotnet/example_code/DynamoDB/TryDax/06-DeleteTable.cs new file mode 100644 index 00000000000..94a0fe1337b --- /dev/null +++ b/dotnet/example_code/DynamoDB/TryDax/06-DeleteTable.cs @@ -0,0 +1,55 @@ +// snippet-sourcedescription:[06-DeleteTable.cs demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[dotNET] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.dotNET.trydax.06-DeleteTable] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +using Amazon.DynamoDBv2.Model; +using System; +using Amazon.DynamoDBv2; + +namespace ClientTest +{ + class Program + { + static void Main(string[] args) + { + + AmazonDynamoDBClient client = new AmazonDynamoDBClient(); + + var tableName = "TryDaxTable"; + + var request = new DeleteTableRequest() + { + TableName = tableName + }; + + var response = client.DeleteTableAsync(request).Result; + + + Console.WriteLine("Hit to continue..."); + Console.ReadLine(); + } + } + +} + +// snippet-end:[dynamodb.dotNET.trydax.06-DeleteTable] \ No newline at end of file diff --git a/dotnet/example_code/S3/Program.cs b/dotnet/example_code/S3/Program.cs new file mode 100644 index 00000000000..1264e4e5d5c --- /dev/null +++ b/dotnet/example_code/S3/Program.cs @@ -0,0 +1,124 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[Program.cs demonstrates how to list, create, and delete a bucket in Amazon S3.] +// snippet-service:[s3] +// snippet-keyword:[dotNET] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ListBucketsAsync] +// snippet-keyword:[PutBucketAsync] +// snippet-keyword:[DeleteBucketAsync] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-05-29] +// snippet-sourceauthor:[AWS] +// snippet-start:[s3.dotnet.bucket_operations.list_create_delete] +using Amazon; +using Amazon.S3; +using Amazon.S3.Model; +using Amazon.S3.Util; +using System; +using System.Threading.Tasks; + +namespace s3 +{ + class Program + { + private static RegionEndpoint bucketRegion; + private static IAmazonS3 s3Client; + + static void Main(string[] args) + { + if (args.Length < 2) { + Console.Write("Usage: \n" + + "Example: my-test-bucket us-east-2\n"); + return; + } + + if (args[1] == "us-east-2") { + bucketRegion = RegionEndpoint.USEast2; + } else { + Console.WriteLine("Cannot continue. The only supported AWS Region ID is " + + "'us-east-2'."); + return; + } + // Note: You could add more valid AWS Regions above as needed. + + s3Client = new AmazonS3Client(bucketRegion); + var bucketName = args[0]; + + // Create the bucket. + try + { + if (DoesBucketExist(bucketName)) + { + Console.WriteLine("Cannot continue. Cannot create bucket. \n" + + "A bucket named '{0}' already exists.", bucketName); + return; + } else { + Console.WriteLine("\nCreating the bucket named '{0}'...", bucketName); + s3Client.PutBucketAsync(bucketName).Wait(); + } + } + catch (AmazonS3Exception e) + { + Console.WriteLine("Cannot continue. {0}", e.Message); + } + catch (Exception e) + { + Console.WriteLine("Cannot continue. {0}", e.Message); + } + + // Confirm that the bucket was created. + if (DoesBucketExist(bucketName)) + { + Console.WriteLine("Created the bucket named '{0}'.", bucketName); + } else { + Console.WriteLine("Did not create the bucket named '{0}'.", bucketName); + } + + // Delete the bucket. + Console.WriteLine("\nDeleting the bucket named '{0}'...", bucketName); + s3Client.DeleteBucketAsync(bucketName).Wait(); + + // Confirm that the bucket was deleted. + if (DoesBucketExist(bucketName)) + { + Console.WriteLine("Did not delete the bucket named '{0}'.", bucketName); + } else { + Console.WriteLine("Deleted the bucket named '{0}'.", bucketName); + }; + + // List current buckets. + Console.WriteLine("\nMy buckets now are:"); + var response = s3Client.ListBucketsAsync().Result; + + foreach (var bucket in response.Buckets) + { + Console.WriteLine(bucket.BucketName); + } + } + + static bool DoesBucketExist(string bucketName) + { + if ((AmazonS3Util.DoesS3BucketExistAsync(s3Client, bucketName).Result)) + { + return true; + } else { + return false; + } + } + } +} +// snippet-end:[s3.dotnet.bucket_operations.list_create_delete] \ No newline at end of file diff --git a/go/example_code/cloudformation/CfnCreateStack.go b/go/example_code/cloudformation/CfnCreateStack.go index 6eb739e175f..734fec32f0c 100644 --- a/go/example_code/cloudformation/CfnCreateStack.go +++ b/go/example_code/cloudformation/CfnCreateStack.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates a CloudFormation stack.] -//snippet-keyword:[AWS CloudFormation] -//snippet-keyword:[CreateStack function] -//snippet-keyword:[WaitUntilStackCreateComplete function] -//snippet-keyword:[Go] -//snippet-service:[cloudformation] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates a CloudFormation stack.] +// snippet-keyword:[AWS CloudFormation] +// snippet-keyword:[CreateStack function] +// snippet-keyword:[WaitUntilStackCreateComplete function] +// snippet-keyword:[Go] +// snippet-service:[cloudformation] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudformation/CfnDeleteStack.go b/go/example_code/cloudformation/CfnDeleteStack.go index 387d41ed20f..136b3ffdc1f 100644 --- a/go/example_code/cloudformation/CfnDeleteStack.go +++ b/go/example_code/cloudformation/CfnDeleteStack.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes a CloudFormation stack.] -//snippet-keyword:[AWS CloudFormation] -//snippet-keyword:[DeleteStack function] -//snippet-keyword:[WaitUntilStackDeleteComplete function] -//snippet-keyword:[Go] -//snippet-service:[cloudformation] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes a CloudFormation stack.] +// snippet-keyword:[AWS CloudFormation] +// snippet-keyword:[DeleteStack function] +// snippet-keyword:[WaitUntilStackDeleteComplete function] +// snippet-keyword:[Go] +// snippet-service:[cloudformation] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudformation/CfnListStacks.go b/go/example_code/cloudformation/CfnListStacks.go index d7c068cc30e..df892420e76 100644 --- a/go/example_code/cloudformation/CfnListStacks.go +++ b/go/example_code/cloudformation/CfnListStacks.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists your CloudFormation stacks.] -//snippet-keyword:[AWS CloudFormation] -//snippet-keyword:[ListStacks function] -//snippet-keyword:[Go] -//snippet-service:[cloudformation] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists your CloudFormation stacks.] +// snippet-keyword:[AWS CloudFormation] +// snippet-keyword:[ListStacks function] +// snippet-keyword:[Go] +// snippet-service:[cloudformation] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudtrail/create_trail.go b/go/example_code/cloudtrail/create_trail.go index 6811877c260..632857bbd2c 100644 --- a/go/example_code/cloudtrail/create_trail.go +++ b/go/example_code/cloudtrail/create_trail.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an AWS CloudTrail trail.] -//snippet-keyword:[AWS CloudTrail] -//snippet-keyword:[CreateTrail function] -//snippet-keyword:[Go] -//snippet-service:[cloudtrail] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an AWS CloudTrail trail.] +// snippet-keyword:[AWS CloudTrail] +// snippet-keyword:[CreateTrail function] +// snippet-keyword:[Go] +// snippet-service:[cloudtrail] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudtrail/delete_trail.go b/go/example_code/cloudtrail/delete_trail.go index 0d134606994..33e3ca166d8 100644 --- a/go/example_code/cloudtrail/delete_trail.go +++ b/go/example_code/cloudtrail/delete_trail.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an AWS CloudTrail trail.] -//snippet-keyword:[AWS CloudTrail] -//snippet-keyword:[DeleteTrail function] -//snippet-keyword:[Go] -//snippet-service:[cloudtrail] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an AWS CloudTrail trail.] +// snippet-keyword:[AWS CloudTrail] +// snippet-keyword:[DeleteTrail function] +// snippet-keyword:[Go] +// snippet-service:[cloudtrail] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudtrail/describe_trails.go b/go/example_code/cloudtrail/describe_trails.go index 24b08cb82a3..3ee590d94b8 100644 --- a/go/example_code/cloudtrail/describe_trails.go +++ b/go/example_code/cloudtrail/describe_trails.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the AWS CloudTrail trails.] -//snippet-keyword:[AWS CloudTrail] -//snippet-keyword:[DescribeTrails function] -//snippet-keyword:[Go] -//snippet-service:[cloudtrail] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the AWS CloudTrail trails.] +// snippet-keyword:[AWS CloudTrail] +// snippet-keyword:[DescribeTrails function] +// snippet-keyword:[Go] +// snippet-service:[cloudtrail] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudtrail/lookup_events.go b/go/example_code/cloudtrail/lookup_events.go index 494fe60ff66..ff28f5006be 100644 --- a/go/example_code/cloudtrail/lookup_events.go +++ b/go/example_code/cloudtrail/lookup_events.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the AWS CloudTrail events.] -//snippet-keyword:[AWS CloudTrail] -//snippet-keyword:[LookupEvents function] -//snippet-keyword:[Go] -//snippet-service:[cloudtrail] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the AWS CloudTrail events.] +// snippet-keyword:[AWS CloudTrail] +// snippet-keyword:[LookupEvents function] +// snippet-keyword:[Go] +// snippet-service:[cloudtrail] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/create_enable_alarms.go b/go/example_code/cloudwatch/create_enable_alarms.go index bf6e20fc0e9..fd76c81c23f 100644 --- a/go/example_code/cloudwatch/create_enable_alarms.go +++ b/go/example_code/cloudwatch/create_enable_alarms.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates and enables an action on an alarm.] -//snippet-keyword:[AWS CloudWatch] -//snippet-keyword:[EnableAlarmActions function] -//snippet-keyword:[PutMetricAlarm function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates and enables an action on an alarm.] +// snippet-keyword:[AWS CloudWatch] +// snippet-keyword:[EnableAlarmActions function] +// snippet-keyword:[PutMetricAlarm function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/custom_metrics.go b/go/example_code/cloudwatch/custom_metrics.go index b2f9e06c3cb..7c107ed9c2e 100644 --- a/go/example_code/cloudwatch/custom_metrics.go +++ b/go/example_code/cloudwatch/custom_metrics.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Ret.] -//snippet-keyword:[AWS CloudWatch] -//snippet-keyword:[ListMetrics function] -//snippet-keyword:[PutMetricData function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Ret.] +// snippet-keyword:[AWS CloudWatch] +// snippet-keyword:[ListMetrics function] +// snippet-keyword:[PutMetricData function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/delete_alarms.go b/go/example_code/cloudwatch/delete_alarms.go index 4a10e04c77f..f03eb88da38 100644 --- a/go/example_code/cloudwatch/delete_alarms.go +++ b/go/example_code/cloudwatch/delete_alarms.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes a CloudWatch alarm.] -//snippet-keyword:[Amazon CloudWatch] -//snippet-keyword:[DeleteAlarms function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes a CloudWatch alarm.] +// snippet-keyword:[Amazon CloudWatch] +// snippet-keyword:[DeleteAlarms function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/describe_alarm_history.go b/go/example_code/cloudwatch/describe_alarm_history.go index e8e6c1c53b6..fcaa58b4190 100644 --- a/go/example_code/cloudwatch/describe_alarm_history.go +++ b/go/example_code/cloudwatch/describe_alarm_history.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets the history for a CloudWatch alarm.] -//snippet-keyword:[Amazon CloudWatch] -//snippet-keyword:[DescribeAlarmHistory function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets the history for a CloudWatch alarm.] +// snippet-keyword:[Amazon CloudWatch] +// snippet-keyword:[DescribeAlarmHistory function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/describe_alarms.go b/go/example_code/cloudwatch/describe_alarms.go index af660bd6256..aa7d939e422 100644 --- a/go/example_code/cloudwatch/describe_alarms.go +++ b/go/example_code/cloudwatch/describe_alarms.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Describes the Amazon Cloudwatch alarms.] -//snippet-keyword:[Amazon CloudWatch] -//snippet-keyword:[DescribeAlarms function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Describes the Amazon Cloudwatch alarms.] +// snippet-keyword:[Amazon CloudWatch] +// snippet-keyword:[DescribeAlarms function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/describe_alarms_for_metric.go b/go/example_code/cloudwatch/describe_alarms_for_metric.go index e471d1b6134..b2b2d825608 100644 --- a/go/example_code/cloudwatch/describe_alarms_for_metric.go +++ b/go/example_code/cloudwatch/describe_alarms_for_metric.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets the CloudWatch alarms for a specific metric.] -//snippet-keyword:[Amazon CloudWatch] -//snippet-keyword:[DescribeAlarmsForMetric function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets the CloudWatch alarms for a specific metric.] +// snippet-keyword:[Amazon CloudWatch] +// snippet-keyword:[DescribeAlarmsForMetric function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/disable_alarm.go b/go/example_code/cloudwatch/disable_alarm.go index b01ee012869..0d52b233e4a 100644 --- a/go/example_code/cloudwatch/disable_alarm.go +++ b/go/example_code/cloudwatch/disable_alarm.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Disables the actions on an alarm.] -//snippet-keyword:[AWS CloudWatch] -//snippet-keyword:[DisableAlarmActions function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Disables the actions on an alarm.] +// snippet-keyword:[AWS CloudWatch] +// snippet-keyword:[DisableAlarmActions function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/events_put_events.go b/go/example_code/cloudwatch/events_put_events.go index 45232137d59..5a9ef37ffe4 100644 --- a/go/example_code/cloudwatch/events_put_events.go +++ b/go/example_code/cloudwatch/events_put_events.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Sends an event that is matched to targets for handling.] -//snippet-keyword:[AWS CloudWatch] -//snippet-keyword:[PutEvents function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Sends an event that is matched to targets for handling.] +// snippet-keyword:[AWS CloudWatch] +// snippet-keyword:[PutEvents function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/events_put_targets.go b/go/example_code/cloudwatch/events_put_targets.go index 13e088411c0..79c1adae9ba 100644 --- a/go/example_code/cloudwatch/events_put_targets.go +++ b/go/example_code/cloudwatch/events_put_targets.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Defines a target to respond to an event.] -//snippet-keyword:[AWS CloudWatch] -//snippet-keyword:[PutTargets function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Defines a target to respond to an event.] +// snippet-keyword:[AWS CloudWatch] +// snippet-keyword:[PutTargets function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/events_schedule_rule.go b/go/example_code/cloudwatch/events_schedule_rule.go index 0071a3585fb..79110ba829c 100644 --- a/go/example_code/cloudwatch/events_schedule_rule.go +++ b/go/example_code/cloudwatch/events_schedule_rule.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates a rule used to trigger an event.] -//snippet-keyword:[AWS CloudWatch] -//snippet-keyword:[PutRule function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates a rule used to trigger an event.] +// snippet-keyword:[AWS CloudWatch] +// snippet-keyword:[PutRule function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/cloudwatch/listing_metrics.go b/go/example_code/cloudwatch/listing_metrics.go index d3e807f3cd3..ab04186a293 100644 --- a/go/example_code/cloudwatch/listing_metrics.go +++ b/go/example_code/cloudwatch/listing_metrics.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Retrieves a list of published AWS CloudWatch metrics.] -//snippet-keyword:[AWS CloudWatch] -//snippet-keyword:[ListMetrics function] -//snippet-keyword:[Go] -//snippet-service:[cloudwatch] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Retrieves a list of published AWS CloudWatch metrics.] +// snippet-keyword:[AWS CloudWatch] +// snippet-keyword:[ListMetrics function] +// snippet-keyword:[Go] +// snippet-service:[cloudwatch] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/codebuild/cb_build_project.go b/go/example_code/codebuild/cb_build_project.go index 92e9e0d3c2f..15262adabf1 100644 --- a/go/example_code/codebuild/cb_build_project.go +++ b/go/example_code/codebuild/cb_build_project.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Builds the AWS CodeBuild project specified on the command line.] -//snippet-keyword:[AWS CodeBuild] -//snippet-keyword:[StartBuild function] -//snippet-keyword:[Go] -//snippet-service:[codebuild] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Builds the AWS CodeBuild project specified on the command line.] +// snippet-keyword:[AWS CodeBuild] +// snippet-keyword:[StartBuild function] +// snippet-keyword:[Go] +// snippet-service:[codebuild] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/codebuild/cb_list_builds.go b/go/example_code/codebuild/cb_list_builds.go index 503f2f9c9ec..568e5cec425 100644 --- a/go/example_code/codebuild/cb_list_builds.go +++ b/go/example_code/codebuild/cb_list_builds.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Displays information about your AWS CodeBuild project builds.] -//snippet-keyword:[AWS CodeBuild] -//snippet-keyword:[ListBuilds function] -//snippet-keyword:[Go] -//snippet-service:[codebuild] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Displays information about your AWS CodeBuild project builds.] +// snippet-keyword:[AWS CodeBuild] +// snippet-keyword:[ListBuilds function] +// snippet-keyword:[Go] +// snippet-service:[codebuild] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/codebuild/cb_list_projects.go b/go/example_code/codebuild/cb_list_projects.go index 2eaf47a450e..ed4fa2d1b23 100644 --- a/go/example_code/codebuild/cb_list_projects.go +++ b/go/example_code/codebuild/cb_list_projects.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the names of up to 100 of your AWS CodeBuild projects.] -//snippet-keyword:[AWS CodeBuild] -//snippet-keyword:[ListProjects function] -//snippet-keyword:[Go] -//snippet-service:[codebuild] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the names of up to 100 of your AWS CodeBuild projects.] +// snippet-keyword:[AWS CodeBuild] +// snippet-keyword:[ListProjects function] +// snippet-keyword:[Go] +// snippet-service:[codebuild] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/dynamodb/create_item.go b/go/example_code/dynamodb/create_item.go index 6ca15757d1e..04f0f72060c 100644 --- a/go/example_code/dynamodb/create_item.go +++ b/go/example_code/dynamodb/create_item.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an item in an Amazon DynamoDB table.] -//snippet-keyword:[Amazon DynamoDB] -//snippet-keyword:[PutItem function] -//snippet-keyword:[Go] -//snippet-service:[dynamodb] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an item in an Amazon DynamoDB table.] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[PutItem function] +// snippet-keyword:[Go] +// snippet-service:[dynamodb] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/dynamodb/create_table.go b/go/example_code/dynamodb/create_table.go index 87c31f33141..3d62e006317 100644 --- a/go/example_code/dynamodb/create_table.go +++ b/go/example_code/dynamodb/create_table.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an Amazon DynamoDB table.] -//snippet-keyword:[Amazon DynamoDB] -//snippet-keyword:[CreateTable function] -//snippet-keyword:[Go] -//snippet-service:[dynamodb] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an Amazon DynamoDB table.] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[CreateTable function] +// snippet-keyword:[Go] +// snippet-service:[dynamodb] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/dynamodb/delete_item.go b/go/example_code/dynamodb/delete_item.go index eb877a62205..e08b26d1576 100644 --- a/go/example_code/dynamodb/delete_item.go +++ b/go/example_code/dynamodb/delete_item.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an item from an Amazon DynamoDB table.] -//snippet-keyword:[Amazon DynamoDB] -//snippet-keyword:[DeleteItem function] -//snippet-keyword:[Go] -//snippet-service:[dynamodb] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an item from an Amazon DynamoDB table.] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[DeleteItem function] +// snippet-keyword:[Go] +// snippet-service:[dynamodb] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/dynamodb/list_tables.go b/go/example_code/dynamodb/list_tables.go index 04ecb59e060..4bbac5af60e 100644 --- a/go/example_code/dynamodb/list_tables.go +++ b/go/example_code/dynamodb/list_tables.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists your Amazon DynamoDB tables.] -//snippet-keyword:[Amazon DynamoDB] -//snippet-keyword:[ListTables function] -//snippet-keyword:[Go] -//snippet-service:[dynamodb] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists your Amazon DynamoDB tables.] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[ListTables function] +// snippet-keyword:[Go] +// snippet-service:[dynamodb] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/dynamodb/load_items.go b/go/example_code/dynamodb/load_items.go index ad25992cf61..bff79d0294a 100644 --- a/go/example_code/dynamodb/load_items.go +++ b/go/example_code/dynamodb/load_items.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Adds items from a JSON file to an Amazon DynamoDB table.] -//snippet-keyword:[Amazon DynamoDB] -//snippet-keyword:[PutItem function] -//snippet-keyword:[Go] -//snippet-service:[dynamodb] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Adds items from a JSON file to an Amazon DynamoDB table.] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[PutItem function] +// snippet-keyword:[Go] +// snippet-service:[dynamodb] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/dynamodb/read_item.go b/go/example_code/dynamodb/read_item.go index 7b350743ba0..b7c87e1c652 100644 --- a/go/example_code/dynamodb/read_item.go +++ b/go/example_code/dynamodb/read_item.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets an item from an Amazon DynamoDB table.] -//snippet-keyword:[Amazon DynamoDB] -//snippet-keyword:[GetItem function] -//snippet-keyword:[Go] -//snippet-service:[dynamodb] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets an item from an Amazon DynamoDB table.] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[GetItem function] +// snippet-keyword:[Go] +// snippet-service:[dynamodb] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/dynamodb/scan_items.go b/go/example_code/dynamodb/scan_items.go index 92acc6d322e..46398ea85d6 100644 --- a/go/example_code/dynamodb/scan_items.go +++ b/go/example_code/dynamodb/scan_items.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets items from and Amazon DymanoDB table using the Expression Builder package.] -//snippet-keyword:[Amazon DynamoDB] -//snippet-keyword:[Scan function] -//snippet-keyword:[Expression Builder] -//snippet-keyword:[Go] -//snippet-service:[dynamodb] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets items from and Amazon DymanoDB table using the Expression Builder package.] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Scan function] +// snippet-keyword:[Expression Builder] +// snippet-keyword:[Go] +// snippet-service:[dynamodb] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/dynamodb/update_item.go b/go/example_code/dynamodb/update_item.go index 4cc2275014c..e09936de2de 100644 --- a/go/example_code/dynamodb/update_item.go +++ b/go/example_code/dynamodb/update_item.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Updates an item in an Amazon DynamoDB table.] -//snippet-keyword:[Amazon DynamoDB] -//snippet-keyword:[UpdateItem function] -//snippet-keyword:[Go] -//snippet-service:[dynamodb] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Updates an item in an Amazon DynamoDB table.] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[UpdateItem function] +// snippet-keyword:[Go] +// snippet-service:[dynamodb] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/create_image_no_block_device.go b/go/example_code/ec2/create_image_no_block_device.go index 0ce58614aa2..b12786667fd 100644 --- a/go/example_code/ec2/create_image_no_block_device.go +++ b/go/example_code/ec2/create_image_no_block_device.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an Amazon EC2 instance without a block device.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[CreateImage function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-11-08] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an Amazon EC2 instance without a block device.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[CreateImage function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-11-08] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/create_instance.go b/go/example_code/ec2/create_instance.go index e8bee9802c6..33929c34191 100644 --- a/go/example_code/ec2/create_instance.go +++ b/go/example_code/ec2/create_instance.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an Amazon EC2 instance with tags.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[CreateTags function] -//snippet-keyword:[RunInstances function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-11-08] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an Amazon EC2 instance with tags.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[CreateTags function] +// snippet-keyword:[RunInstances function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-11-08] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/describing_instances.go b/go/example_code/ec2/describing_instances.go index 0e6b44a2aaf..87c22306f59 100644 --- a/go/example_code/ec2/describing_instances.go +++ b/go/example_code/ec2/describing_instances.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Describes your Amazon EC2 instances.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[DescribeInstances function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Describes your Amazon EC2 instances.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[DescribeInstances function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/ec2_allocate_address.go b/go/example_code/ec2/ec2_allocate_address.go index 230644a9b84..ad5c8771d3c 100644 --- a/go/example_code/ec2/ec2_allocate_address.go +++ b/go/example_code/ec2/ec2_allocate_address.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Allocates a static IP address and associates it with an Amazon EC2 instance.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[AllocateAddress function] -//snippet-keyword:[AssociateAddress function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Allocates a static IP address and associates it with an Amazon EC2 instance.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[AllocateAddress function] +// snippet-keyword:[AssociateAddress function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/ec2_create_keypair.go b/go/example_code/ec2/ec2_create_keypair.go index 61b43f38615..89ff486be96 100644 --- a/go/example_code/ec2/ec2_create_keypair.go +++ b/go/example_code/ec2/ec2_create_keypair.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an Amazon EC2 key pair.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[CreateKeyPair function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an Amazon EC2 key pair.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[CreateKeyPair function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/ec2_create_security_group.go b/go/example_code/ec2/ec2_create_security_group.go index 3dc83629fda..fdb87889cef 100644 --- a/go/example_code/ec2/ec2_create_security_group.go +++ b/go/example_code/ec2/ec2_create_security_group.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an EC2 security group.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[AuthorizeSecurityGroupIngress function] -//snippet-keyword:[CreateSecurityGroup function] -//snippet-keyword:[DescribeVpcs function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an EC2 security group.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[AuthorizeSecurityGroupIngress function] +// snippet-keyword:[CreateSecurityGroup function] +// snippet-keyword:[DescribeVpcs function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/ec2_delete_keypair.go b/go/example_code/ec2/ec2_delete_keypair.go index 2072284887a..e963f5a1a36 100644 --- a/go/example_code/ec2/ec2_delete_keypair.go +++ b/go/example_code/ec2/ec2_delete_keypair.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an Amazon EC2 key pair.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[DeleteKeyPair function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an Amazon EC2 key pair.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[DeleteKeyPair function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/ec2_delete_security_group.go b/go/example_code/ec2/ec2_delete_security_group.go index caed3c71d0d..6fd6738011f 100644 --- a/go/example_code/ec2/ec2_delete_security_group.go +++ b/go/example_code/ec2/ec2_delete_security_group.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an EC2 security group.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[DeleteSecurityGroup function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an EC2 security group.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[DeleteSecurityGroup function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/ec2_describe_addresses.go b/go/example_code/ec2/ec2_describe_addresses.go index 38602095111..acb5238f643 100644 --- a/go/example_code/ec2/ec2_describe_addresses.go +++ b/go/example_code/ec2/ec2_describe_addresses.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Describe your Amazon EC2 instance IP addresses.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[DescribeAddresses function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Describe your Amazon EC2 instance IP addresses.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[DescribeAddresses function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/ec2_describe_keypairs.go b/go/example_code/ec2/ec2_describe_keypairs.go index 4df1a54b774..a5e7df4122f 100644 --- a/go/example_code/ec2/ec2_describe_keypairs.go +++ b/go/example_code/ec2/ec2_describe_keypairs.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Describes your Amazon EC2 key pairs.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[DescribeKeyPairs function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Describes your Amazon EC2 key pairs.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[DescribeKeyPairs function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/ec2_describe_security_groups.go b/go/example_code/ec2/ec2_describe_security_groups.go index 65bef10d0ca..fa3262ca7db 100644 --- a/go/example_code/ec2/ec2_describe_security_groups.go +++ b/go/example_code/ec2/ec2_describe_security_groups.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Describes your EC2 security groups.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[DescribeSecurityGroups function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Describes your EC2 security groups.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[DescribeSecurityGroups function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/ec2_release_address.go b/go/example_code/ec2/ec2_release_address.go index d7b5d218def..c853d60798e 100644 --- a/go/example_code/ec2/ec2_release_address.go +++ b/go/example_code/ec2/ec2_release_address.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Releases an Amazon EC2 instance IP address.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[ReleaseAddress function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Releases an Amazon EC2 instance IP address.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[ReleaseAddress function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/monitoring_instances.go b/go/example_code/ec2/monitoring_instances.go index 9153b3dbe7c..ce1e3cf3946 100644 --- a/go/example_code/ec2/monitoring_instances.go +++ b/go/example_code/ec2/monitoring_instances.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Manages Amazon EC2 instance monitoring.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[MonitorInstances function] -//snippet-keyword:[UnmonitorInstances function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Manages Amazon EC2 instance monitoring.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[MonitorInstances function] +// snippet-keyword:[UnmonitorInstances function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/reboot_instances.go b/go/example_code/ec2/reboot_instances.go index 25969dc0d01..5b48f55a288 100644 --- a/go/example_code/ec2/reboot_instances.go +++ b/go/example_code/ec2/reboot_instances.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Reboots an Amazon EC2 instance.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[RebootInstances function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Reboots an Amazon EC2 instance.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[RebootInstances function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/regions_and_availability.go b/go/example_code/ec2/regions_and_availability.go index b54978977ee..1ee3ac39512 100644 --- a/go/example_code/ec2/regions_and_availability.go +++ b/go/example_code/ec2/regions_and_availability.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Retrieves details about AWS Regions and Availability Zones.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[DescribeAvailabilityZones function] -//snippet-keyword:[DescribeRegions function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Retrieves details about AWS Regions and Availability Zones.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[DescribeAvailabilityZones function] +// snippet-keyword:[DescribeRegions function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ec2/start_stop_instances.go b/go/example_code/ec2/start_stop_instances.go index 8f55776c67d..2253ea0de43 100644 --- a/go/example_code/ec2/start_stop_instances.go +++ b/go/example_code/ec2/start_stop_instances.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Starts and stops an Amazon EC2 instance.] -//snippet-keyword:[Amazon Elastic Compute Cloud] -//snippet-keyword:[StartInstances function] -//snippet-keyword:[StopInstances function] -//snippet-keyword:[Go] -//snippet-service:[ec2] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Starts and stops an Amazon EC2 instance.] +// snippet-keyword:[Amazon Elastic Compute Cloud] +// snippet-keyword:[StartInstances function] +// snippet-keyword:[StopInstances function] +// snippet-keyword:[Go] +// snippet-service:[ec2] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/extending_sdk/addHeader.go b/go/example_code/extending_sdk/addHeader.go index e5d8b0d9752..22fab9ae841 100644 --- a/go/example_code/extending_sdk/addHeader.go +++ b/go/example_code/extending_sdk/addHeader.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Adds a custom header to a DynamoDB table.] -//snippet-keyword:[Amazon DynamoDB] -//snippet-keyword:[Handlers.Send.PushFront function] -//snippet-keyword:[ListTables function] -//snippet-keyword:[Go] -//snippet-service:[dynamodb] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Adds a custom header to a DynamoDB table.] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Handlers.Send.PushFront function] +// snippet-keyword:[ListTables function] +// snippet-keyword:[Go] +// snippet-service:[dynamodb] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/extending_sdk/addTags.go b/go/example_code/extending_sdk/addTags.go index a1409c41257..2db20163db8 100644 --- a/go/example_code/extending_sdk/addTags.go +++ b/go/example_code/extending_sdk/addTags.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Adds tags to an S3 bucket and displays its tags.] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[GetBucketTagging function] -//snippet-keyword:[PutBucketTagging function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Adds tags to an S3 bucket and displays its tags.] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[GetBucketTagging function] +// snippet-keyword:[PutBucketTagging function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/extending_sdk/ecs/update_deployment_with_setters.go b/go/example_code/extending_sdk/ecs/update_deployment_with_setters.go index 7ffea9d5384..0e7f914d2e8 100644 --- a/go/example_code/extending_sdk/ecs/update_deployment_with_setters.go +++ b/go/example_code/extending_sdk/ecs/update_deployment_with_setters.go @@ -1,12 +1,12 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Uses chainable setters on nested fields in an API operation request.] -//snippet-keyword:[Extending the SDK] -//snippet-keyword:[UpdateService function] -//snippet-keyword:[Go] -//snippet-service:[aws-go-sdk] -//snippet-sourcetype:[snippet] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Uses chainable setters on nested fields in an API operation request.] +// snippet-keyword:[Extending the SDK] +// snippet-keyword:[UpdateService function] +// snippet-keyword:[Go] +// snippet-service:[aws-go-sdk] +// snippet-sourcetype:[snippet] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/extending_sdk/handleServiceErrorCodes.go b/go/example_code/extending_sdk/handleServiceErrorCodes.go index ceb007588b3..011e5ab9107 100644 --- a/go/example_code/extending_sdk/handleServiceErrorCodes.go +++ b/go/example_code/extending_sdk/handleServiceErrorCodes.go @@ -1,11 +1,12 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Handling Errors in the AWS SDK for Go.] -//snippet-keyword:[Error handling] -//snippet-keyword:[Go] -//snippet-service:[sdk-for-go] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Handling Errors in the AWS SDK for Go.] +// snippet-keyword:[Error handling] +// snippet-keyword:[Go] +// snippet-service:[sdk-for-go] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/extending_sdk/request_context.go b/go/example_code/extending_sdk/request_context.go index 1c0c835e383..fcaf9ff4a94 100644 --- a/go/example_code/extending_sdk/request_context.go +++ b/go/example_code/extending_sdk/request_context.go @@ -1,11 +1,11 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Using context.Context with SDK requests.] -//snippet-keyword:[Extending the SDK] -//snippet-keyword:[Go] -//snippet-service:[aws-go-sdk] -//snippet-sourcetype:[snippet] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Using context.Context with SDK requests.] +// snippet-keyword:[Extending the SDK] +// snippet-keyword:[Go] +// snippet-service:[aws-go-sdk] +// snippet-sourcetype:[snippet] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/glacier/create_vault.go b/go/example_code/glacier/create_vault.go index 6442d307f78..0e431ed9b39 100644 --- a/go/example_code/glacier/create_vault.go +++ b/go/example_code/glacier/create_vault.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates a Glacier vault.] -//snippet-keyword:[Amazon Glacier] -//snippet-keyword:[CreateVault function] -//snippet-keyword:[Go] -//snippet-service:[glacier] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates a Glacier vault.] +// snippet-keyword:[Amazon Glacier] +// snippet-keyword:[CreateVault function] +// snippet-keyword:[Go] +// snippet-service:[glacier] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/glacier/upload_archive.go b/go/example_code/glacier/upload_archive.go index 670f350797b..4376886aeb1 100644 --- a/go/example_code/glacier/upload_archive.go +++ b/go/example_code/glacier/upload_archive.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Upload a single reader object as an entire archive.] -//snippet-keyword:[Amazon Glacier] -//snippet-keyword:[UploadArchive function] -//snippet-keyword:[Go] -//snippet-service:[glacier] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Upload a single reader object as an entire archive.] +// snippet-keyword:[Amazon Glacier] +// snippet-keyword:[UploadArchive function] +// snippet-keyword:[Go] +// snippet-service:[glacier] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/IamListAdmins.go b/go/example_code/iam/IamListAdmins.go index cef3928e12a..ecc2867de9a 100644 --- a/go/example_code/iam/IamListAdmins.go +++ b/go/example_code/iam/IamListAdmins.go @@ -1,15 +1,16 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the IAM users that have adminstrator privileges.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[ListGroupPolicies function] -//snippet-keyword:[ListAttachedGroupPolicies function] -//snippet-keyword:[ListGroupsForUser function] -//snippet-keyword:[GetAccountAuthorizationDetails function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the IAM users that have adminstrator privileges.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[ListGroupPolicies function] +// snippet-keyword:[ListAttachedGroupPolicies function] +// snippet-keyword:[ListGroupsForUser function] +// snippet-keyword:[GetAccountAuthorizationDetails function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_accesskeylastused.go b/go/example_code/iam/iam_accesskeylastused.go index 302c6cb2ea5..ed0272ee007 100644 --- a/go/example_code/iam/iam_accesskeylastused.go +++ b/go/example_code/iam/iam_accesskeylastused.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Determines when an IAM access key was last used.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[GetAccessKeyLastUsed function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Determines when an IAM access key was last used.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[GetAccessKeyLastUsed function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_attachuserpolicy.go b/go/example_code/iam/iam_attachuserpolicy.go index 09b4a9283e7..207f8a694bd 100644 --- a/go/example_code/iam/iam_attachuserpolicy.go +++ b/go/example_code/iam/iam_attachuserpolicy.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Attaches an IAM policy.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[AttachRolePolicy function] -//snippet-keyword:[ListAttachedRolePoliciesPages function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Attaches an IAM policy.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[AttachRolePolicy function] +// snippet-keyword:[ListAttachedRolePoliciesPages function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_createaccesskey.go b/go/example_code/iam/iam_createaccesskey.go index 7e76c9f7760..8cb04a02183 100644 --- a/go/example_code/iam/iam_createaccesskey.go +++ b/go/example_code/iam/iam_createaccesskey.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an IAM access key.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[CreateAccessKey function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an IAM access key.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[CreateAccessKey function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_createaccountalias.go b/go/example_code/iam/iam_createaccountalias.go index ca0c51f971c..9ca11ea8333 100644 --- a/go/example_code/iam/iam_createaccountalias.go +++ b/go/example_code/iam/iam_createaccountalias.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an IAM account alias.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[CreateAccountAlias function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an IAM account alias.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[CreateAccountAlias function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_createpolicy.go b/go/example_code/iam/iam_createpolicy.go index c6ef2f390f6..99ac814740b 100644 --- a/go/example_code/iam/iam_createpolicy.go +++ b/go/example_code/iam/iam_createpolicy.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an IAM policy.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[CreatePolicy function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an IAM policy.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[CreatePolicy function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_createuser.go b/go/example_code/iam/iam_createuser.go index b5569e27190..cec74e90ed9 100644 --- a/go/example_code/iam/iam_createuser.go +++ b/go/example_code/iam/iam_createuser.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an IAM user.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[CreateUser function] -//snippet-keyword:[GetUser function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an IAM user.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[CreateUser function] +// snippet-keyword:[GetUser function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_deleteaccesskey.go b/go/example_code/iam/iam_deleteaccesskey.go index 7383f20a683..76b68c67941 100644 --- a/go/example_code/iam/iam_deleteaccesskey.go +++ b/go/example_code/iam/iam_deleteaccesskey.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an IAM access key.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[DeleteAccessKey function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an IAM access key.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[DeleteAccessKey function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_deleteaccountalias.go b/go/example_code/iam/iam_deleteaccountalias.go index 53bfa3b8907..f09f8ca17a8 100644 --- a/go/example_code/iam/iam_deleteaccountalias.go +++ b/go/example_code/iam/iam_deleteaccountalias.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an IAM account alias.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[DeleteAccountAlias function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an IAM account alias.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[DeleteAccountAlias function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_deleteservercert.go b/go/example_code/iam/iam_deleteservercert.go index b74a67ef59c..6d29e056a3c 100644 --- a/go/example_code/iam/iam_deleteservercert.go +++ b/go/example_code/iam/iam_deleteservercert.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes a server certificate.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[DeleteServerCertificate function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes a server certificate.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[DeleteServerCertificate function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_deleteuser.go b/go/example_code/iam/iam_deleteuser.go index b6763acc072..d87e7c174ab 100644 --- a/go/example_code/iam/iam_deleteuser.go +++ b/go/example_code/iam/iam_deleteuser.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an IAM user.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[DeleteUser function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an IAM user.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[DeleteUser function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_detachuserpolicy.go b/go/example_code/iam/iam_detachuserpolicy.go index 183469f052a..1596784db07 100644 --- a/go/example_code/iam/iam_detachuserpolicy.go +++ b/go/example_code/iam/iam_detachuserpolicy.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Detaches an IAM policy.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[DetachRolePolicy function] -//snippet-keyword:[ListAttachedRolePoliciesPages function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Detaches an IAM policy.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[DetachRolePolicy function] +// snippet-keyword:[ListAttachedRolePoliciesPages function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_getpolicy.go b/go/example_code/iam/iam_getpolicy.go index a59f04ad12e..1543484fb8a 100644 --- a/go/example_code/iam/iam_getpolicy.go +++ b/go/example_code/iam/iam_getpolicy.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets an IAM policy.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[GetPolicy function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets an IAM policy.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[GetPolicy function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_getpublickeys.go b/go/example_code/iam/iam_getpublickeys.go index 388193eb717..a2f2d793479 100644 --- a/go/example_code/iam/iam_getpublickeys.go +++ b/go/example_code/iam/iam_getpublickeys.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets an IAM public key.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[GetSSHPublicKey function] -//snippet-keyword:[ListSSHPublicKeys function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets an IAM public key.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[GetSSHPublicKey function] +// snippet-keyword:[ListSSHPublicKeys function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_getservercert.go b/go/example_code/iam/iam_getservercert.go index 91d5ca78571..4f8e82d250f 100644 --- a/go/example_code/iam/iam_getservercert.go +++ b/go/example_code/iam/iam_getservercert.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Retries an IAM server certificate.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[GetServerCertificate function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Retries an IAM server certificate.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[GetServerCertificate function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_listaccesskeys.go b/go/example_code/iam/iam_listaccesskeys.go index 8ec63e8529c..e32a8526839 100644 --- a/go/example_code/iam/iam_listaccesskeys.go +++ b/go/example_code/iam/iam_listaccesskeys.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists your IAM access keys.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[ListAccessKeys function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists your IAM access keys.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[ListAccessKeys function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_listaccountaliases.go b/go/example_code/iam/iam_listaccountaliases.go index 1f5b3955284..2bfd2c87859 100644 --- a/go/example_code/iam/iam_listaccountaliases.go +++ b/go/example_code/iam/iam_listaccountaliases.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists your IAM account aliases.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[ListAccountAliases function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists your IAM account aliases.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[ListAccountAliases function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_listservercerts.go b/go/example_code/iam/iam_listservercerts.go index 8266c4237a5..e470869c613 100644 --- a/go/example_code/iam/iam_listservercerts.go +++ b/go/example_code/iam/iam_listservercerts.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists your IAM server certificates.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[ListServerCertificates function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists your IAM server certificates.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[ListServerCertificates function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_listusers.go b/go/example_code/iam/iam_listusers.go index d244fd2e56a..376b25bd21d 100644 --- a/go/example_code/iam/iam_listusers.go +++ b/go/example_code/iam/iam_listusers.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists your IAM users.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[ListUsers function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists your IAM users.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[ListUsers function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_updateaccesskey.go b/go/example_code/iam/iam_updateaccesskey.go index f88407be384..c833959c2c1 100644 --- a/go/example_code/iam/iam_updateaccesskey.go +++ b/go/example_code/iam/iam_updateaccesskey.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Updates an IAM access key.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[UpdateAccessKey function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Updates an IAM access key.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[UpdateAccessKey function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_updateservercert.go b/go/example_code/iam/iam_updateservercert.go index b5ea39e22ed..2d83744a449 100644 --- a/go/example_code/iam/iam_updateservercert.go +++ b/go/example_code/iam/iam_updateservercert.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Updates an IAM server certificate.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[UpdateServerCertificate function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Updates an IAM server certificate.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[UpdateServerCertificate function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/iam/iam_updateuser.go b/go/example_code/iam/iam_updateuser.go index 2281e9996fd..839b1452609 100644 --- a/go/example_code/iam/iam_updateuser.go +++ b/go/example_code/iam/iam_updateuser.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Udates an IAM user.] -//snippet-keyword:[AWS Identity and Access Management] -//snippet-keyword:[UpdateUser function] -//snippet-keyword:[Go] -//snippet-service:[iam] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Udates an IAM user.] +// snippet-keyword:[AWS Identity and Access Management] +// snippet-keyword:[UpdateUser function] +// snippet-keyword:[Go] +// snippet-service:[iam] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/kms/kms_create_key.go b/go/example_code/kms/kms_create_key.go index 3082f3a7eeb..f9844603280 100644 --- a/go/example_code/kms/kms_create_key.go +++ b/go/example_code/kms/kms_create_key.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates a KMS key.] -//snippet-keyword:[AWS Key Management Service] -//snippet-keyword:[CreateKey function] -//snippet-keyword:[Go] -//snippet-service:[kms] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates a KMS key.] +// snippet-keyword:[AWS Key Management Service] +// snippet-keyword:[CreateKey function] +// snippet-keyword:[Go] +// snippet-service:[kms] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/kms/kms_decrypt_data.go b/go/example_code/kms/kms_decrypt_data.go index 803b6a4895e..064520fc1c5 100644 --- a/go/example_code/kms/kms_decrypt_data.go +++ b/go/example_code/kms/kms_decrypt_data.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Decrypts a string that was encrypted by KMS.] -//snippet-keyword:[AWS Key Management Service] -//snippet-keyword:[Decrypt function] -//snippet-keyword:[Go] -//snippet-service:[kms] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Decrypts a string that was encrypted by KMS.] +// snippet-keyword:[AWS Key Management Service] +// snippet-keyword:[Decrypt function] +// snippet-keyword:[Go] +// snippet-service:[kms] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/kms/kms_encrypt_data.go b/go/example_code/kms/kms_encrypt_data.go index e5b3a5ddd93..382767f6a4c 100644 --- a/go/example_code/kms/kms_encrypt_data.go +++ b/go/example_code/kms/kms_encrypt_data.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Encrypts a string using KMS.] -//snippet-keyword:[AWS Key Management Service] -//snippet-keyword:[Encrypt function] -//snippet-keyword:[Go] -//snippet-service:[kms] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Encrypts a string using KMS.] +// snippet-keyword:[AWS Key Management Service] +// snippet-keyword:[Encrypt function] +// snippet-keyword:[Go] +// snippet-service:[kms] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/kms/kms_re_encrypt_data.go b/go/example_code/kms/kms_re_encrypt_data.go index e737e710630..a7b540bda5d 100644 --- a/go/example_code/kms/kms_re_encrypt_data.go +++ b/go/example_code/kms/kms_re_encrypt_data.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Decrypts encrypted data and then immediately re-encrypts data under a new customer master key (CMK).] -//snippet-keyword:[AWS Key Management Service] -//snippet-keyword:[ReEncrypt function] -//snippet-keyword:[Go] -//snippet-service:[kms] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Decrypts encrypted data and then immediately re-encrypts data under a new customer master key (CMK).] +// snippet-keyword:[AWS Key Management Service] +// snippet-keyword:[ReEncrypt function] +// snippet-keyword:[Go] +// snippet-service:[kms] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/lambda/aws-go-sdk-lambda-example-configure-function-for-notification.go b/go/example_code/lambda/aws-go-sdk-lambda-example-configure-function-for-notification.go index 823f2c05604..a7088d73073 100644 --- a/go/example_code/lambda/aws-go-sdk-lambda-example-configure-function-for-notification.go +++ b/go/example_code/lambda/aws-go-sdk-lambda-example-configure-function-for-notification.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Configures a Lambda function to accept notifications from a resource.] -//snippet-keyword:[AWS Lambda] -//snippet-keyword:[AddPermission function] -//snippet-keyword:[Go] -//snippet-service:[lambda] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Configures a Lambda function to accept notifications from a resource.] +// snippet-keyword:[AWS Lambda] +// snippet-keyword:[AddPermission function] +// snippet-keyword:[Go] +// snippet-service:[lambda] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/lambda/aws-go-sdk-lambda-example-create-function.go b/go/example_code/lambda/aws-go-sdk-lambda-example-create-function.go index 21cdbdd4e0f..1e6429ddfaa 100644 --- a/go/example_code/lambda/aws-go-sdk-lambda-example-create-function.go +++ b/go/example_code/lambda/aws-go-sdk-lambda-example-create-function.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates a Lambda function.] -//snippet-keyword:[AWS Lambda] -//snippet-keyword:[CreateFunction function] -//snippet-keyword:[Go] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates a Lambda function.] +// snippet-keyword:[AWS Lambda] +// snippet-keyword:[CreateFunction function] +// snippet-keyword:[Go] // snippet-keyword:[Code Sample] -//snippet-service:[lambda] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2019-1-11] +// snippet-service:[lambda] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-1-11] /* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -21,7 +22,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -//snippet-start:[lambda.go.create_function.complete] +// snippet-start:[lambda.go.create_function.complete] package main import ( @@ -98,4 +99,4 @@ func main() { createFunction(zipFile, bucketName, functionName, handler, resourceArn, runtime) } -//snippet-end:[lambda.go.create_function.complete] \ No newline at end of file +// snippet-end:[lambda.go.create_function.complete] \ No newline at end of file diff --git a/go/example_code/lambda/aws-go-sdk-lambda-example-run-function.go b/go/example_code/lambda/aws-go-sdk-lambda-example-run-function.go index 4e788a51b11..e308fe40e6d 100644 --- a/go/example_code/lambda/aws-go-sdk-lambda-example-run-function.go +++ b/go/example_code/lambda/aws-go-sdk-lambda-example-run-function.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Runs a Lambda function.] -//snippet-keyword:[AWS Lambda] -//snippet-keyword:[Invoke function] -//snippet-keyword:[Go] -//snippet-service:[lambda] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Runs a Lambda function.] +// snippet-keyword:[AWS Lambda] +// snippet-keyword:[Invoke function] +// snippet-keyword:[Go] +// snippet-service:[lambda] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/lambda/aws-go-sdk-lambda-example-show-functions.go b/go/example_code/lambda/aws-go-sdk-lambda-example-show-functions.go index 12a654da507..6df83744e20 100644 --- a/go/example_code/lambda/aws-go-sdk-lambda-example-show-functions.go +++ b/go/example_code/lambda/aws-go-sdk-lambda-example-show-functions.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists your Lambda functions.] -//snippet-keyword:[AWS Lambda] -//snippet-keyword:[ListFunctions function] -//snippet-keyword:[Go] -//snippet-service:[lambda] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists your Lambda functions.] +// snippet-keyword:[AWS Lambda] +// snippet-keyword:[ListFunctions function] +// snippet-keyword:[Go] +// snippet-service:[lambda] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/polly/pollyDescribeVoices.go b/go/example_code/polly/pollyDescribeVoices.go index 440b6a453bf..ecfeb49f2bc 100644 --- a/go/example_code/polly/pollyDescribeVoices.go +++ b/go/example_code/polly/pollyDescribeVoices.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the Polly voices.] -//snippet-keyword:[Amazon Polly] -//snippet-keyword:[DescribeVoices function] -//snippet-keyword:[Go] -//snippet-service:[polly] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the Polly voices.] +// snippet-keyword:[Amazon Polly] +// snippet-keyword:[DescribeVoices function] +// snippet-keyword:[Go] +// snippet-service:[polly] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/polly/pollyListLexicons.go b/go/example_code/polly/pollyListLexicons.go index 8c23c867ffb..d18f9d07bbe 100644 --- a/go/example_code/polly/pollyListLexicons.go +++ b/go/example_code/polly/pollyListLexicons.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the Polly lexicons.] -//snippet-keyword:[Amazon Polly] -//snippet-keyword:[ListLexicons function] -//snippet-keyword:[Go] -//snippet-service:[polly] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the Polly lexicons.] +// snippet-keyword:[Amazon Polly] +// snippet-keyword:[ListLexicons function] +// snippet-keyword:[Go] +// snippet-service:[polly] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/polly/pollySynthesizeSpeech.go b/go/example_code/polly/pollySynthesizeSpeech.go index 135376f0b18..c66b188d066 100644 --- a/go/example_code/polly/pollySynthesizeSpeech.go +++ b/go/example_code/polly/pollySynthesizeSpeech.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets text from a file and produces an MP3 file containing the synthesized speech.] -//snippet-keyword:[Amazon Polly] -//snippet-keyword:[SynthesizeSpeech function] -//snippet-keyword:[Go] -//snippet-service:[polly] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets text from a file and produces an MP3 file containing the synthesized speech.] +// snippet-keyword:[Amazon Polly] +// snippet-keyword:[SynthesizeSpeech function] +// snippet-keyword:[Go] +// snippet-service:[polly] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/create_new_bucket_and_object.go b/go/example_code/s3/create_new_bucket_and_object.go index e6e9e6191a4..afa362f7ce0 100644 --- a/go/example_code/s3/create_new_bucket_and_object.go +++ b/go/example_code/s3/create_new_bucket_and_object.go @@ -1,15 +1,16 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an S3 bucket and adds an item to it.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[CreateBucket function] -//snippet-keyword:[PutObject function] -//snippet-keyword:[WaitUntilBucketExists function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an S3 bucket and adds an item to it.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[CreateBucket function] +// snippet-keyword:[PutObject function] +// snippet-keyword:[WaitUntilBucketExists function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/enforce_content_md5.go b/go/example_code/s3/enforce_content_md5.go index 865bbd1049b..325524be228 100644 --- a/go/example_code/s3/enforce_content_md5.go +++ b/go/example_code/s3/enforce_content_md5.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Enforces MD5 checksum on items uploaded to an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[PutObjectRequest function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Enforces MD5 checksum on items uploaded to an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[PutObjectRequest function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/generate_presigned_url.go b/go/example_code/s3/generate_presigned_url.go index 146b8277ace..c7564653901 100644 --- a/go/example_code/s3/generate_presigned_url.go +++ b/go/example_code/s3/generate_presigned_url.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Generates a pre-signed URL for an S3 bucket item.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[GetObjectRequest function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Generates a pre-signed URL for an S3 bucket item.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[GetObjectRequest function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/generate_presigned_url_specific_payload.go b/go/example_code/s3/generate_presigned_url_specific_payload.go index b216b180cd6..be6199fdd4a 100644 --- a/go/example_code/s3/generate_presigned_url_specific_payload.go +++ b/go/example_code/s3/generate_presigned_url_specific_payload.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Generates a pre-signed URL for a PUT operation that checks whether the expected content was uploaded.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[PutObjectRequest function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Generates a pre-signed URL for a PUT operation that checks whether the expected content was uploaded.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[PutObjectRequest function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/list_all_buckets.go b/go/example_code/s3/list_all_buckets.go index 35cf821d44a..ff01cd000a4 100644 --- a/go/example_code/s3/list_all_buckets.go +++ b/go/example_code/s3/list_all_buckets.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists all of your S3 buckets.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[ListBuckets function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists all of your S3 buckets.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[ListBuckets function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/put_object_with_setters.go b/go/example_code/s3/put_object_with_setters.go index 67755e6db6f..b3739f3fb5b 100644 --- a/go/example_code/s3/put_object_with_setters.go +++ b/go/example_code/s3/put_object_with_setters.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Using API field setters with SDK requests.] -//snippet-keyword:[Extending the SDK] -//snippet-keyword:[PutObject function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Using API field setters with SDK requests.] +// snippet-keyword:[Extending the SDK] +// snippet-keyword:[PutObject function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3.go b/go/example_code/s3/s3.go new file mode 100644 index 00000000000..0fe699e208d --- /dev/null +++ b/go/example_code/s3/s3.go @@ -0,0 +1,123 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +// snippet-sourcedescription:[s3.go demonstrates how to list, create, and delete a bucket in Amazon S3.] +// snippet-service:[s3] +// snippet-keyword:[Go] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ListBuckets] +// snippet-keyword:[CreateBucket] +// snippet-keyword:[DeleteBucket] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2017-07-11] +// snippet-sourceauthor:[AWS] +// snippet-start:[s3.go.bucket_operations.list_create_delete] +package main + +import ( + "fmt" + "os" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/s3" +) + +func main() { + + if len(os.Args) < 3 { + fmt.Printf("Usage: go run s3.go \n" + + "Example: go run s3.go my-test-bucket us-east-2\n") + os.Exit(1) + } + + sess := session.Must(session.NewSessionWithOptions(session.Options{ + SharedConfigState: session.SharedConfigEnable, + })) + svc := s3.New(sess, &aws.Config{ + Region: aws.String(os.Args[2]), + }) + + listMyBuckets(svc) + createMyBucket(svc, os.Args[1], os.Args[2]) + listMyBuckets(svc) + deleteMyBucket(svc, os.Args[1]) + listMyBuckets(svc) +} + +// List all of your available buckets in this AWS Region. +func listMyBuckets(svc *s3.S3) { + result, err := svc.ListBuckets(nil) + + if err != nil { + exitErrorf("Unable to list buckets, %v", err) + } + + fmt.Println("My buckets now are:\n") + + for _, b := range result.Buckets { + fmt.Printf(aws.StringValue(b.Name) + "\n") + } + + fmt.Printf("\n") +} + +// Create a bucket in this AWS Region. +func createMyBucket(svc *s3.S3, bucketName string, region string) { + fmt.Printf("\nCreating a new bucket named '" + bucketName + "'...\n\n") + + _, err := svc.CreateBucket(&s3.CreateBucketInput{ + Bucket: aws.String(bucketName), + CreateBucketConfiguration: &s3.CreateBucketConfiguration{ + LocationConstraint: aws.String(region), + }, + }) + + if err != nil { + exitErrorf("Unable to create bucket, %v", err) + } + + // Wait until bucket is created before finishing + fmt.Printf("Waiting for bucket %q to be created...\n", bucketName) + + err = svc.WaitUntilBucketExists(&s3.HeadBucketInput{ + Bucket: aws.String(bucketName), + }) +} + +// Delete the bucket you just created. +func deleteMyBucket(svc *s3.S3, bucketName string) { + fmt.Printf("\nDeleting the bucket named '" + bucketName + "'...\n\n") + + _, err := svc.DeleteBucket(&s3.DeleteBucketInput{ + Bucket: aws.String(bucketName), + }) + + if err != nil { + exitErrorf("Unable to delete bucket, %v", err) + } + + // Wait until bucket is deleted before finishing + fmt.Printf("Waiting for bucket %q to be deleted...\n", bucketName) + + err = svc.WaitUntilBucketNotExists(&s3.HeadBucketInput{ + Bucket: aws.String(bucketName), + }) +} + +// If there's an error, display it. +func exitErrorf(msg string, args ...interface{}) { + fmt.Fprintf(os.Stderr, msg+"\n", args...) + os.Exit(1) +} +// snippet-end:[s3.go.bucket_operations.list_create_delete] diff --git a/go/example_code/s3/s3_copy_object.go b/go/example_code/s3/s3_copy_object.go index 333929c028b..a629234ac68 100644 --- a/go/example_code/s3/s3_copy_object.go +++ b/go/example_code/s3/s3_copy_object.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Copies a bucket item to another bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[CopyObject function] -//snippet-keyword:[WaitUntilObjectExists function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Copies a bucket item to another bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[CopyObject function] +// snippet-keyword:[WaitUntilObjectExists function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_create_bucket.go b/go/example_code/s3/s3_create_bucket.go index 37bd69175a3..427a5423ca2 100644 --- a/go/example_code/s3/s3_create_bucket.go +++ b/go/example_code/s3/s3_create_bucket.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[CreateBucket function] -//snippet-keyword:[WaitUntilBucketExists function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[CreateBucket function] +// snippet-keyword:[WaitUntilBucketExists function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_delete_bucket.go b/go/example_code/s3/s3_delete_bucket.go index 25968f850d1..db8f801ba0b 100644 --- a/go/example_code/s3/s3_delete_bucket.go +++ b/go/example_code/s3/s3_delete_bucket.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[DeleteBucket function] -//snippet-keyword:[WaitUntilBucketNotExists function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[DeleteBucket function] +// snippet-keyword:[WaitUntilBucketNotExists function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_delete_bucket_policy.go b/go/example_code/s3/s3_delete_bucket_policy.go index 2a7047ea4b5..0f416943ea7 100644 --- a/go/example_code/s3/s3_delete_bucket_policy.go +++ b/go/example_code/s3/s3_delete_bucket_policy.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes a policy for an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[DeleteBucketPolicy function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes a policy for an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[DeleteBucketPolicy function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_delete_bucket_website.go b/go/example_code/s3/s3_delete_bucket_website.go index 209e72807af..83ba76a4019 100644 --- a/go/example_code/s3/s3_delete_bucket_website.go +++ b/go/example_code/s3/s3_delete_bucket_website.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes the website configuration on an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[DeleteBucketWebsite function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes the website configuration on an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[DeleteBucketWebsite function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_delete_object.go b/go/example_code/s3/s3_delete_object.go index 6f550927221..00cbf22bf52 100644 --- a/go/example_code/s3/s3_delete_object.go +++ b/go/example_code/s3/s3_delete_object.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an item from an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[DeleteObject function] -//snippet-keyword:[WaitUntilObjectNotExists function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an item from an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[DeleteObject function] +// snippet-keyword:[WaitUntilObjectNotExists function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_delete_objects.go b/go/example_code/s3/s3_delete_objects.go index df536f384cc..e2e8a710f90 100644 --- a/go/example_code/s3/s3_delete_objects.go +++ b/go/example_code/s3/s3_delete_objects.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes all of the items in an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[s3manager.NewBatchDeleteWithClient function] -//snippet-keyword:[s3manager.NewDeleteListIterator function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes all of the items in an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[s3manager.NewBatchDeleteWithClient function] +// snippet-keyword:[s3manager.NewDeleteListIterator function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_download_object.go b/go/example_code/s3/s3_download_object.go index eb27451dd9b..45bac1135d2 100644 --- a/go/example_code/s3/s3_download_object.go +++ b/go/example_code/s3/s3_download_object.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[s3manager.NewDownloader] -//snippet-keyword:[Download function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[s3manager.NewDownloader] +// snippet-keyword:[Download function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_encrypt_on_server_with_kms.go b/go/example_code/s3/s3_encrypt_on_server_with_kms.go index fdb4a13bbfe..8cdf2983320 100644 --- a/go/example_code/s3/s3_encrypt_on_server_with_kms.go +++ b/go/example_code/s3/s3_encrypt_on_server_with_kms.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Adds an item to an S3 bucket with server-side encryption set to AWS KMS.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[PutObject function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Adds an item to an S3 bucket with server-side encryption set to AWS KMS.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[PutObject function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_get_bucket_acl.go b/go/example_code/s3/s3_get_bucket_acl.go index fadcdcd9a44..cf21a007f81 100644 --- a/go/example_code/s3/s3_get_bucket_acl.go +++ b/go/example_code/s3/s3_get_bucket_acl.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets the ACLs for an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[GetBucketAcl function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets the ACLs for an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[GetBucketAcl function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_get_bucket_object_acl.go b/go/example_code/s3/s3_get_bucket_object_acl.go index a5634a99ebf..402e39ad2f6 100644 --- a/go/example_code/s3/s3_get_bucket_object_acl.go +++ b/go/example_code/s3/s3_get_bucket_object_acl.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets the ACLs for an S3 bucket item.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[GetObjectAcl function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets the ACLs for an S3 bucket item.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[GetObjectAcl function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_get_bucket_policy.go b/go/example_code/s3/s3_get_bucket_policy.go index 953094617b0..e103b2da5b6 100644 --- a/go/example_code/s3/s3_get_bucket_policy.go +++ b/go/example_code/s3/s3_get_bucket_policy.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets the policy of an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[GetBucketPolicy function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets the policy of an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[GetBucketPolicy function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_get_bucket_website.go b/go/example_code/s3/s3_get_bucket_website.go index c8b207917d3..85b223e2171 100644 --- a/go/example_code/s3/s3_get_bucket_website.go +++ b/go/example_code/s3/s3_get_bucket_website.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets the website configuration for an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[GetBucketWebsite function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets the website configuration for an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[GetBucketWebsite function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_list_buckets.go b/go/example_code/s3/s3_list_buckets.go index 487c1df03b7..dbab765b641 100644 --- a/go/example_code/s3/s3_list_buckets.go +++ b/go/example_code/s3/s3_list_buckets.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists your S3 buckets.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[ListBuckets function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists your S3 buckets.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[ListBuckets function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_list_objects.go b/go/example_code/s3/s3_list_objects.go index f0d05679c5b..841c6d7a56a 100644 --- a/go/example_code/s3/s3_list_objects.go +++ b/go/example_code/s3/s3_list_objects.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the items in an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[ListObjects function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the items in an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[ListObjects function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_make_bucket_public.go b/go/example_code/s3/s3_make_bucket_public.go index 64aad77fb6d..e52d5a01c62 100644 --- a/go/example_code/s3/s3_make_bucket_public.go +++ b/go/example_code/s3/s3_make_bucket_public.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Makes an S3 bucket public.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[PutBucketAcl function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Makes an S3 bucket public.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[PutBucketAcl function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_put_bucket_acl.go b/go/example_code/s3/s3_put_bucket_acl.go index 0ac400d792a..368d23127e8 100644 --- a/go/example_code/s3/s3_put_bucket_acl.go +++ b/go/example_code/s3/s3_put_bucket_acl.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Sets the ACL on an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[GetBucketAcl function] -//snippet-keyword:[PutBucketAcl function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Sets the ACL on an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[GetBucketAcl function] +// snippet-keyword:[PutBucketAcl function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_put_bucket_object_acl.go b/go/example_code/s3/s3_put_bucket_object_acl.go index 1006a8ba844..bafab876a76 100644 --- a/go/example_code/s3/s3_put_bucket_object_acl.go +++ b/go/example_code/s3/s3_put_bucket_object_acl.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Sets the ACL on an S3 bucket item.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[GetObjectAcl function] -//snippet-keyword:[PutObjectAcl function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Sets the ACL on an S3 bucket item.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[GetObjectAcl function] +// snippet-keyword:[PutObjectAcl function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_require_server_encryption.go b/go/example_code/s3/s3_require_server_encryption.go index deaf9ec6263..25b4bf624e6 100644 --- a/go/example_code/s3/s3_require_server_encryption.go +++ b/go/example_code/s3/s3_require_server_encryption.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Adds a policy to an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[PutBucketPolicy function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Adds a policy to an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[PutBucketPolicy function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_restore_object.go b/go/example_code/s3/s3_restore_object.go index 91d896efb9d..9d4c04d76ad 100644 --- a/go/example_code/s3/s3_restore_object.go +++ b/go/example_code/s3/s3_restore_object.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Restores an item in an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[RestoreObject function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Restores an item in an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[RestoreObject function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_set_bucket_policy.go b/go/example_code/s3/s3_set_bucket_policy.go index 2df84196923..57bc3e145ec 100644 --- a/go/example_code/s3/s3_set_bucket_policy.go +++ b/go/example_code/s3/s3_set_bucket_policy.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Sets the policy for an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[PutBucketPolicy function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Sets the policy for an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[PutBucketPolicy function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_set_bucket_website.go b/go/example_code/s3/s3_set_bucket_website.go index e760a84cadf..efb279292cf 100644 --- a/go/example_code/s3/s3_set_bucket_website.go +++ b/go/example_code/s3/s3_set_bucket_website.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Sets the website configuration for an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[PutBucketWebsite function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Sets the website configuration for an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[PutBucketWebsite function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_set_cors.go b/go/example_code/s3/s3_set_cors.go index 0b2a460405f..5eecaf9caf9 100644 --- a/go/example_code/s3/s3_set_cors.go +++ b/go/example_code/s3/s3_set_cors.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Sets CORS permission on an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[PutBucketCors function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Sets CORS permission on an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[PutBucketCors function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_set_default_encryption.go b/go/example_code/s3/s3_set_default_encryption.go index 0559b457c0a..710aa573ece 100644 --- a/go/example_code/s3/s3_set_default_encryption.go +++ b/go/example_code/s3/s3_set_default_encryption.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Enables KMS server-side encryption on any objects added to to an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[PutBucketEncryption function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Enables KMS server-side encryption on any objects added to to an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[PutBucketEncryption function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/s3_upload_object.go b/go/example_code/s3/s3_upload_object.go index fc89640cac2..37f4d52a3eb 100644 --- a/go/example_code/s3/s3_upload_object.go +++ b/go/example_code/s3/s3_upload_object.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Uploads a file to an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[s3manager.NewUploader] -//snippet-keyword:[Upload function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Uploads a file to an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[s3manager.NewUploader] +// snippet-keyword:[Upload function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/s3/upload_arbitrary_sized_stream.go b/go/example_code/s3/upload_arbitrary_sized_stream.go index e83de891671..8fce5538abe 100644 --- a/go/example_code/s3/upload_arbitrary_sized_stream.go +++ b/go/example_code/s3/upload_arbitrary_sized_stream.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Uploads a file, as a stream, to an S3 bucket.] -//snippet-keyword:[Amazon Simple Storage Service] -//snippet-keyword:[Amazon S3] -//snippet-keyword:[s3manager.NewUploader] -//snippet-keyword:[Upload function] -//snippet-keyword:[Go] -//snippet-service:[s3] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Uploads a file, as a stream, to an S3 bucket.] +// snippet-keyword:[Amazon Simple Storage Service] +// snippet-keyword:[Amazon S3] +// snippet-keyword:[s3manager.NewUploader] +// snippet-keyword:[Upload function] +// snippet-keyword:[Go] +// snippet-service:[s3] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ses/ses_delete_address.go b/go/example_code/ses/ses_delete_address.go index 5604640f98d..9829e53ac9b 100644 --- a/go/example_code/ses/ses_delete_address.go +++ b/go/example_code/ses/ses_delete_address.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an SES email address.] -//snippet-keyword:[Amazon Simple Email Service] -//snippet-keyword:[Amazon SES] -//snippet-keyword:[DeleteVerifiedEmailAddress function] -//snippet-keyword:[Go] -//snippet-service:[ses] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an SES email address.] +// snippet-keyword:[Amazon Simple Email Service] +// snippet-keyword:[Amazon SES] +// snippet-keyword:[DeleteVerifiedEmailAddress function] +// snippet-keyword:[Go] +// snippet-service:[ses] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ses/ses_get_statistics.go b/go/example_code/ses/ses_get_statistics.go index 9bf655c1721..55f3f75d1b6 100644 --- a/go/example_code/ses/ses_get_statistics.go +++ b/go/example_code/ses/ses_get_statistics.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets statistics about SES.] -//snippet-keyword:[Amazon Simple Email Service] -//snippet-keyword:[Amazon SES] -//snippet-keyword:[GetSendStatistics function] -//snippet-keyword:[Go] -//snippet-service:[ses] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets statistics about SES.] +// snippet-keyword:[Amazon Simple Email Service] +// snippet-keyword:[Amazon SES] +// snippet-keyword:[GetSendStatistics function] +// snippet-keyword:[Go] +// snippet-service:[ses] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ses/ses_list_emails.go b/go/example_code/ses/ses_list_emails.go index 87a23411ca1..b341d3f6a41 100644 --- a/go/example_code/ses/ses_list_emails.go +++ b/go/example_code/ses/ses_list_emails.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the valid SES email addresses.] -//snippet-keyword:[Amazon Simple Email Service] -//snippet-keyword:[Amazon SES] -//snippet-keyword:[GetIdentityVerificationAttributes function] -//snippet-keyword:[ListIdentities function] -//snippet-keyword:[Go] -//snippet-service:[ses] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the valid SES email addresses.] +// snippet-keyword:[Amazon Simple Email Service] +// snippet-keyword:[Amazon SES] +// snippet-keyword:[GetIdentityVerificationAttributes function] +// snippet-keyword:[ListIdentities function] +// snippet-keyword:[Go] +// snippet-service:[ses] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ses/ses_send_email.go b/go/example_code/ses/ses_send_email.go index 41265adff01..e9173210428 100644 --- a/go/example_code/ses/ses_send_email.go +++ b/go/example_code/ses/ses_send_email.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Sends a message to an SES email address.] -//snippet-keyword:[Amazon Simple Email Service] -//snippet-keyword:[Amazon SES] -//snippet-keyword:[SendEmail function] -//snippet-keyword:[Go] -//snippet-service:[ses] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Sends a message to an SES email address.] +// snippet-keyword:[Amazon Simple Email Service] +// snippet-keyword:[Amazon SES] +// snippet-keyword:[SendEmail function] +// snippet-keyword:[Go] +// snippet-service:[ses] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/ses/ses_send_verification.go b/go/example_code/ses/ses_send_verification.go index ddeaa14223b..3047a9ef1b4 100644 --- a/go/example_code/ses/ses_send_verification.go +++ b/go/example_code/ses/ses_send_verification.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Verifies an SES email address.] -//snippet-keyword:[Amazon Simple Email Service] -//snippet-keyword:[Amazon SES] -//snippet-keyword:[VerifyEmailAddress function] -//snippet-keyword:[Go] -//snippet-service:[ses] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Verifies an SES email address.] +// snippet-keyword:[Amazon Simple Email Service] +// snippet-keyword:[Amazon SES] +// snippet-keyword:[VerifyEmailAddress function] +// snippet-keyword:[Go] +// snippet-service:[ses] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_changingvisibility.go b/go/example_code/sqs/sqs_changingvisibility.go index 99c58bd4e33..9bb7c78ef04 100644 --- a/go/example_code/sqs/sqs_changingvisibility.go +++ b/go/example_code/sqs/sqs_changingvisibility.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Changes the visibility timeout for an SQS queue.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[ChangeMessageVisibility function] -//snippet-keyword:[ReceiveMessage function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Changes the visibility timeout for an SQS queue.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[ChangeMessageVisibility function] +// snippet-keyword:[ReceiveMessage function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_createqueues.go b/go/example_code/sqs/sqs_createqueues.go index 08685f65539..f1a12623926 100644 --- a/go/example_code/sqs/sqs_createqueues.go +++ b/go/example_code/sqs/sqs_createqueues.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an SQS queue.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[CreateQueue function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an SQS queue.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[CreateQueue function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_deadletterqueue.go b/go/example_code/sqs/sqs_deadletterqueue.go index d4cf78d00e1..4333e0131c2 100644 --- a/go/example_code/sqs/sqs_deadletterqueue.go +++ b/go/example_code/sqs/sqs_deadletterqueue.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Sets the attributes on an SQS queue.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[SetQueueAttributes function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Sets the attributes on an SQS queue.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[SetQueueAttributes function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_deletemessage.go b/go/example_code/sqs/sqs_deletemessage.go index 313d531c7b1..54cc59d0fd3 100644 --- a/go/example_code/sqs/sqs_deletemessage.go +++ b/go/example_code/sqs/sqs_deletemessage.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an SQS message.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[DeleteMessage function] -//snippet-keyword:[ReceiveMessage function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an SQS message.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[DeleteMessage function] +// snippet-keyword:[ReceiveMessage function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_deletequeue.go b/go/example_code/sqs/sqs_deletequeue.go index 16f67abceac..5c122d51ab1 100644 --- a/go/example_code/sqs/sqs_deletequeue.go +++ b/go/example_code/sqs/sqs_deletequeue.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Deletes an SQS queue.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[DeleteQueue function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Deletes an SQS queue.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[DeleteQueue function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_getqueueurl.go b/go/example_code/sqs/sqs_getqueueurl.go index a79acb899a8..8e08f671586 100644 --- a/go/example_code/sqs/sqs_getqueueurl.go +++ b/go/example_code/sqs/sqs_getqueueurl.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Gets the URL for an SQS queue.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[GetQueueUrl function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Gets the URL for an SQS queue.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[GetQueueUrl function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_listqueues.go b/go/example_code/sqs/sqs_listqueues.go index a6f5b785e4b..0610e18f262 100644 --- a/go/example_code/sqs/sqs_listqueues.go +++ b/go/example_code/sqs/sqs_listqueues.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists your SQS queues.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[ListQueues function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists your SQS queues.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[ListQueues function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_longpolling_create_queue.go b/go/example_code/sqs/sqs_longpolling_create_queue.go index ea3a98d8103..f0a4aca7a67 100644 --- a/go/example_code/sqs/sqs_longpolling_create_queue.go +++ b/go/example_code/sqs/sqs_longpolling_create_queue.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Creates an SQS queue with long polling enabled.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[CreateQueue function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Creates an SQS queue with long polling enabled.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[CreateQueue function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_longpolling_existing_queue.go b/go/example_code/sqs/sqs_longpolling_existing_queue.go index effe13fbbdb..6150984cf97 100644 --- a/go/example_code/sqs/sqs_longpolling_existing_queue.go +++ b/go/example_code/sqs/sqs_longpolling_existing_queue.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Enables long polling on an SQS queue.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[GetQueueUrl function] -//snippet-keyword:[SetQueueAttributes function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Enables long polling on an SQS queue.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[GetQueueUrl function] +// snippet-keyword:[SetQueueAttributes function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_longpolling_receive_message.go b/go/example_code/sqs/sqs_longpolling_receive_message.go index 5da440fa9fb..0b4c985eca4 100644 --- a/go/example_code/sqs/sqs_longpolling_receive_message.go +++ b/go/example_code/sqs/sqs_longpolling_receive_message.go @@ -1,14 +1,15 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Enables long polling on message receipt.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[GetQueueUrl function] -//snippet-keyword:[ReceiveMessage function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Enables long polling on message receipt.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[GetQueueUrl function] +// snippet-keyword:[ReceiveMessage function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/sqs/sqs_sendmessage.go b/go/example_code/sqs/sqs_sendmessage.go index 943953e80ef..89fe5a02549 100644 --- a/go/example_code/sqs/sqs_sendmessage.go +++ b/go/example_code/sqs/sqs_sendmessage.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Sends a message to an SQS queue.] -//snippet-keyword:[Amazon Simple Queue Service] -//snippet-keyword:[Amazon SQS] -//snippet-keyword:[SendMessage function] -//snippet-keyword:[Go] -//snippet-service:[sqs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Sends a message to an SQS queue.] +// snippet-keyword:[Amazon Simple Queue Service] +// snippet-keyword:[Amazon SQS] +// snippet-keyword:[SendMessage function] +// snippet-keyword:[Go] +// snippet-service:[sqs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/workdocs/wd_list_user_docs.go b/go/example_code/workdocs/wd_list_user_docs.go index c38f92f1ab7..1159a2ca2ba 100644 --- a/go/example_code/workdocs/wd_list_user_docs.go +++ b/go/example_code/workdocs/wd_list_user_docs.go @@ -1,13 +1,14 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the WorkDocs documents for a user.] -//snippet-keyword:[Amazon WorkDocs] -//snippet-keyword:[DescribeFolderContents function] -//snippet-keyword:[DescribeUsers function] -//snippet-keyword:[Go] -//snippet-service:[workdocs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the WorkDocs documents for a user.] +// snippet-keyword:[Amazon WorkDocs] +// snippet-keyword:[DescribeFolderContents function] +// snippet-keyword:[DescribeUsers function] +// snippet-keyword:[Go] +// snippet-service:[workdocs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/go/example_code/workdocs/wd_list_users.go b/go/example_code/workdocs/wd_list_users.go index ed5443fc7e1..b619da51f75 100644 --- a/go/example_code/workdocs/wd_list_users.go +++ b/go/example_code/workdocs/wd_list_users.go @@ -1,12 +1,13 @@ -//snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] -//snippet-sourceauthor:[Doug-AWS] -//snippet-sourcedescription:[Lists the WorkDocs users.] -//snippet-keyword:[Amazon WorkDocs] -//snippet-keyword:[DescribeUsers function] -//snippet-keyword:[Go] -//snippet-service:[workdocs] -//snippet-sourcetype:[full-example] -//snippet-sourcedate:[2018-03-16] +// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] +// snippet-sourceauthor:[Doug-AWS] +// snippet-sourcedescription:[Lists the WorkDocs users.] +// snippet-keyword:[Amazon WorkDocs] +// snippet-keyword:[DescribeUsers function] +// snippet-keyword:[Go] +// snippet-service:[workdocs] +// snippet-keyword:[Code Sample] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2018-03-16] /* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/java/example_code/dynamodb/TryDax/DaxAsyncClientDemo.java b/java/example_code/dynamodb/TryDax/DaxAsyncClientDemo.java new file mode 100644 index 00000000000..606122de131 --- /dev/null +++ b/java/example_code/dynamodb/TryDax/DaxAsyncClientDemo.java @@ -0,0 +1,96 @@ +// snippet-sourcedescription:[DaxAsyncClientDemo.java demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.java.trydax.DaxAsyncClientDemo] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +import java.util.HashMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + +import com.amazon.dax.client.dynamodbv2.ClientConfig; +import com.amazon.dax.client.dynamodbv2.ClusterDaxAsyncClient; +import com.amazonaws.auth.profile.ProfileCredentialsProvider; +import com.amazonaws.handlers.AsyncHandler; +import com.amazonaws.services.dynamodbv2.AmazonDynamoDBAsync; +import com.amazonaws.services.dynamodbv2.model.AttributeValue; +import com.amazonaws.services.dynamodbv2.model.GetItemRequest; +import com.amazonaws.services.dynamodbv2.model.GetItemResult; + +public class DaxAsyncClientDemo { + public static void main(String[] args) throws Exception { + + ClientConfig daxConfig = new ClientConfig().withCredentialsProvider(new ProfileCredentialsProvider()) + .withEndpoints("mydaxcluster.2cmrwl.clustercfg.dax.use1.cache.amazonaws.com:8111"); + + AmazonDynamoDBAsync client = new ClusterDaxAsyncClient(daxConfig); + + HashMap key = new HashMap(); + key.put("Artist", new AttributeValue().withS("No One You Know")); + key.put("SongTitle", new AttributeValue().withS("Scared of My Shadow")); + + GetItemRequest request = new GetItemRequest() + .withTableName("Music").withKey(key); + + // Java Futures + Future call = client.getItemAsync(request); + while (!call.isDone()) { + // Do other processing while you're waiting for the response + System.out.println("Doing something else for a few seconds..."); + Thread.sleep(3000); + } + // The results should be ready by now + + try { + call.get(); + + } catch (ExecutionException ee) { + // Futures always wrap errors as an ExecutionException. + // The *real* exception is stored as the cause of the + // ExecutionException + Throwable exception = ee.getCause(); + System.out.println("Error getting item: " + exception.getMessage()); + } + + // Async callbacks + call = client.getItemAsync(request, new AsyncHandler() { + + @Override + public void onSuccess(GetItemRequest request, GetItemResult getItemResult) { + System.out.println("Result: " + getItemResult); + } + + @Override + public void onError(Exception e) { + System.out.println("Unable to read item"); + System.err.println(e.getMessage()); + // Callers can also test if exception is an instance of + // AmazonServiceException or AmazonClientException and cast + // it to get additional information + } + + }); + call.get(); + + } +} + +// snippet-end:[dynamodb.java.trydax.DaxAsyncClientDemo] \ No newline at end of file diff --git a/java/example_code/dynamodb/TryDax/TryDax.java b/java/example_code/dynamodb/TryDax/TryDax.java new file mode 100644 index 00000000000..ef2bc83fb6a --- /dev/null +++ b/java/example_code/dynamodb/TryDax/TryDax.java @@ -0,0 +1,72 @@ +// snippet-sourcedescription:[TryDax.java demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.java.trydax.TryDax] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +import com.amazonaws.services.dynamodbv2.document.DynamoDB; + +public class TryDax { + + public static void main(String[] args) throws Exception { + + TryDaxHelper helper = new TryDaxHelper(); + TryDaxTests tests = new TryDaxTests(); + + DynamoDB ddbClient = helper.getDynamoDBClient(); + DynamoDB daxClient = null; + if (args.length >= 1) { + daxClient = helper.getDaxClient(args[0]); + } + + String tableName = "TryDaxTable"; + + System.out.println("Creating table..."); + helper.createTable(tableName, ddbClient); + System.out.println("Populating table..."); + helper.writeData(tableName, ddbClient, 10, 10); + + DynamoDB testClient = null; + if (daxClient != null) { + testClient = daxClient; + } else { + testClient = ddbClient; + } + + System.out.println("Running GetItem, Scan, and Query tests..."); + System.out.println("First iteration of each test will result in cache misses"); + System.out.println("Next iterations are cache hits\n"); + + // GetItem + tests.getItemTest(tableName, testClient, 1, 10, 5); + + // Query + tests.queryTest(tableName, testClient, 5, 2, 9, 5); + + // Scan + tests.scanTest(tableName, testClient, 5); + + helper.deleteTable(tableName, ddbClient); + } + +} + +// snippet-end:[dynamodb.java.trydax.TryDax] \ No newline at end of file diff --git a/java/example_code/dynamodb/TryDax/TryDaxHelper.java b/java/example_code/dynamodb/TryDax/TryDaxHelper.java new file mode 100644 index 00000000000..7a7e586a705 --- /dev/null +++ b/java/example_code/dynamodb/TryDax/TryDaxHelper.java @@ -0,0 +1,125 @@ +// snippet-sourcedescription:[TryDaxHelper.java demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.java.trydax.TryDaxHelper] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +import java.util.Arrays; + +import com.amazon.dax.client.dynamodbv2.AmazonDaxClientBuilder; +import com.amazonaws.services.dynamodbv2.AmazonDynamoDB; +import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder; +import com.amazonaws.services.dynamodbv2.document.DynamoDB; +import com.amazonaws.services.dynamodbv2.document.Item; +import com.amazonaws.services.dynamodbv2.document.Table; +import com.amazonaws.services.dynamodbv2.model.AttributeDefinition; +import com.amazonaws.services.dynamodbv2.model.KeySchemaElement; +import com.amazonaws.services.dynamodbv2.model.KeyType; +import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput; +import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType; +import com.amazonaws.util.EC2MetadataUtils; + + public class TryDaxHelper { + + private static final String region = EC2MetadataUtils.getEC2InstanceRegion(); + + DynamoDB getDynamoDBClient() { + System.out.println("Creating a DynamoDB client"); + AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard() + .withRegion(region) + .build(); + return new DynamoDB(client); + } + + DynamoDB getDaxClient(String daxEndpoint) { + System.out.println("Creating a DAX client with cluster endpoint " + daxEndpoint); + AmazonDaxClientBuilder daxClientBuilder = AmazonDaxClientBuilder.standard(); + daxClientBuilder.withRegion(region).withEndpointConfiguration(daxEndpoint); + AmazonDynamoDB client = daxClientBuilder.build(); + return new DynamoDB(client); + } + + void createTable(String tableName, DynamoDB client) { + Table table = client.getTable(tableName); + try { + System.out.println("Attempting to create table; please wait..."); + + table = client.createTable(tableName, + Arrays.asList( + new KeySchemaElement("pk", KeyType.HASH), // Partition key + new KeySchemaElement("sk", KeyType.RANGE)), // Sort key + Arrays.asList( + new AttributeDefinition("pk", ScalarAttributeType.N), + new AttributeDefinition("sk", ScalarAttributeType.N)), + new ProvisionedThroughput(10L, 10L)); + table.waitForActive(); + System.out.println("Successfully created table. Table status: " + + table.getDescription().getTableStatus()); + + } catch (Exception e) { + System.err.println("Unable to create table: "); + e.printStackTrace(); + } + } + + void writeData(String tableName, DynamoDB client, int pkmax, int skmax) { + Table table = client.getTable(tableName); + System.out.println("Writing data to the table..."); + + int stringSize = 1000; + StringBuilder sb = new StringBuilder(stringSize); + for (int i = 0; i < stringSize; i++) { + sb.append('X'); + } + String someData = sb.toString(); + + try { + for (Integer ipk = 1; ipk <= pkmax; ipk++) { + System.out.println(("Writing " + skmax + " items for partition key: " + ipk)); + for (Integer isk = 1; isk <= skmax; isk++) { + table.putItem(new Item() + .withPrimaryKey("pk", ipk, "sk", isk) + .withString("someData", someData)); + } + } + } catch (Exception e) { + System.err.println("Unable to write item:"); + e.printStackTrace(); + } + } + + void deleteTable(String tableName, DynamoDB client) { + Table table = client.getTable(tableName); + try { + System.out.println("\nAttempting to delete table; please wait..."); + table.delete(); + table.waitForDelete(); + System.out.println("Successfully deleted table."); + + } catch (Exception e) { + System.err.println("Unable to delete table: "); + e.printStackTrace(); + } + } + +} + +// snippet-end:[dynamodb.java.trydax.TryDaxHelper] \ No newline at end of file diff --git a/java/example_code/dynamodb/TryDax/TryDaxTests.java b/java/example_code/dynamodb/TryDax/TryDaxTests.java new file mode 100644 index 00000000000..88f5b7ab3f7 --- /dev/null +++ b/java/example_code/dynamodb/TryDax/TryDaxTests.java @@ -0,0 +1,121 @@ +// snippet-sourcedescription:[TryDaxTests.java demonstrates how to ] +// snippet-service:[dynamodb] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon DynamoDB] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ ] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[ ] +// snippet-sourceauthor:[AWS] +// snippet-start:[dynamodb.java.trydax.TryDaxTests] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +import java.util.HashMap; +import java.util.Iterator; + +import com.amazonaws.services.dynamodbv2.document.DynamoDB; +import com.amazonaws.services.dynamodbv2.document.Item; +import com.amazonaws.services.dynamodbv2.document.ItemCollection; +import com.amazonaws.services.dynamodbv2.document.QueryOutcome; +import com.amazonaws.services.dynamodbv2.document.ScanOutcome; +import com.amazonaws.services.dynamodbv2.document.Table; +import com.amazonaws.services.dynamodbv2.document.spec.QuerySpec; + +public class TryDaxTests { + + void getItemTest(String tableName, DynamoDB client, int pk, int sk, int iterations) { + long startTime, endTime; + System.out.println("GetItem test - partition key " + pk + " and sort keys 1-" + sk); + Table table = client.getTable(tableName); + + for (int i = 0; i < iterations; i++) { + startTime = System.nanoTime(); + try { + for (Integer ipk = 1; ipk <= pk; ipk++) { + for (Integer isk = 1; isk <= sk; isk++) { + table.getItem("pk", ipk, "sk", isk); + } + } + } catch (Exception e) { + System.err.println("Unable to get item:"); + e.printStackTrace(); + } + endTime = System.nanoTime(); + printTime(startTime, endTime, pk * sk); + } + } + + void queryTest(String tableName, DynamoDB client, int pk, int sk1, int sk2, int iterations) { + long startTime, endTime; + System.out.println("Query test - partition key " + pk + " and sort keys between " + sk1 + " and " + sk2); + Table table = client.getTable(tableName); + + HashMap valueMap = new HashMap(); + valueMap.put(":pkval", pk); + valueMap.put(":skval1", sk1); + valueMap.put(":skval2", sk2); + + QuerySpec spec = new QuerySpec() + .withKeyConditionExpression("pk = :pkval and sk between :skval1 and :skval2") + .withValueMap(valueMap); + + for (int i = 0; i < iterations; i++) { + startTime = System.nanoTime(); + ItemCollection items = table.query(spec); + + try { + Iterator iter = items.iterator(); + while (iter.hasNext()) { + iter.next(); + } + } catch (Exception e) { + System.err.println("Unable to query table:"); + e.printStackTrace(); + } + endTime = System.nanoTime(); + printTime(startTime, endTime, iterations); + } + } + + void scanTest(String tableName, DynamoDB client, int iterations) { + long startTime, endTime; + System.out.println("Scan test - all items in the table"); + Table table = client.getTable(tableName); + + for (int i = 0; i < iterations; i++) { + startTime = System.nanoTime(); + ItemCollection items = table.scan(); + try { + + Iterator iter = items.iterator(); + while (iter.hasNext()) { + iter.next(); + } + } catch (Exception e) { + System.err.println("Unable to scan table:"); + e.printStackTrace(); + } + endTime = System.nanoTime(); + printTime(startTime, endTime, iterations); + } + } + + public void printTime(long startTime, long endTime, int iterations) { + System.out.format("\tTotal time: %.3f ms - ", (endTime - startTime) / (1000000.0)); + System.out.format("Avg time: %.3f ms\n", (endTime - startTime) / (iterations * 1000000.0)); + } +} + +// snippet-end:[dynamodb.java.trydax.TryDaxTests] \ No newline at end of file diff --git a/java/example_code/dynamodb/autoscaling/DisableDynamoDBAutoscaling.java b/java/example_code/dynamodb/autoscaling/DisableDynamoDBAutoscaling.java index daa09120d25..58c4b2419f7 100644 --- a/java/example_code/dynamodb/autoscaling/DisableDynamoDBAutoscaling.java +++ b/java/example_code/dynamodb/autoscaling/DisableDynamoDBAutoscaling.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DisableDynamoDBAutoscaling.java demonstrates how to ] +// snippet-sourcedescription:[DisableDynamoDBAutoscaling.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DisableDynamoDBAutoscaling] - +// snippet-start:[dynamodb.java.codeexample.DisableDynamoDBAutoscaling] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -108,4 +107,5 @@ public static void main(String args[]) { } } -// snippet-end:[dynamodb.Java.CodeExample.DisableDynamoDBAutoscaling] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DisableDynamoDBAutoscaling] \ No newline at end of file diff --git a/java/example_code/dynamodb/autoscaling/EnableDynamoDBAutoscaling.java b/java/example_code/dynamodb/autoscaling/EnableDynamoDBAutoscaling.java index b49f0fa5859..b6d98becb7a 100644 --- a/java/example_code/dynamodb/autoscaling/EnableDynamoDBAutoscaling.java +++ b/java/example_code/dynamodb/autoscaling/EnableDynamoDBAutoscaling.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[EnableDynamoDBAutoscaling.java demonstrates how to ] +// snippet-sourcedescription:[EnableDynamoDBAutoscaling.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.EnableDynamoDBAutoscaling] - +// snippet-start:[dynamodb.java.codeexample.EnableDynamoDBAutoscaling] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -127,4 +126,5 @@ public static void main(String args[]) { } } -// snippet-end:[dynamodb.Java.CodeExample.EnableDynamoDBAutoscaling] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.EnableDynamoDBAutoscaling] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/CreateTablesLoadData.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/CreateTablesLoadData.java index 2296cd5ee64..2517571e7ee 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/CreateTablesLoadData.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/CreateTablesLoadData.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[CreateTablesLoadData.java demonstrates how to ] +// snippet-sourcedescription:[CreateTablesLoadData.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.CreateTablesLoadData] - +// snippet-start:[dynamodb.java.codeexample.CreateTablesLoadData] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -386,4 +385,5 @@ private static void loadSampleReplies(String tableName) { } } -// snippet-end:[dynamodb.Java.CodeExample.CreateTablesLoadData] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.CreateTablesLoadData] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/SampleDataLoad.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/SampleDataLoad.java index a6ebfc73081..d9c4c4a98e7 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/SampleDataLoad.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/SampleDataLoad.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[SampleDataLoad.java demonstrates how to ] +// snippet-sourcedescription:[SampleDataLoad.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.SampleDataLoad] - +// snippet-start:[dynamodb.java.codeexample.SampleDataLoad] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -283,4 +282,5 @@ private static void loadSampleReplies(String tableName) { } } -// snippet-end:[dynamodb.Java.CodeExample.SampleDataLoad] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.SampleDataLoad] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/SampleDataTryQuery.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/SampleDataTryQuery.java index f52e0e083da..8dbfa8b4ceb 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/SampleDataTryQuery.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/SampleDataTryQuery.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[SampleDataTryQuery.java demonstrates how to ] +// snippet-sourcedescription:[SampleDataTryQuery.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.SampleDataTryQuery] - +// snippet-start:[dynamodb.java.codeexample.SampleDataTryQuery] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -104,4 +103,5 @@ private static void findRepliesInLast15DaysWithConfig(String tableName, String f } } -// snippet-end:[dynamodb.Java.CodeExample.SampleDataTryQuery] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.SampleDataTryQuery] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsAdapterDemo.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsAdapterDemo.java index 1506bd4cb0c..ab479cba3e8 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsAdapterDemo.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsAdapterDemo.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[StreamsAdapterDemo.java demonstrates how to ] +// snippet-sourcedescription:[StreamsAdapterDemo.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.StreamsAdapterDemo] - +// snippet-start:[dynamodb.java.codeexample.StreamsAdapterDemo] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -166,4 +165,5 @@ private static void cleanupAndExit(Integer returnValue) { } } -// snippet-end:[dynamodb.Java.CodeExample.StreamsAdapterDemo] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.StreamsAdapterDemo] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsAdapterDemoHelper.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsAdapterDemoHelper.java index ce6d8114542..7ec92a87b39 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsAdapterDemoHelper.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsAdapterDemoHelper.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[StreamsAdapterDemoHelper.java demonstrates how to ] +// snippet-sourcedescription:[StreamsAdapterDemoHelper.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.StreamsAdapterDemoHelper] - +// snippet-start:[dynamodb.java.codeexample.StreamsAdapterDemoHelper] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -131,4 +130,5 @@ public static void deleteItem(AmazonDynamoDB dynamoDBClient, String tableName, S } } -// snippet-end:[dynamodb.Java.CodeExample.StreamsAdapterDemoHelper] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.StreamsAdapterDemoHelper] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsLowLevelDemo.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsLowLevelDemo.java index 87bf724f408..d9e8a04e565 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsLowLevelDemo.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsLowLevelDemo.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[StreamsLowLevelDemo.java demonstrates how to ] +// snippet-sourcedescription:[StreamsLowLevelDemo.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.StreamsLowLevelDemo] - +// snippet-start:[dynamodb.java.codeexample.StreamsLowLevelDemo] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -210,4 +209,5 @@ public static void main(String args[]) throws InterruptedException { System.out.println("Demo complete"); } -}// snippet-end:[dynamodb.Java.CodeExample.StreamsLowLevelDemo] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.StreamsLowLevelDemo] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsRecordProcessor.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsRecordProcessor.java index 50967cfdcfb..b3c9f5c5e03 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsRecordProcessor.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsRecordProcessor.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[StreamsRecordProcessor.java demonstrates how to ] +// snippet-sourcedescription:[StreamsRecordProcessor.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.StreamsRecordProcessor] - +// snippet-start:[dynamodb.java.codeexample.StreamsRecordProcessor] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -99,4 +98,5 @@ public void shutdown(ShutdownInput shutdownInput) { } } -// snippet-end:[dynamodb.Java.CodeExample.StreamsRecordProcessor] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.StreamsRecordProcessor] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsRecordProcessorFactory.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsRecordProcessorFactory.java index 4f6f9be7a91..da6aa587edb 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsRecordProcessorFactory.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/StreamsRecordProcessorFactory.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[StreamsRecordProcessorFactory.java demonstrates how to ] +// snippet-sourcedescription:[StreamsRecordProcessorFactory.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.StreamsRecordProcessorFactory] - +// snippet-start:[dynamodb.java.codeexample.StreamsRecordProcessorFactory] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -43,4 +42,5 @@ public StreamsRecordProcessorFactory(AmazonDynamoDB dynamoDBClient, String table public IRecordProcessor createProcessor() { return new StreamsRecordProcessor(dynamoDBClient, tableName); } -}// snippet-end:[dynamodb.Java.CodeExample.StreamsRecordProcessorFactory] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.StreamsRecordProcessorFactory] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperBatchWriteExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperBatchWriteExample.java index 341742626b4..073b4ae07ae 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperBatchWriteExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperBatchWriteExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DynamoDBMapperBatchWriteExample.java demonstrates how to ] +// snippet-sourcedescription:[DynamoDBMapperBatchWriteExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DynamoDBMapperBatchWriteExample] - +// snippet-start:[dynamodb.java.codeexample.DynamoDBMapperBatchWriteExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -394,4 +393,5 @@ public void setThreads(int threads) { } } } -// snippet-end:[dynamodb.Java.CodeExample.DynamoDBMapperBatchWriteExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DynamoDBMapperBatchWriteExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperCRUDExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperCRUDExample.java index 6d66db1c3f6..26d13e981a6 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperCRUDExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperCRUDExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DynamoDBMapperCRUDExample.java demonstrates how to ] +// snippet-sourcedescription:[DynamoDBMapperCRUDExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DynamoDBMapperCRUDExample] - +// snippet-start:[dynamodb.java.codeexample.DynamoDBMapperCRUDExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -138,4 +137,5 @@ private static void testCRUDOperations() { } } } -// snippet-end:[dynamodb.Java.CodeExample.DynamoDBMapperCRUDExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DynamoDBMapperCRUDExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperExample.java index 544e8fdb596..7881c98a304 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DynamoDBMapperExample.java demonstrates how to ] +// snippet-sourcedescription:[DynamoDBMapperExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DynamoDBMapperExample] - +// snippet-start:[dynamodb.java.codeexample.DynamoDBMapperExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -210,4 +209,5 @@ public DimensionType unconvert(String s) { return itemDimension; } } -}// snippet-end:[dynamodb.Java.CodeExample.DynamoDBMapperExample] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.DynamoDBMapperExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperQueryScanExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperQueryScanExample.java index e513ec8ee84..16dcba201c6 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperQueryScanExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperQueryScanExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DynamoDBMapperQueryScanExample.java demonstrates how to ] +// snippet-sourcedescription:[DynamoDBMapperQueryScanExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DynamoDBMapperQueryScanExample] - +// snippet-start:[dynamodb.java.codeexample.DynamoDBMapperQueryScanExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -535,4 +534,5 @@ public void setThreads(int threads) { } } } -// snippet-end:[dynamodb.Java.CodeExample.DynamoDBMapperQueryScanExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DynamoDBMapperQueryScanExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIBatchGet.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIBatchGet.java index 0e1a876e78b..13552e96dc2 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIBatchGet.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIBatchGet.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPIBatchGet.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPIBatchGet.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPIBatchGet] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPIBatchGet] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -102,4 +101,5 @@ private static void retrieveMultipleItemsBatchGet() { } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPIBatchGet] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPIBatchGet] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIBatchWrite.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIBatchWrite.java index 978f7bfd195..a0145156933 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIBatchWrite.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIBatchWrite.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPIBatchWrite.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPIBatchWrite.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPIBatchWrite] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPIBatchWrite] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -99,4 +98,5 @@ private static void writeMultipleItemsBatchWrite() { } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPIBatchWrite] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPIBatchWrite] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIGlobalSecondaryIndexExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIGlobalSecondaryIndexExample.java index 7d62ef020b5..1a9221878f9 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIGlobalSecondaryIndexExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIGlobalSecondaryIndexExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPIGlobalSecondaryIndexExample.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPIGlobalSecondaryIndexExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPIGlobalSecondaryIndexExample] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPIGlobalSecondaryIndexExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -239,4 +238,5 @@ public static void putItem( } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPIGlobalSecondaryIndexExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPIGlobalSecondaryIndexExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIItemBinaryExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIItemBinaryExample.java index b98eaaff829..c87e4abd6b7 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIItemBinaryExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIItemBinaryExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPIItemBinaryExample.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPIItemBinaryExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPIItemBinaryExample] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPIItemBinaryExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -161,4 +160,5 @@ private static String uncompressString(ByteBuffer input) throws IOException { return result; } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPIItemBinaryExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPIItemBinaryExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIItemCRUDExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIItemCRUDExample.java index f4098ccbdf3..64e3d8eef53 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIItemCRUDExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIItemCRUDExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPIItemCRUDExample.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPIItemCRUDExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPIItemCRUDExample] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPIItemCRUDExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -212,4 +211,5 @@ private static void deleteItem() { } } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPIItemCRUDExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPIItemCRUDExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPILocalSecondaryIndexExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPILocalSecondaryIndexExample.java index 943cde449cf..96e84c2158f 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPILocalSecondaryIndexExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPILocalSecondaryIndexExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPILocalSecondaryIndexExample.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPILocalSecondaryIndexExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPILocalSecondaryIndexExample] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPILocalSecondaryIndexExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -332,4 +331,5 @@ public static void loadData() { } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPILocalSecondaryIndexExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPILocalSecondaryIndexExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIParallelScan.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIParallelScan.java index f846d4076a9..35d156f19d4 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIParallelScan.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIParallelScan.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPIParallelScan.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPIParallelScan.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPIParallelScan] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPIParallelScan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -257,4 +256,5 @@ private static void shutDownExecutorService(ExecutorService executor) { } } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPIParallelScan] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPIParallelScan] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIQuery.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIQuery.java index 66cb613705c..fa49137a624 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIQuery.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIQuery.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPIQuery.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPIQuery.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPIQuery] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPIQuery] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -179,4 +178,5 @@ private static void findRepliesUsingAFilterExpression(String forumName, String t } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPIQuery] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPIQuery] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIScan.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIScan.java index 7518441a400..d0fe74e23b7 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIScan.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPIScan.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPIScan.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPIScan.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPIScan] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPIScan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -69,4 +68,5 @@ private static void findProductsForPriceLessThanOneHundred() { } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPIScan] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPIScan] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPITableExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPITableExample.java index 287ce24b409..cd38ab4300b 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPITableExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/document/DocumentAPITableExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DocumentAPITableExample.java demonstrates how to ] +// snippet-sourcedescription:[DocumentAPITableExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DocumentAPITableExample] - +// snippet-start:[dynamodb.java.codeexample.DocumentAPITableExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -150,4 +149,5 @@ static void deleteExampleTable() { } } -// snippet-end:[dynamodb.Java.CodeExample.DocumentAPITableExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DocumentAPITableExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesCreateTable.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesCreateTable.java index a51b3f8939d..ac99c0d7f7a 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesCreateTable.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesCreateTable.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesCreateTable.java demonstrates how to ] +// snippet-sourcedescription:[MoviesCreateTable.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesCreateTable] - +// snippet-start:[dynamodb.java.codeexample.MoviesCreateTable] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -71,4 +70,5 @@ public static void main(String[] args) throws Exception { } } -}// snippet-end:[dynamodb.Java.CodeExample.MoviesCreateTable] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.MoviesCreateTable] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesDeleteTable.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesDeleteTable.java index f08ef9a9cef..353e5edbfe4 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesDeleteTable.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesDeleteTable.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesDeleteTable.java demonstrates how to ] +// snippet-sourcedescription:[MoviesDeleteTable.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesDeleteTable] - +// snippet-start:[dynamodb.java.codeexample.MoviesDeleteTable] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -57,4 +56,5 @@ public static void main(String[] args) throws Exception { System.err.println(e.getMessage()); } } -}// snippet-end:[dynamodb.Java.CodeExample.MoviesDeleteTable] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.MoviesDeleteTable] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps01.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps01.java index c8d60713e14..25486e0b7bd 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps01.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps01.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesItemOps01.java demonstrates how to ] +// snippet-sourcedescription:[MoviesItemOps01.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesItemOps01] - +// snippet-start:[dynamodb.java.codeexample.MoviesItemOps01] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -72,4 +71,5 @@ public static void main(String[] args) throws Exception { } } -// snippet-end:[dynamodb.Java.CodeExample.MoviesItemOps01] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.MoviesItemOps01] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps02.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps02.java index a5436606b33..8a3dc46f227 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps02.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps02.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesItemOps02.java demonstrates how to ] +// snippet-sourcedescription:[MoviesItemOps02.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesItemOps02] - +// snippet-start:[dynamodb.java.codeexample.MoviesItemOps02] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -64,4 +63,5 @@ public static void main(String[] args) throws Exception { } } -}// snippet-end:[dynamodb.Java.CodeExample.MoviesItemOps02] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.MoviesItemOps02] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps03.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps03.java index 34d7949dbe5..e90203fddc9 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps03.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps03.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesItemOps03.java demonstrates how to ] +// snippet-sourcedescription:[MoviesItemOps03.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesItemOps03] - +// snippet-start:[dynamodb.java.codeexample.MoviesItemOps03] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -70,4 +69,5 @@ public static void main(String[] args) throws Exception { System.err.println(e.getMessage()); } } -}// snippet-end:[dynamodb.Java.CodeExample.MoviesItemOps03] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.MoviesItemOps03] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps04.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps04.java index f156d422247..e59dfd8e455 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps04.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps04.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesItemOps04.java demonstrates how to ] +// snippet-sourcedescription:[MoviesItemOps04.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesItemOps04] - +// snippet-start:[dynamodb.java.codeexample.MoviesItemOps04] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -67,4 +66,5 @@ public static void main(String[] args) throws Exception { System.err.println(e.getMessage()); } } -}// snippet-end:[dynamodb.Java.CodeExample.MoviesItemOps04] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.MoviesItemOps04] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps05.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps05.java index 16fabf6d6f2..b852a9bb5cf 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps05.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps05.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesItemOps05.java demonstrates how to ] +// snippet-sourcedescription:[MoviesItemOps05.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesItemOps05] - +// snippet-start:[dynamodb.java.codeexample.MoviesItemOps05] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -70,4 +69,5 @@ public static void main(String[] args) throws Exception { System.err.println(e.getMessage()); } } -}// snippet-end:[dynamodb.Java.CodeExample.MoviesItemOps05] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.MoviesItemOps05] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps06.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps06.java index fe2264276fc..1e258a6645b 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps06.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesItemOps06.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesItemOps06.java demonstrates how to ] +// snippet-sourcedescription:[MoviesItemOps06.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesItemOps06] - +// snippet-start:[dynamodb.java.codeexample.MoviesItemOps06] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -67,4 +66,5 @@ public static void main(String[] args) throws Exception { System.err.println(e.getMessage()); } } -}// snippet-end:[dynamodb.Java.CodeExample.MoviesItemOps06] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.MoviesItemOps06] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesLoadData.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesLoadData.java index 17396fb10f7..cc2e258dbf1 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesLoadData.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesLoadData.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesLoadData.java demonstrates how to ] +// snippet-sourcedescription:[MoviesLoadData.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesLoadData] - +// snippet-start:[dynamodb.java.codeexample.MoviesLoadData] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -80,4 +79,5 @@ public static void main(String[] args) throws Exception { } parser.close(); } -}// snippet-end:[dynamodb.Java.CodeExample.MoviesLoadData] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.MoviesLoadData] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesQuery.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesQuery.java index 5d6eeb1f7aa..6d110b7d94b 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesQuery.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesQuery.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesQuery.java demonstrates how to ] +// snippet-sourcedescription:[MoviesQuery.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesQuery] - +// snippet-start:[dynamodb.java.codeexample.MoviesQuery] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -106,4 +105,5 @@ public static void main(String[] args) throws Exception { } } } -// snippet-end:[dynamodb.Java.CodeExample.MoviesQuery] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.MoviesQuery] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesScan.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesScan.java index 8f6f7e01c33..037cea85507 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesScan.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/gsg/MoviesScan.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[MoviesScan.java demonstrates how to ] +// snippet-sourcedescription:[MoviesScan.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.MoviesScan] - +// snippet-start:[dynamodb.java.codeexample.MoviesScan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -72,4 +71,5 @@ public static void main(String[] args) throws Exception { System.err.println(e.getMessage()); } } -}// snippet-end:[dynamodb.Java.CodeExample.MoviesScan] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.MoviesScan] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchGet.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchGet.java index 1442ecf91dd..edfae109514 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchGet.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchGet.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelBatchGet.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelBatchGet.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelBatchGet] - +// snippet-start:[dynamodb.java.codeexample.LowLevelBatchGet] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -139,4 +138,5 @@ private static void printItem(Map attributeList) { + (value.getBS() == null ? "" : "BS=[" + value.getBS() + "] \n")); } } -}// snippet-end:[dynamodb.Java.CodeExample.LowLevelBatchGet] \ No newline at end of file +} +// snippet-end:[dynamodb.java.codeexample.LowLevelBatchGet] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchWrite.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchWrite.java index 09fdf013287..45b93076b29 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchWrite.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchWrite.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelBatchWrite.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelBatchWrite.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelBatchWrite] - +// snippet-start:[dynamodb.java.codeexample.LowLevelBatchWrite] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -122,4 +121,5 @@ private static void writeMultipleItemsBatchWrite() { } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelBatchWrite] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelBatchWrite] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchWriteSyntax.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchWriteSyntax.java index b1acb813abc..669871c5739 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchWriteSyntax.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelBatchWriteSyntax.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelBatchWriteSyntax.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelBatchWriteSyntax.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelBatchWriteSyntax] - +// snippet-start:[dynamodb.java.codeexample.LowLevelBatchWriteSyntax] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -119,4 +118,5 @@ private static void writeMultipleItemsBatchWrite() { } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelBatchWriteSyntax] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelBatchWriteSyntax] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelGlobalSecondaryIndexExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelGlobalSecondaryIndexExample.java index b9fe502b263..1455bfb76be 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelGlobalSecondaryIndexExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelGlobalSecondaryIndexExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelGlobalSecondaryIndexExample.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelGlobalSecondaryIndexExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelGlobalSecondaryIndexExample] - +// snippet-start:[dynamodb.java.codeexample.LowLevelGlobalSecondaryIndexExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -314,4 +313,5 @@ private static void waitForTableToBeDeleted(String tableName) { } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelGlobalSecondaryIndexExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelGlobalSecondaryIndexExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelItemBinaryExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelItemBinaryExample.java index 3613aaa8eac..6e2d728de5c 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelItemBinaryExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelItemBinaryExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelItemBinaryExample.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelItemBinaryExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelItemBinaryExample] - +// snippet-start:[dynamodb.java.codeexample.LowLevelItemBinaryExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -164,4 +163,5 @@ private static String decompressString(ByteBuffer input) throws IOException { return new String(baos.toByteArray(), "UTF-8"); } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelItemBinaryExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelItemBinaryExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelItemCRUDExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelItemCRUDExample.java index 7449e87e05d..f7d1253aa9e 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelItemCRUDExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelItemCRUDExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelItemCRUDExample.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelItemCRUDExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelItemCRUDExample] - +// snippet-start:[dynamodb.java.codeexample.LowLevelItemCRUDExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -252,4 +251,5 @@ private static void printItem(Map attributeList) { } } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelItemCRUDExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelItemCRUDExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelLocalSecondaryIndexExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelLocalSecondaryIndexExample.java index 52783a36fda..893e2b45c89 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelLocalSecondaryIndexExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelLocalSecondaryIndexExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelLocalSecondaryIndexExample.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelLocalSecondaryIndexExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelLocalSecondaryIndexExample] - +// snippet-start:[dynamodb.java.codeexample.LowLevelLocalSecondaryIndexExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -422,4 +421,5 @@ private static void waitForTableToBeDeleted(String tableName) { } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelLocalSecondaryIndexExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelLocalSecondaryIndexExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelParallelScan.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelParallelScan.java index aa963ba01fa..e218bfaeba8 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelParallelScan.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelParallelScan.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelParallelScan.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelParallelScan.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelParallelScan] - +// snippet-start:[dynamodb.java.codeexample.LowLevelParallelScan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -338,4 +337,5 @@ private static void shutDownExecutorService(ExecutorService executor) { } } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelParallelScan] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelParallelScan] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelQuery.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelQuery.java index a6e1bafa22a..d83ac932dac 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelQuery.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelQuery.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelQuery.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelQuery.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelQuery] - +// snippet-start:[dynamodb.java.codeexample.LowLevelQuery] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -184,4 +183,5 @@ private static Map makeReplyKeyConditions(String forumName, S return keyConditions; } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelQuery] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelQuery] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelScan.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelScan.java index 6bafdd122ce..cc26edfe5fe 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelScan.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelScan.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelScan.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelScan.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelScan] - +// snippet-start:[dynamodb.java.codeexample.LowLevelScan] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -76,4 +75,5 @@ private static void printItem(Map attributeList) { } } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelScan] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelScan] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelTableExample.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelTableExample.java index 40f55f48d96..e9d3ba84d6c 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelTableExample.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/lowlevel/LowLevelTableExample.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[LowLevelTableExample.java demonstrates how to ] +// snippet-sourcedescription:[LowLevelTableExample.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.LowLevelTableExample] - +// snippet-start:[dynamodb.java.codeexample.LowLevelTableExample] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -181,4 +180,5 @@ private static void waitForTableToBeDeleted(String tableName) { } } -// snippet-end:[dynamodb.Java.CodeExample.LowLevelTableExample] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.LowLevelTableExample] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/client/DynamoDBDynamicFaultInjection.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/client/DynamoDBDynamicFaultInjection.java index 0f68a909eb4..660c89fbb68 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/client/DynamoDBDynamicFaultInjection.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/client/DynamoDBDynamicFaultInjection.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DynamoDBDynamicFaultInjection.java demonstrates how to ] +// snippet-sourcedescription:[DynamoDBDynamicFaultInjection.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DynamoDBDynamicFaultInjection] - +// snippet-start:[dynamodb.java.codeexample.DynamoDBDynamicFaultInjection] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -257,4 +256,5 @@ private static void waitForTableToBecomeAvailable(String tableName) { } } -// snippet-end:[dynamodb.Java.CodeExample.DynamoDBDynamicFaultInjection] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DynamoDBDynamicFaultInjection] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/client/FaultInjectionRequestHandler.java b/java/example_code/dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/client/FaultInjectionRequestHandler.java index 2871dee3a1d..a6d67628862 100644 --- a/java/example_code/dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/client/FaultInjectionRequestHandler.java +++ b/java/example_code/dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/client/FaultInjectionRequestHandler.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[FaultInjectionRequestHandler.java demonstrates how to ] +// snippet-sourcedescription:[FaultInjectionRequestHandler.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.FaultInjectionRequestHandler] - +// snippet-start:[dynamodb.java.codeexample.FaultInjectionRequestHandler] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -128,4 +127,5 @@ public void afterError(Request request, Response response, Exception e) { // TODO Auto-generated method stub } } -// snippet-end:[dynamodb.Java.CodeExample.FaultInjectionRequestHandler] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.FaultInjectionRequestHandler] \ No newline at end of file diff --git a/java/example_code/dynamodb/src/test/java/com/amazonaws/services/dynamodbv2/DynamoDBLocalFixture.java b/java/example_code/dynamodb/src/test/java/com/amazonaws/services/dynamodbv2/DynamoDBLocalFixture.java index 93f69fa5ed8..b880aeec3fe 100644 --- a/java/example_code/dynamodb/src/test/java/com/amazonaws/services/dynamodbv2/DynamoDBLocalFixture.java +++ b/java/example_code/dynamodb/src/test/java/com/amazonaws/services/dynamodbv2/DynamoDBLocalFixture.java @@ -1,4 +1,4 @@ -// snippet-sourcedescription:[DynamoDBLocalFixture.java demonstrates how to ] +// snippet-sourcedescription:[DynamoDBLocalFixture.java demonstrates how to ] // snippet-service:[dynamodb] // snippet-keyword:[Java] // snippet-keyword:[Amazon DynamoDB] @@ -7,8 +7,7 @@ // snippet-sourcetype:[full-example] // snippet-sourcedate:[ ] // snippet-sourceauthor:[AWS] -// snippet-start:[dynamodb.Java.CodeExample.DynamoDBLocalFixture] - +// snippet-start:[dynamodb.java.codeexample.DynamoDBLocalFixture] /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * @@ -83,4 +82,5 @@ public static void listTables(ListTablesResult result, String method) { } } } -// snippet-end:[dynamodb.Java.CodeExample.DynamoDBLocalFixture] \ No newline at end of file + +// snippet-end:[dynamodb.java.codeexample.DynamoDBLocalFixture] \ No newline at end of file diff --git a/java/example_code/redshift/ConnectToClusterExample.java b/java/example_code/redshift/ConnectToClusterExample.java new file mode 100644 index 00000000000..df8f29cc2ff --- /dev/null +++ b/java/example_code/redshift/ConnectToClusterExample.java @@ -0,0 +1,97 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[ConnectToClusterExample demonstrates how to connect to an Amazon Redshift cluster and run a sample query.] +// snippet-service:[redshift] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Redshift] +// snippet-keyword:[Code Sample] +// snippet-keyword:[Connect] +// snippet-keyword:[JDBC] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2015-02-19] +// snippet-sourceauthor:[AWS] +// snippet-start:[redshift.java.ConnectToCluster.complete] +package connection; + +import java.sql.*; +import java.util.Properties; + +public class Docs { + //Redshift driver: "jdbc:redshift://x.y.us-west-2.redshift.amazonaws.com:5439/dev"; + //or "jdbc:postgresql://x.y.us-west-2.redshift.amazonaws.com:5439/dev"; + static final String dbURL = "***jdbc cluster connection string ****"; + static final String MasterUsername = "***master user name***"; + static final String MasterUserPassword = "***master user password***"; + + public static void main(String[] args) { + Connection conn = null; + Statement stmt = null; + try{ + //Dynamically load driver at runtime. + //Redshift JDBC 4.1 driver: com.amazon.redshift.jdbc41.Driver + //Redshift JDBC 4 driver: com.amazon.redshift.jdbc4.Driver + Class.forName("com.amazon.redshift.jdbc.Driver"); + + //Open a connection and define properties. + System.out.println("Connecting to database..."); + Properties props = new Properties(); + + //Uncomment the following line if using a keystore. + //props.setProperty("ssl", "true"); + props.setProperty("user", MasterUsername); + props.setProperty("password", MasterUserPassword); + conn = DriverManager.getConnection(dbURL, props); + + //Try a simple query. + System.out.println("Listing system tables..."); + stmt = conn.createStatement(); + String sql; + sql = "select * from information_schema.tables;"; + ResultSet rs = stmt.executeQuery(sql); + + //Get the data from the result set. + while(rs.next()){ + //Retrieve two columns. + String catalog = rs.getString("table_catalog"); + String name = rs.getString("table_name"); + + //Display values. + System.out.print("Catalog: " + catalog); + System.out.println(", Name: " + name); + } + rs.close(); + stmt.close(); + conn.close(); + }catch(Exception ex){ + //For convenience, handle all errors here. + ex.printStackTrace(); + }finally{ + //Finally block to close resources. + try{ + if(stmt!=null) + stmt.close(); + }catch(Exception ex){ + }// nothing we can do + try{ + if(conn!=null) + conn.close(); + }catch(Exception ex){ + ex.printStackTrace(); + } + } + System.out.println("Finished connectivity test."); + } +} +// snippet-end:[redshift.java.ConnectToCluster.complete] \ No newline at end of file diff --git a/java/example_code/redshift/CreateAndDescribeSnapshot.java b/java/example_code/redshift/CreateAndDescribeSnapshot.java new file mode 100644 index 00000000000..629d7473b8a --- /dev/null +++ b/java/example_code/redshift/CreateAndDescribeSnapshot.java @@ -0,0 +1,134 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[CreateAndDescribeSnapshot demonstrates how to create an Amazon Redshift cluster snapshot and describe existing snapshots.] +// snippet-service:[redshift] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Redshift] +// snippet-keyword:[Code Sample] +// snippet-keyword:[CreateClusterSnapshot] +// snippet-keyword:[DeleteClusterSnapshot] +// snippet-keyword:[DescribeClusterSnapshots] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2015-02-19] +// snippet-sourceauthor:[AWS] +// snippet-start:[redshift.java.CreateAndDescribeSnapshot.complete] +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.PropertiesCredentials; +import com.amazonaws.services.redshift.AmazonRedshiftClient; +import com.amazonaws.services.redshift.model.CreateClusterSnapshotRequest; +import com.amazonaws.services.redshift.model.DeleteClusterSnapshotRequest; +import com.amazonaws.services.redshift.model.DescribeClusterSnapshotsRequest; +import com.amazonaws.services.redshift.model.DescribeClusterSnapshotsResult; +import com.amazonaws.services.redshift.model.Snapshot; + +public class CreateAndDescribeSnapshot { + + public static AmazonRedshiftClient client; + public static String clusterIdentifier = "***provide cluster identifier***"; + public static long sleepTime = 10; + + public static void main(String[] args) throws IOException { + + AWSCredentials credentials = new PropertiesCredentials( + CreateAndDescribeSnapshot.class + .getResourceAsStream("AwsCredentials.properties")); + + client = new AmazonRedshiftClient(credentials); + + try { + // Unique snapshot identifier + String snapshotId = "my-snapshot-" + (new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss")).format(new Date()); + + Date createDate = createManualSnapshot(snapshotId); + waitForSnapshotAvailable(snapshotId); + describeSnapshots(); + deleteManualSnapshotsBefore(createDate); + describeSnapshots(); + + } catch (Exception e) { + System.err.println("Operation failed: " + e.getMessage()); + } + } + + private static Date createManualSnapshot(String snapshotId) { + + CreateClusterSnapshotRequest request = new CreateClusterSnapshotRequest() + .withClusterIdentifier(clusterIdentifier) + .withSnapshotIdentifier(snapshotId); + Snapshot snapshot = client.createClusterSnapshot(request); + System.out.format("Created cluster snapshot: %s\n", snapshotId); + return snapshot.getSnapshotCreateTime(); + } + + private static void describeSnapshots() { + + DescribeClusterSnapshotsRequest request = new DescribeClusterSnapshotsRequest() + .withClusterIdentifier(clusterIdentifier); + DescribeClusterSnapshotsResult result = client.describeClusterSnapshots(request); + + printResultSnapshots(result); + } + + private static void deleteManualSnapshotsBefore(Date creationDate) { + + DescribeClusterSnapshotsRequest request = new DescribeClusterSnapshotsRequest() + .withEndTime(creationDate) + .withClusterIdentifier(clusterIdentifier) + .withSnapshotType("manual"); + + DescribeClusterSnapshotsResult result = client.describeClusterSnapshots(request); + + for (Snapshot s : result.getSnapshots()) { + DeleteClusterSnapshotRequest deleteRequest = new DeleteClusterSnapshotRequest() + .withSnapshotIdentifier(s.getSnapshotIdentifier()); + Snapshot deleteResult = client.deleteClusterSnapshot(deleteRequest); + System.out.format("Deleted snapshot %s\n", deleteResult.getSnapshotIdentifier()); + } + } + + private static void printResultSnapshots(DescribeClusterSnapshotsResult result) { + System.out.println("\nSnapshot listing:"); + for (Snapshot snapshot : result.getSnapshots()) { + System.out.format("Identifier: %s\n", snapshot.getSnapshotIdentifier()); + System.out.format("Snapshot type: %s\n", snapshot.getSnapshotType()); + System.out.format("Snapshot create time: %s\n", snapshot.getSnapshotCreateTime()); + System.out.format("Snapshot status: %s\n\n", snapshot.getStatus()); + } + } + + private static Boolean waitForSnapshotAvailable(String snapshotId) throws InterruptedException { + Boolean snapshotAvailable = false; + System.out.println("Wating for snapshot to become available."); + while (!snapshotAvailable) { + DescribeClusterSnapshotsResult result = client.describeClusterSnapshots(new DescribeClusterSnapshotsRequest() + .withSnapshotIdentifier(snapshotId)); + String status = (result.getSnapshots()).get(0).getStatus(); + if (status.equalsIgnoreCase("available")) { + snapshotAvailable = true; + } + else { + System.out.print("."); + Thread.sleep(sleepTime*1000); + } + } + return snapshotAvailable; + } + +} +// snippet-end:[redshift.java.CreateAndDescribeSnapshot.complete] \ No newline at end of file diff --git a/java/example_code/redshift/CreateAndModifyCluster.java b/java/example_code/redshift/CreateAndModifyCluster.java new file mode 100644 index 00000000000..d5185e94925 --- /dev/null +++ b/java/example_code/redshift/CreateAndModifyCluster.java @@ -0,0 +1,119 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[CreateAndModifyCluster demonstrates how to create and modify an Amazon Redshift cluster.] +// snippet-service:[redshift] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Redshift] +// snippet-keyword:[Code Sample] +// snippet-keyword:[CreateCluster] +// snippet-keyword:[DescribeClusters] +// snippet-keyword:[ModifyCluster] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2015-02-19] +// snippet-sourceauthor:[AWS] +// snippet-start:[redshift.java.CreateAndModifyCluster.complete] + +import java.io.IOException; + +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.PropertiesCredentials; +import com.amazonaws.services.redshift.AmazonRedshiftClient; +import com.amazonaws.services.redshift.model.*; + +public class CreateAndModifyCluster { + + public static AmazonRedshiftClient client; + public static String clusterIdentifier = "***provide a cluster identifier***"; + public static long sleepTime = 20; + + public static void main(String[] args) throws IOException { + + AWSCredentials credentials = new PropertiesCredentials( + CreateAndModifyCluster.class + .getResourceAsStream("AwsCredentials.properties")); + + client = new AmazonRedshiftClient(credentials); + + try { + createCluster(); + waitForClusterReady(); + describeClusters(); + modifyCluster(); + describeClusters(); + } catch (Exception e) { + System.err.println("Operation failed: " + e.getMessage()); + } + } + + private static void createCluster() { + CreateClusterRequest request = new CreateClusterRequest() + .withClusterIdentifier(clusterIdentifier) + .withMasterUsername("masteruser") + .withMasterUserPassword("12345678Aa") + .withNodeType("ds1.xlarge") + .withNumberOfNodes(2); + + Cluster createResponse = client.createCluster(request); + System.out.println("Created cluster " + createResponse.getClusterIdentifier()); + } + + private static void describeClusters() { + DescribeClustersRequest request = new DescribeClustersRequest() + .withClusterIdentifier(clusterIdentifier); + + DescribeClustersResult result = client.describeClusters(request); + printResult(result); + } + + private static void modifyCluster() { + ModifyClusterRequest request = new ModifyClusterRequest() + .withClusterIdentifier(clusterIdentifier) + .withPreferredMaintenanceWindow("wed:07:30-wed:08:00"); + + client.modifyCluster(request); + System.out.println("Modified cluster " + clusterIdentifier); + + } + + private static void printResult(DescribeClustersResult result) + { + if (result == null) + { + System.out.println("Describe clusters result is null."); + return; + } + + System.out.println("Cluster property:"); + System.out.format("Preferred Maintenance Window: %s\n", result.getClusters().get(0).getPreferredMaintenanceWindow()); + } + + private static void waitForClusterReady() throws InterruptedException { + Boolean clusterReady = false; + System.out.println("Wating for cluster to become available."); + while (!clusterReady) { + DescribeClustersResult result = client.describeClusters(new DescribeClustersRequest() + .withClusterIdentifier(clusterIdentifier)); + String status = (result.getClusters()).get(0).getClusterStatus(); + if (status.equalsIgnoreCase("available")) { + clusterReady = true; + } + else { + System.out.print("."); + Thread.sleep(sleepTime*1000); + } + } + } +} +// snippet-end:[redshift.java.CreateAndModifyCluster.complete] \ No newline at end of file diff --git a/java/example_code/redshift/CreateAndModifyClusterParameterGroup.java b/java/example_code/redshift/CreateAndModifyClusterParameterGroup.java new file mode 100644 index 00000000000..5fbd9b24709 --- /dev/null +++ b/java/example_code/redshift/CreateAndModifyClusterParameterGroup.java @@ -0,0 +1,146 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[CreateAndModifyClusterParameterGroup demonstrates how to create and modify an Amazon Redshift parameter group.] +// snippet-service:[redshift] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Redshift] +// snippet-keyword:[Code Sample] +// snippet-keyword:[CreateClusterParameterGroup] +// snippet-keyword:[DescribeClusterParameterGroups] +// snippet-keyword:[ModifyClusterParameterGroup] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2015-02-19] +// snippet-sourceauthor:[AWS] +// snippet-start:[redshift.java.CreateAndModifyClusterParameterGroup.complete] +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.PropertiesCredentials; +import com.amazonaws.services.redshift.AmazonRedshiftClient; +import com.amazonaws.services.redshift.model.*; + +public class CreateAndModifyClusterParameterGroup { + + public static AmazonRedshiftClient client; + public static String clusterParameterGroupName = "parametergroup1"; + public static String clusterIdentifier = "***provide cluster identifier***"; + public static String parameterGroupFamily = "redshift-1.0"; + + public static void main(String[] args) throws IOException { + + AWSCredentials credentials = new PropertiesCredentials( + CreateAndModifyClusterParameterGroup.class + .getResourceAsStream("AwsCredentials.properties")); + + client = new AmazonRedshiftClient(credentials); + + try { + createClusterParameterGroup(); + modifyClusterParameterGroup(); + associateParameterGroupWithCluster(); + describeClusterParameterGroups(); + } catch (Exception e) { + System.err.println("Operation failed: " + e.getMessage()); + } + } + + private static void createClusterParameterGroup() { + CreateClusterParameterGroupRequest request = new CreateClusterParameterGroupRequest() + .withDescription("my cluster parameter group") + .withParameterGroupName(clusterParameterGroupName) + .withParameterGroupFamily(parameterGroupFamily); + client.createClusterParameterGroup(request); + System.out.println("Created cluster parameter group."); + } + + private static void describeClusterParameterGroups() { + DescribeClusterParameterGroupsResult result = client.describeClusterParameterGroups(); + printResultClusterParameterGroups(result); + } + + private static void modifyClusterParameterGroup() { + List parameters = new ArrayList(); + parameters.add(new Parameter() + .withParameterName("extra_float_digits") + .withParameterValue("2")); + // Replace WLM configuration. The new configuration defines a queue (in addition to the default). + parameters.add(new Parameter() + .withParameterName("wlm_json_configuration") + .withParameterValue("[{\"user_group\":[\"example_user_group1\"],\"query_group\":[\"example_query_group1\"],\"query_concurrency\":7},{\"query_concurrency\":5}]")); + + ModifyClusterParameterGroupRequest request = new ModifyClusterParameterGroupRequest() + .withParameterGroupName(clusterParameterGroupName) + .withParameters(parameters); + client.modifyClusterParameterGroup(request); + + } + + private static void associateParameterGroupWithCluster() { + + ModifyClusterRequest request = new ModifyClusterRequest() + .withClusterIdentifier(clusterIdentifier) + .withClusterParameterGroupName(clusterParameterGroupName); + + Cluster result = client.modifyCluster(request); + + System.out.format("Parameter Group %s is used for Cluster %s\n", + clusterParameterGroupName, result.getClusterParameterGroups().get(0).getParameterGroupName()); + } + private static void printResultClusterParameterGroups(DescribeClusterParameterGroupsResult result) + { + if (result == null) + { + System.out.println("\nDescribe cluster parameter groups result is null."); + return; + } + + System.out.println("\nPrinting parameter group results:\n"); + for (ClusterParameterGroup group : result.getParameterGroups()) { + System.out.format("\nDescription: %s\n", group.getDescription()); + System.out.format("Group Family Name: %s\n", group.getParameterGroupFamily()); + System.out.format("Group Name: %s\n", group.getParameterGroupName()); + describeClusterParameters(group.getParameterGroupName()); + } + } + + private static void describeClusterParameters(String parameterGroupName) { + DescribeClusterParametersRequest request = new DescribeClusterParametersRequest() + .withParameterGroupName(parameterGroupName); + + DescribeClusterParametersResult result = client.describeClusterParameters(request); + printResultClusterParameters(result, parameterGroupName); + } + + private static void printResultClusterParameters(DescribeClusterParametersResult result, String parameterGroupName) + { + if (result == null) + { + System.out.println("\nCluster parameters is null."); + return; + } + + System.out.format("\nPrinting cluster parameters for \"%s\"\n", parameterGroupName); + for (Parameter parameter : result.getParameters()) { + System.out.println(" Name: " + parameter.getParameterName() + ", Value: " + parameter.getParameterValue()); + System.out.println(" DataType: " + parameter.getDataType() + ", MinEngineVersion: " + parameter.getMinimumEngineVersion()); + System.out.println(" AllowedValues: " + parameter.getAllowedValues() + ", Source: " + parameter.getSource()); + System.out.println(" IsModifiable: " + parameter.getIsModifiable() + ", Description: " + parameter.getDescription()); + } + } +} + +// snippet-end:[redshift.java.CreateAndModifyClusterParameterGroup.complete] \ No newline at end of file diff --git a/java/example_code/redshift/CreateAndModifyClusterSecurityGroup.java b/java/example_code/redshift/CreateAndModifyClusterSecurityGroup.java new file mode 100644 index 00000000000..14a96ec73f5 --- /dev/null +++ b/java/example_code/redshift/CreateAndModifyClusterSecurityGroup.java @@ -0,0 +1,145 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[CreateAndModifyClusterSecurityGroup demonstrates how to create and modify an Amazon Redshift security group.] +// snippet-service:[redshift] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Redshift] +// snippet-keyword:[Code Sample] +// snippet-keyword:[CreateClusterSecurityGroup] +// snippet-keyword:[DescribeClusterSecurityGroups] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2015-02-19] +// snippet-sourceauthor:[AWS] +// snippet-start:[redshift.java.CreateAndModifyClusterSecurityGroup.complete] + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.PropertiesCredentials; +import com.amazonaws.services.redshift.AmazonRedshiftClient; +import com.amazonaws.services.redshift.model.*; + +public class CreateAndModifyClusterSecurityGroup { + + public static AmazonRedshiftClient client; + public static String clusterSecurityGroupName = "securitygroup1"; + public static String clusterIdentifier = "***provide cluster identifier***"; + public static String ownerID = "***provide account id****"; + + public static void main(String[] args) throws IOException { + + AWSCredentials credentials = new PropertiesCredentials( + CreateAndModifyClusterSecurityGroup.class + .getResourceAsStream("AwsCredentials.properties")); + + client = new AmazonRedshiftClient(credentials); + + try { + createClusterSecurityGroup(); + describeClusterSecurityGroups(); + addIngressRules(); + associateSecurityGroupWithCluster(); + } catch (Exception e) { + System.err.println("Operation failed: " + e.getMessage()); + } + } + + private static void createClusterSecurityGroup() { + CreateClusterSecurityGroupRequest request = new CreateClusterSecurityGroupRequest() + .withDescription("my cluster security group") + .withClusterSecurityGroupName(clusterSecurityGroupName); + + client.createClusterSecurityGroup(request); + System.out.format("Created cluster security group: '%s'\n", clusterSecurityGroupName); + } + + private static void addIngressRules() { + + AuthorizeClusterSecurityGroupIngressRequest request = new AuthorizeClusterSecurityGroupIngressRequest() + .withClusterSecurityGroupName(clusterSecurityGroupName) + .withCIDRIP("192.168.40.5/32"); + + ClusterSecurityGroup result = client.authorizeClusterSecurityGroupIngress(request); + + request = new AuthorizeClusterSecurityGroupIngressRequest() + .withClusterSecurityGroupName(clusterSecurityGroupName) + .withEC2SecurityGroupName("default") + .withEC2SecurityGroupOwnerId(ownerID); + result = client.authorizeClusterSecurityGroupIngress(request); + System.out.format("\nAdded ingress rules to security group '%s'\n", clusterSecurityGroupName); + printResultSecurityGroup(result); + } + + private static void associateSecurityGroupWithCluster() { + + // Get existing security groups used by the cluster. + DescribeClustersRequest request = new DescribeClustersRequest() + .withClusterIdentifier(clusterIdentifier); + + DescribeClustersResult result = client.describeClusters(request); + List membershipList = + result.getClusters().get(0).getClusterSecurityGroups(); + + List secGroupNames = new ArrayList(); + for (ClusterSecurityGroupMembership mem : membershipList) { + secGroupNames.add(mem.getClusterSecurityGroupName()); + } + // Add new security group to the list. + secGroupNames.add(clusterSecurityGroupName); + + // Apply the change to the cluster. + ModifyClusterRequest request2 = new ModifyClusterRequest() + .withClusterIdentifier(clusterIdentifier) + .withClusterSecurityGroups(secGroupNames); + + Cluster result2 = client.modifyCluster(request2); + System.out.format("\nAssociated security group '%s' to cluster '%s'.", clusterSecurityGroupName, clusterIdentifier); + } + + private static void describeClusterSecurityGroups() { + DescribeClusterSecurityGroupsRequest request = new DescribeClusterSecurityGroupsRequest(); + + DescribeClusterSecurityGroupsResult result = client.describeClusterSecurityGroups(request); + printResultSecurityGroups(result.getClusterSecurityGroups()); + } + + private static void printResultSecurityGroups(List groups) + { + if (groups == null) + { + System.out.println("\nDescribe cluster security groups result is null."); + return; + } + + System.out.println("\nPrinting security group results:"); + for (ClusterSecurityGroup group : groups) + { + printResultSecurityGroup(group); + } + } + private static void printResultSecurityGroup(ClusterSecurityGroup group) { + System.out.format("\nName: '%s', Description: '%s'\n", group.getClusterSecurityGroupName(), group.getDescription()); + for (EC2SecurityGroup g : group.getEC2SecurityGroups()) { + System.out.format("EC2group: '%s', '%s', '%s'\n", g.getEC2SecurityGroupName(), g.getEC2SecurityGroupOwnerId(), g.getStatus()); + } + for (IPRange range : group.getIPRanges()) { + System.out.format("IPRanges: '%s', '%s'\n", range.getCIDRIP(), range.getStatus()); + + } + } +} +// snippet-end:[redshift.java.CreateAndModifyClusterSecurityGroup.complete] \ No newline at end of file diff --git a/java/example_code/redshift/CreateAndModifyClusterSubnetGroup.java b/java/example_code/redshift/CreateAndModifyClusterSubnetGroup.java new file mode 100644 index 00000000000..afac7cb7c2c --- /dev/null +++ b/java/example_code/redshift/CreateAndModifyClusterSubnetGroup.java @@ -0,0 +1,121 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[CreateAndModifyClusterSubnetGroup demonstrates how to create and modify an Amazon Redshift subnet group.] +// snippet-service:[redshift] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Redshift] +// snippet-keyword:[Code Sample] +// snippet-keyword:[CreateClusterSubnetGroup] +// snippet-keyword:[DescribeClusterSubnetGroups] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2015-02-19] +// snippet-sourceauthor:[AWS] +// snippet-start:[redshift.java.CreateAndModifyClusterSubnetGroup.complete] +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.PropertiesCredentials; +import com.amazonaws.services.redshift.AmazonRedshiftClient; +import com.amazonaws.services.redshift.model.*; + +public class CreateAndModifyClusterSubnetGroup { + + public static AmazonRedshiftClient client; + public static String clusterSubnetGroupName = "***provide a cluster subnet group name ****"; + // You can use the VPC console to find subnet IDs to use. + public static String subnetId1 = "***provide a subnet ID****"; + public static String subnetId2 = "***provide a subnet ID****"; + + public static void main(String[] args) throws IOException { + + AWSCredentials credentials = new PropertiesCredentials( + CreateAndModifyClusterSubnetGroup.class + .getResourceAsStream("AwsCredentials.properties")); + + client = new AmazonRedshiftClient(credentials); + + try { + createClusterSubnetGroup(); + describeClusterSubnetGroups(); + modifyClusterSubnetGroup(); + } catch (Exception e) { + System.err.println("Operation failed: " + e.getMessage()); + } + } + + private static void createClusterSubnetGroup() { + CreateClusterSubnetGroupRequest request = new CreateClusterSubnetGroupRequest() + .withClusterSubnetGroupName(clusterSubnetGroupName) + .withDescription("my cluster subnet group") + .withSubnetIds(subnetId1); + client.createClusterSubnetGroup(request); + System.out.println("Created cluster subnet group: " + clusterSubnetGroupName); + } + + private static void modifyClusterSubnetGroup() { + // Get existing subnet list. + DescribeClusterSubnetGroupsRequest request1 = new DescribeClusterSubnetGroupsRequest() + .withClusterSubnetGroupName(clusterSubnetGroupName); + DescribeClusterSubnetGroupsResult result1 = client.describeClusterSubnetGroups(request1); + List subnetNames = new ArrayList(); + // We can work with just the first group returned since we requested info about one group. + for (Subnet subnet : result1.getClusterSubnetGroups().get(0).getSubnets()) { + subnetNames.add(subnet.getSubnetIdentifier()); + } + // Add to existing subnet list. + subnetNames.add(subnetId2); + + ModifyClusterSubnetGroupRequest request = new ModifyClusterSubnetGroupRequest() + .withClusterSubnetGroupName(clusterSubnetGroupName) + .withSubnetIds(subnetNames); + ClusterSubnetGroup result2 = client.modifyClusterSubnetGroup(request); + System.out.println("\nSubnet group modified."); + printResultSubnetGroup(result2); + } + + + private static void describeClusterSubnetGroups() { + DescribeClusterSubnetGroupsRequest request = new DescribeClusterSubnetGroupsRequest() + .withClusterSubnetGroupName(clusterSubnetGroupName); + + DescribeClusterSubnetGroupsResult result = client.describeClusterSubnetGroups(request); + printResultSubnetGroups(result); + } + + private static void printResultSubnetGroups(DescribeClusterSubnetGroupsResult result) + { + if (result == null) + { + System.out.println("\nDescribe cluster subnet groups result is null."); + return; + } + + for (ClusterSubnetGroup group : result.getClusterSubnetGroups()) + { + printResultSubnetGroup(group); + } + + } + private static void printResultSubnetGroup(ClusterSubnetGroup group) { + System.out.format("Name: %s, Description: %s\n", group.getClusterSubnetGroupName(), group.getDescription()); + for (Subnet subnet : group.getSubnets()) { + System.out.format(" Subnet: %s, %s, %s\n", subnet.getSubnetIdentifier(), + subnet.getSubnetAvailabilityZone().getName(), subnet.getSubnetStatus()); + } + } +} +// snippet-end:[redshift.java.CreateAndModifyClusterSubnetGroup.complete] \ No newline at end of file diff --git a/java/example_code/redshift/ListAndPurchaseReservedNodeOffering.java b/java/example_code/redshift/ListAndPurchaseReservedNodeOffering.java new file mode 100644 index 00000000000..138dbbad388 --- /dev/null +++ b/java/example_code/redshift/ListAndPurchaseReservedNodeOffering.java @@ -0,0 +1,161 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[ListAndPurchaseReservedNodeOffering demonstrates how to list and purchase Amazon Redshift reserved node offerings.] +// snippet-service:[redshift] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Redshift] +// snippet-keyword:[Code Sample] +// snippet-keyword:[DescribeReservedNodeOfferings] +// snippet-keyword:[PurchaseReservedNodeOffering] +// snippet-keyword:[ReservedNode] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2015-02-19] +// snippet-sourceauthor:[AWS] +// snippet-start:[redshift.java.ListAndPurchaseReservedNodeOffering.complete] +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.IOException; +import java.util.ArrayList; + +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.PropertiesCredentials; +import com.amazonaws.services.redshift.AmazonRedshiftClient; +import com.amazonaws.services.redshift.model.DescribeReservedNodeOfferingsRequest; +import com.amazonaws.services.redshift.model.DescribeReservedNodeOfferingsResult; +import com.amazonaws.services.redshift.model.DescribeReservedNodesResult; +import com.amazonaws.services.redshift.model.PurchaseReservedNodeOfferingRequest; +import com.amazonaws.services.redshift.model.ReservedNode; +import com.amazonaws.services.redshift.model.ReservedNodeAlreadyExistsException; +import com.amazonaws.services.redshift.model.ReservedNodeOffering; +import com.amazonaws.services.redshift.model.ReservedNodeOfferingNotFoundException; +import com.amazonaws.services.redshift.model.ReservedNodeQuotaExceededException; + + +public class ListAndPurchaseReservedNodeOffering { + + public static AmazonRedshiftClient client; + public static String nodeTypeToPurchase = "ds1.xlarge"; + public static Double fixedPriceLimit = 10000.00; + public static ArrayList matchingNodes = new ArrayList(); + + public static void main(String[] args) throws IOException { + + + AWSCredentials credentials = new PropertiesCredentials( + ListAndPurchaseReservedNodeOffering.class + .getResourceAsStream("AwsCredentials.properties")); + + client = new AmazonRedshiftClient(credentials); + + try { + listReservedNodes(); + findReservedNodeOffer(); + purchaseReservedNodeOffer(); + + } catch (Exception e) { + System.err.println("Operation failed: " + e.getMessage()); + } + } + + private static void listReservedNodes() { + DescribeReservedNodesResult result = client.describeReservedNodes(); + System.out.println("Listing nodes already purchased."); + for (ReservedNode node : result.getReservedNodes()) { + printReservedNodeDetails(node); + } + } + + private static void findReservedNodeOffer() + { + DescribeReservedNodeOfferingsRequest request = new DescribeReservedNodeOfferingsRequest(); + DescribeReservedNodeOfferingsResult result = client.describeReservedNodeOfferings(request); + Integer count = 0; + + System.out.println("\nFinding nodes to purchase."); + for (ReservedNodeOffering offering : result.getReservedNodeOfferings()) + { + if (offering.getNodeType().equals(nodeTypeToPurchase)){ + + if (offering.getFixedPrice() < fixedPriceLimit) { + matchingNodes.add(offering); + printOfferingDetails(offering); + count +=1; + } + } + } + if (count == 0) { + System.out.println("\nNo reserved node offering matches found."); + } else { + System.out.println("\nFound " + count + " matches."); + } + } + + private static void purchaseReservedNodeOffer() throws IOException { + if (matchingNodes.size() == 0) { + return; + } else { + System.out.println("\nPurchasing nodes."); + + for (ReservedNodeOffering offering : matchingNodes) { + printOfferingDetails(offering); + System.out.println("WARNING: purchasing this offering will incur costs."); + System.out.println("Purchase this offering [Y or N]?"); + DataInput in = new DataInputStream(System.in); + String purchaseOpt = in.readLine(); + if (purchaseOpt.equalsIgnoreCase("y")){ + + try { + PurchaseReservedNodeOfferingRequest request = new PurchaseReservedNodeOfferingRequest() + .withReservedNodeOfferingId(offering.getReservedNodeOfferingId()); + ReservedNode reservedNode = client.purchaseReservedNodeOffering(request); + printReservedNodeDetails(reservedNode); + } + catch (ReservedNodeAlreadyExistsException ex1){ + } + catch (ReservedNodeOfferingNotFoundException ex2){ + } + catch (ReservedNodeQuotaExceededException ex3){ + } + catch (Exception ex4){ + } + } + } + System.out.println("Finished."); + + } + } + + private static void printOfferingDetails( + ReservedNodeOffering offering) { + System.out.println("\nOffering Match:"); + System.out.format("Id: %s\n", offering.getReservedNodeOfferingId()); + System.out.format("Node Type: %s\n", offering.getNodeType()); + System.out.format("Fixed Price: %s\n", offering.getFixedPrice()); + System.out.format("Offering Type: %s\n", offering.getOfferingType()); + System.out.format("Duration: %s\n", offering.getDuration()); + } + + private static void printReservedNodeDetails(ReservedNode node) { + System.out.println("\nPurchased Node Details:"); + System.out.format("Id: %s\n", node.getReservedNodeOfferingId()); + System.out.format("State: %s\n", node.getState()); + System.out.format("Node Type: %s\n", node.getNodeType()); + System.out.format("Start Time: %s\n", node.getStartTime()); + System.out.format("Fixed Price: %s\n", node.getFixedPrice()); + System.out.format("Offering Type: %s\n", node.getOfferingType()); + System.out.format("Duration: %s\n", node.getDuration()); + } +} +// snippet-end:[redshift.java.ListAndPurchaseReservedNodeOffering.complete] \ No newline at end of file diff --git a/java/example_code/redshift/ListEvents.java b/java/example_code/redshift/ListEvents.java new file mode 100644 index 00000000000..a19e021eaf9 --- /dev/null +++ b/java/example_code/redshift/ListEvents.java @@ -0,0 +1,89 @@ +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +// snippet-sourcedescription:[ListEvents demonstrates how to list Amazon Redshift events.] +// snippet-service:[redshift] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Redshift] +// snippet-keyword:[Code Sample] +// snippet-keyword:[DescribeEvents] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2015-02-19] +// snippet-sourceauthor:[AWS] +// snippet-start:[redshift.java.ListEvents.complete] +import java.io.IOException; +import java.util.Date; +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.PropertiesCredentials; +import com.amazonaws.services.redshift.AmazonRedshiftClient; +import com.amazonaws.services.redshift.model.*; + +public class ListEvents { + + public static AmazonRedshiftClient client; + public static String clusterIdentifier = "***provide cluster identifier***"; + public static String eventSourceType = "***provide source type***"; // e.g. cluster-snapshot + + public static void main(String[] args) throws IOException { + + AWSCredentials credentials = new PropertiesCredentials( + ListEvents.class + .getResourceAsStream("AwsCredentials.properties")); + + client = new AmazonRedshiftClient(credentials); + + try { + listEvents(); + } catch (Exception e) { + System.err.println("Operation failed: " + e.getMessage()); + } + } + + private static void listEvents() { + long oneWeeksAgoMilli = (new Date()).getTime() - (7L*24L*60L*60L*1000L); + Date oneWeekAgo = new Date(); + oneWeekAgo.setTime(oneWeeksAgoMilli); + String marker = null; + + do { + DescribeEventsRequest request = new DescribeEventsRequest() + .withSourceIdentifier(clusterIdentifier) + .withSourceType(eventSourceType) + .withStartTime(oneWeekAgo) + .withMaxRecords(20); + DescribeEventsResult result = client.describeEvents(request); + marker = result.getMarker(); + for (Event event : result.getEvents()) { + printEvent(event); + } + } while (marker != null); + + + } + static void printEvent(Event event) + { + if (event == null) + { + System.out.println("\nEvent object is null."); + return; + } + + System.out.println("\nEvent metadata:\n"); + System.out.format("SourceID: %s\n", event.getSourceIdentifier()); + System.out.format("Type: %s\n", event.getSourceType()); + System.out.format("Message: %s\n", event.getMessage()); + System.out.format("Date: %s\n", event.getDate()); + } +} +// snippet-end:[redshift.java.ListEvents.complete] \ No newline at end of file diff --git a/java/example_code/rekognition/rekognition-collection-java-add-faces-to-collection.java b/java/example_code/rekognition/rekognition-collection-java-add-faces-to-collection.java new file mode 100755 index 00000000000..be64c4680a1 --- /dev/null +++ b/java/example_code/rekognition/rekognition-collection-java-add-faces-to-collection.java @@ -0,0 +1,86 @@ +// snippet-sourcedescription:[rekognition-collection-java-add-faces-to-collection.java demonstrates how to add faces, detected in an image, to an Amazon Rekognition collection.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[IndexFaces] +// snippet-keyword:[Collection] +// snippet-keyword:[Image] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-collection-java-add-faces-to-collection.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + + +package aws.example.rekognition.collection; + +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.FaceRecord; +import com.amazonaws.services.rekognition.model.Image; +import com.amazonaws.services.rekognition.model.IndexFacesRequest; +import com.amazonaws.services.rekognition.model.IndexFacesResult; +import com.amazonaws.services.rekognition.model.QualityFilter; +import com.amazonaws.services.rekognition.model.S3Object; +import com.amazonaws.services.rekognition.model.UnindexedFace; +import java.util.List; + +public class AddFacesToCollection { + // replace bucket, collectionId, and photo with your values. + public static final String collectionId = "MyCollection"; + public static final String bucket = "bucket"; + public static final String photo = "input.jpg"; + + public static void main(String[] args) throws Exception { + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + Image image = new Image() + .withS3Object(new S3Object() + .withBucket(bucket) + .withName(photo)); + + IndexFacesRequest indexFacesRequest = new IndexFacesRequest() + .withImage(image) + .withQualityFilter(QualityFilter.AUTO) + .withMaxFaces(1) + .withCollectionId(collectionId) + .withExternalImageId(photo) + .withDetectionAttributes("DEFAULT"); + + IndexFacesResult indexFacesResult = rekognitionClient.indexFaces(indexFacesRequest); + + System.out.println("Results for " + photo); + System.out.println("Faces indexed:"); + List faceRecords = indexFacesResult.getFaceRecords(); + for (FaceRecord faceRecord : faceRecords) { + System.out.println(" Face ID: " + faceRecord.getFace().getFaceId()); + System.out.println(" Location:" + faceRecord.getFaceDetail().getBoundingBox().toString()); + } + + List unindexedFaces = indexFacesResult.getUnindexedFaces(); + System.out.println("Faces not indexed:"); + for (UnindexedFace unindexedFace : unindexedFaces) { + System.out.println(" Location:" + unindexedFace.getFaceDetail().getBoundingBox().toString()); + System.out.println(" Reasons:"); + for (String reason : unindexedFace.getReasons()) { + System.out.println(" " + reason); + } + } + } +} +// snippet-end:[rekognition.java.rekognition-collection-java-add-faces-to-collection.complete] \ No newline at end of file diff --git a/java/example_code/rekognition/rekognition-collection-java-create-collection.java b/java/example_code/rekognition/rekognition-collection-java-create-collection.java new file mode 100755 index 00000000000..3592a29644c --- /dev/null +++ b/java/example_code/rekognition/rekognition-collection-java-create-collection.java @@ -0,0 +1,62 @@ +// snippet-sourcedescription:[rekognition-collection-java-create-collection.java demonstrates how to delete an Amazon Rekognition collection.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[CreateCollection] +// snippet-keyword:[Collection] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-collection-java-create-collection] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.collection; + +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.CreateCollectionRequest; +import com.amazonaws.services.rekognition.model.CreateCollectionResult; + + +public class CreateCollection { + + public static void main(String[] args) throws Exception { + + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + //Replace colectionId with the name of the collection that you want to create. + + String collectionId = "MyCollection"; + System.out.println("Creating collection: " + + collectionId ); + + CreateCollectionRequest request = new CreateCollectionRequest() + .withCollectionId(collectionId); + + CreateCollectionResult createCollectionResult = rekognitionClient.createCollection(request); + System.out.println("CollectionArn : " + + createCollectionResult.getCollectionArn()); + System.out.println("Status code : " + + createCollectionResult.getStatusCode().toString()); + + } + +} +// snippet-end:[rekognition.java.rekognition-collection-java-create-collection] + + diff --git a/java/example_code/rekognition/rekognition-collection-java-delete-collection.java b/java/example_code/rekognition/rekognition-collection-java-delete-collection.java new file mode 100755 index 00000000000..de7bd0556af --- /dev/null +++ b/java/example_code/rekognition/rekognition-collection-java-delete-collection.java @@ -0,0 +1,58 @@ +// snippet-sourcedescription:[rekognition-collection-java-delete-collection.java demonstrates how to delete an Amazon Rekognition collection.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[DeleteCollection] +// snippet-keyword:[Collection] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-collection-java-delete-collection.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.collection; +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.DeleteCollectionRequest; +import com.amazonaws.services.rekognition.model.DeleteCollectionResult; + + +public class DeleteCollection { + + public static void main(String[] args) throws Exception { + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + // Replace collectionId with the ID of the collection that you want to delete. + String collectionId = "MyCollection"; + + System.out.println("Deleting collections"); + + DeleteCollectionRequest request = new DeleteCollectionRequest() + .withCollectionId(collectionId); + DeleteCollectionResult deleteCollectionResult = rekognitionClient.deleteCollection(request); + + System.out.println(collectionId + ": " + deleteCollectionResult.getStatusCode() + .toString()); + + } + +} +// snippet-end:[rekognition.java.rekognition-collection-java-delete-collection.complete] + + + + diff --git a/java/example_code/rekognition/rekognition-collection-java-describe-collection.java b/java/example_code/rekognition/rekognition-collection-java-describe-collection.java new file mode 100644 index 00000000000..7de34e87902 --- /dev/null +++ b/java/example_code/rekognition/rekognition-collection-java-describe-collection.java @@ -0,0 +1,67 @@ +// snippet-sourcedescription:[rekognition-collection-java-describe-collection.java demonstrates how to get a description of an Amazon Rekognition collection.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[DescribeCollection] +// snippet-keyword:[Collection] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-collection-java-describe-collection.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.collection; + +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.DescribeCollectionRequest; +import com.amazonaws.services.rekognition.model.DescribeCollectionResult; + + +public class DescribeCollection { + + public static void main(String[] args) throws Exception { + //Change collectionID to the name of the desired collection. + String collectionId = "CollectionID"; + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + + System.out.println("Describing collection: " + + collectionId ); + + + DescribeCollectionRequest request = new DescribeCollectionRequest() + .withCollectionId(collectionId); + + DescribeCollectionResult describeCollectionResult = rekognitionClient.describeCollection(request); + System.out.println("Collection Arn : " + + describeCollectionResult.getCollectionARN()); + System.out.println("Face count : " + + describeCollectionResult.getFaceCount().toString()); + System.out.println("Face model version : " + + describeCollectionResult.getFaceModelVersion()); + System.out.println("Created : " + + describeCollectionResult.getCreationTimestamp().toString()); + + } + +} + +// snippet-end:[rekognition.java.rekognition-collection-java-describe-collection.complete] + + diff --git a/java/example_code/rekognition/rekognition-collection-java-list-collections.java b/java/example_code/rekognition/rekognition-collection-java-list-collections.java new file mode 100755 index 00000000000..3f0ac35a51d --- /dev/null +++ b/java/example_code/rekognition/rekognition-collection-java-list-collections.java @@ -0,0 +1,66 @@ +// snippet-sourcedescription:[rekognition-collection-java-list-collections.java demonstrates how to list the available Amazon Rekognition collections.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ListCollections] +// snippet-keyword:[Collection] +// snippet-keyword:[Image] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-collection-java-list-collections.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.collection; + +import java.util.List; +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.ListCollectionsRequest; +import com.amazonaws.services.rekognition.model.ListCollectionsResult; + +public class ListCollections { + + public static void main(String[] args) throws Exception { + + + AmazonRekognition amazonRekognition = AmazonRekognitionClientBuilder.defaultClient(); + + + System.out.println("Listing collections"); + int limit = 10; + ListCollectionsResult listCollectionsResult = null; + String paginationToken = null; + do { + if (listCollectionsResult != null) { + paginationToken = listCollectionsResult.getNextToken(); + } + ListCollectionsRequest listCollectionsRequest = new ListCollectionsRequest() + .withMaxResults(limit) + .withNextToken(paginationToken); + listCollectionsResult=amazonRekognition.listCollections(listCollectionsRequest); + + List < String > collectionIds = listCollectionsResult.getCollectionIds(); + for (String resultId: collectionIds) { + System.out.println(resultId); + } + } while (listCollectionsResult != null && listCollectionsResult.getNextToken() != + null); + + } +} +// snippet-end:[rekognition.java.rekognition-collection-java-list-collections.complete] \ No newline at end of file diff --git a/java/example_code/rekognition/rekognition-collection-java-list-faces-in-collection.java b/java/example_code/rekognition/rekognition-collection-java-list-faces-in-collection.java new file mode 100755 index 00000000000..030d1f4d18d --- /dev/null +++ b/java/example_code/rekognition/rekognition-collection-java-list-faces-in-collection.java @@ -0,0 +1,75 @@ +// snippet-sourcedescription:[rekognition-collection-java-list-faces-in-collection.java demonstrates how to list the faces in an Amazon Rekognition collection.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[ListFaces] +// snippet-keyword:[Collection] +// snippet-keyword:[Image] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-collection-java-list-faces-in-collection.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ +package aws.example.rekognition.collection; +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.Face; +import com.amazonaws.services.rekognition.model.ListFacesRequest; +import com.amazonaws.services.rekognition.model.ListFacesResult; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; + + + +public class ListFacesInCollection { + // Change collectionId to the required collection. + public static final String collectionId = "MyCollection"; + + public static void main(String[] args) throws Exception { + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + ObjectMapper objectMapper = new ObjectMapper(); + + ListFacesResult listFacesResult = null; + System.out.println("Faces in collection " + collectionId); + + String paginationToken = null; + do { + if (listFacesResult != null) { + paginationToken = listFacesResult.getNextToken(); + } + + ListFacesRequest listFacesRequest = new ListFacesRequest() + .withCollectionId(collectionId) + .withMaxResults(1) + .withNextToken(paginationToken); + + listFacesResult = rekognitionClient.listFaces(listFacesRequest); + List < Face > faces = listFacesResult.getFaces(); + for (Face face: faces) { + System.out.println(objectMapper.writerWithDefaultPrettyPrinter() + .writeValueAsString(face)); + } + } while (listFacesResult != null && listFacesResult.getNextToken() != + null); + } + +} +// snippet-end:[rekognition.java.rekognition-collection-java-list-faces-in-collection.complete] + + \ No newline at end of file diff --git a/java/example_code/rekognition/rekognition-collection-java-search-face-matching-id-collection.java b/java/example_code/rekognition/rekognition-collection-java-search-face-matching-id-collection.java new file mode 100755 index 00000000000..e32f11818fc --- /dev/null +++ b/java/example_code/rekognition/rekognition-collection-java-search-face-matching-id-collection.java @@ -0,0 +1,71 @@ +// snippet-sourcedescription:[rekognition-collection-java-search-face-matching-id-collection.java demonstrates how to search for faces in a collection that match a face ID.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[SearchFacesById] +// snippet-keyword:[Collection] +// snippet-keyword:[Image] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-collection-java-search-face-matching-id-collection.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.collection; +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.amazonaws.services.rekognition.model.FaceMatch; +import com.amazonaws.services.rekognition.model.SearchFacesRequest; +import com.amazonaws.services.rekognition.model.SearchFacesResult; +import java.util.List; + + + public class SearchFaceMatchingIdCollection { + //Replace collectionId and faceId with the values you want to use. + public static final String collectionId = "MyCollection"; + public static final String faceId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + + public static void main(String[] args) throws Exception { + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + ObjectMapper objectMapper = new ObjectMapper(); + // Search collection for faces matching the face id. + + SearchFacesRequest searchFacesRequest = new SearchFacesRequest() + .withCollectionId(collectionId) + .withFaceId(faceId) + .withFaceMatchThreshold(70F) + .withMaxFaces(2); + + SearchFacesResult searchFacesByIdResult = + rekognitionClient.searchFaces(searchFacesRequest); + + System.out.println("Face matching faceId " + faceId); + List < FaceMatch > faceImageMatches = searchFacesByIdResult.getFaceMatches(); + for (FaceMatch face: faceImageMatches) { + System.out.println(objectMapper.writerWithDefaultPrettyPrinter() + .writeValueAsString(face)); + + System.out.println(); + } + } + +} +// snippet-end:[rekognition.java.rekognition-collection-java-search-face-matching-id-collection.complete] + \ No newline at end of file diff --git a/java/example_code/rekognition/rekognition-collection-java-search-face-matching-image-collection.java b/java/example_code/rekognition/rekognition-collection-java-search-face-matching-image-collection.java new file mode 100755 index 00000000000..6d05b546823 --- /dev/null +++ b/java/example_code/rekognition/rekognition-collection-java-search-face-matching-image-collection.java @@ -0,0 +1,80 @@ +// snippet-sourcedescription:[rekognition-collection-java-search-face-matching-image-collection.java demonstrates how to search for matching faces in an Amazon Rekognition collection.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[SearchFacesByImage] +// snippet-keyword:[Collection] +// snippet-keyword:[Image] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-collection-java-search-face-matching-image-collection.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.collection; +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.FaceMatch; +import com.amazonaws.services.rekognition.model.Image; +import com.amazonaws.services.rekognition.model.S3Object; +import com.amazonaws.services.rekognition.model.SearchFacesByImageRequest; +import com.amazonaws.services.rekognition.model.SearchFacesByImageResult; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; + + +public class SearchFaceMatchingImageCollection { + //Replace bucket, collectionId and photo with your values. + public static final String collectionId = "MyCollection"; + public static final String bucket = "bucket"; + public static final String photo = "input.jpg"; + + public static void main(String[] args) throws Exception { + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + ObjectMapper objectMapper = new ObjectMapper(); + + // Get an image object from S3 bucket. + Image image=new Image() + .withS3Object(new S3Object() + .withBucket(bucket) + .withName(photo)); + + // Search collection for faces similar to the largest face in the image. + SearchFacesByImageRequest searchFacesByImageRequest = new SearchFacesByImageRequest() + .withCollectionId(collectionId) + .withImage(image) + .withFaceMatchThreshold(70F) + .withMaxFaces(2); + + SearchFacesByImageResult searchFacesByImageResult = + rekognitionClient.searchFacesByImage(searchFacesByImageRequest); + + System.out.println("Faces matching largest face in image from" + photo); + List < FaceMatch > faceImageMatches = searchFacesByImageResult.getFaceMatches(); + for (FaceMatch face: faceImageMatches) { + System.out.println(objectMapper.writerWithDefaultPrettyPrinter() + .writeValueAsString(face)); + System.out.println(); + } + } +} +// snippet-end:[rekognition.java.rekognition-collection-java-search-face-matching-image-collection.complete] + + + \ No newline at end of file diff --git a/java/example_code/rekognition/rekognition-image-java-celebrity-info.java b/java/example_code/rekognition/rekognition-image-java-celebrity-info.java new file mode 100755 index 00000000000..985e0e2a3aa --- /dev/null +++ b/java/example_code/rekognition/rekognition-image-java-celebrity-info.java @@ -0,0 +1,57 @@ +// snippet-sourcedescription:[rekognition-image-java-celebrity-info.java demonstrates how to get information about a detected celebrity.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[GetCelebrityInfo] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-image-java-celebrity-info.] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.image; +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.GetCelebrityInfoRequest; +import com.amazonaws.services.rekognition.model.GetCelebrityInfoResult; + + +public class CelebrityInfo { + + public static void main(String[] args) { + //Change the value of id to an ID value returned by RecognizeCelebrities or GetCelebrityRecognition + String id = "nnnnnnnn"; + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + GetCelebrityInfoRequest request = new GetCelebrityInfoRequest() + .withId(id); + + System.out.println("Getting information for celebrity: " + id); + + GetCelebrityInfoResult result=rekognitionClient.getCelebrityInfo(request); + + //Display celebrity information + System.out.println("celebrity name: " + result.getName()); + System.out.println("Further information (if available):"); + for (String url: result.getUrls()){ + System.out.println(url); + } + } +} +// snippet-end:[rekognition.java.rekognition-image-java-celebrity-info.] + \ No newline at end of file diff --git a/java/example_code/rekognition/rekognition-image-java-compare-faces.java b/java/example_code/rekognition/rekognition-image-java-compare-faces.java new file mode 100755 index 00000000000..c5cb2825495 --- /dev/null +++ b/java/example_code/rekognition/rekognition-image-java-compare-faces.java @@ -0,0 +1,107 @@ +// snippet-sourcedescription:[rekognition-image-java-compare-faces.java demonstrates how to compare 2 faces.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[CompareFaces] +// snippet-keyword:[Image] +// snippet-keyword:[Local] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-image-java-compare-faces] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.image; +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.Image; +import com.amazonaws.services.rekognition.model.BoundingBox; +import com.amazonaws.services.rekognition.model.CompareFacesMatch; +import com.amazonaws.services.rekognition.model.CompareFacesRequest; +import com.amazonaws.services.rekognition.model.CompareFacesResult; +import com.amazonaws.services.rekognition.model.ComparedFace; +import java.util.List; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.nio.ByteBuffer; +import com.amazonaws.util.IOUtils; + +public class CompareFaces { + + public static void main(String[] args) throws Exception{ + Float similarityThreshold = 70F; + //Replace sourceFile and targetFile with the image files you want to compare. + String sourceImage = "source.jpg"; + String targetImage = "target.jpg"; + ByteBuffer sourceImageBytes=null; + ByteBuffer targetImageBytes=null; + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + //Load source and target images and create input parameters + try (InputStream inputStream = new FileInputStream(new File(sourceImage))) { + sourceImageBytes = ByteBuffer.wrap(IOUtils.toByteArray(inputStream)); + } + catch(Exception e) + { + System.out.println("Failed to load source image " + sourceImage); + System.exit(1); + } + try (InputStream inputStream = new FileInputStream(new File(targetImage))) { + targetImageBytes = ByteBuffer.wrap(IOUtils.toByteArray(inputStream)); + } + catch(Exception e) + { + System.out.println("Failed to load target images: " + targetImage); + System.exit(1); + } + + Image source=new Image() + .withBytes(sourceImageBytes); + Image target=new Image() + .withBytes(targetImageBytes); + + CompareFacesRequest request = new CompareFacesRequest() + .withSourceImage(source) + .withTargetImage(target) + .withSimilarityThreshold(similarityThreshold); + + // Call operation + CompareFacesResult compareFacesResult=rekognitionClient.compareFaces(request); + + + // Display results + List faceDetails = compareFacesResult.getFaceMatches(); + for (CompareFacesMatch match: faceDetails){ + ComparedFace face= match.getFace(); + BoundingBox position = face.getBoundingBox(); + System.out.println("Face at " + position.getLeft().toString() + + " " + position.getTop() + + " matches with " + face.getConfidence().toString() + + "% confidence."); + + } + List uncompared = compareFacesResult.getUnmatchedFaces(); + + System.out.println("There was " + uncompared.size() + + " face(s) that did not match"); + System.out.println("Source image rotation: " + compareFacesResult.getSourceImageOrientationCorrection()); + System.out.println("target image rotation: " + compareFacesResult.getTargetImageOrientationCorrection()); + } +} +// snippet-end:[rekognition.java.rekognition-image-java-compare-faces] \ No newline at end of file diff --git a/java/example_code/rekognition/rekognition-image-java-delete-faces-from-collection.java b/java/example_code/rekognition/rekognition-image-java-delete-faces-from-collection.java new file mode 100755 index 00000000000..93c8c35958d --- /dev/null +++ b/java/example_code/rekognition/rekognition-image-java-delete-faces-from-collection.java @@ -0,0 +1,67 @@ +// snippet-sourcedescription:[rekognition-image-java-delete-faces-from-collection.java demonstrates how to delete a face from an Amazon Rekognition collection.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[DeleteFaces] +// snippet-keyword:[Collection] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-image-java-delete-faces-from-collection.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.image; +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.DeleteFacesRequest; +import com.amazonaws.services.rekognition.model.DeleteFacesResult; + +import java.util.List; + + +public class DeleteFacesFromCollection { + //Change collectionID to the collection that contains the face. + //Change "xxxxxx..." to the ID of the face that you want to delete. + public static final String collectionId = "MyCollection"; + public static final String faces[] = {"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}; + + public static void main(String[] args) throws Exception { + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + + DeleteFacesRequest deleteFacesRequest = new DeleteFacesRequest() + .withCollectionId(collectionId) + .withFaceIds(faces); + + DeleteFacesResult deleteFacesResult=rekognitionClient.deleteFaces(deleteFacesRequest); + + + List < String > faceRecords = deleteFacesResult.getDeletedFaces(); + System.out.println(Integer.toString(faceRecords.size()) + " face(s) deleted:"); + for (String face: faceRecords) { + System.out.println("FaceID: " + face); + } + } +} +// snippet-end:[rekognition.java.rekognition-image-java-delete-faces-from-collection.complete] + + + + + + diff --git a/java/example_code/rekognition/rekognition-image-java-detect-faces.java b/java/example_code/rekognition/rekognition-image-java-detect-faces.java new file mode 100755 index 00000000000..419a62e7b09 --- /dev/null +++ b/java/example_code/rekognition/rekognition-image-java-detect-faces.java @@ -0,0 +1,91 @@ +// snippet-sourcedescription:[rekognition-image-java-detect-faces.java demonstrates how to detect faces in an image loaded from an S3 Bucket.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[DetectFaces] +// snippet-keyword:[S3 Bucket] +// snippet-keyword:[Image] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-image-java-detect-faces.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.image; + +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.services.rekognition.model.AmazonRekognitionException; +import com.amazonaws.services.rekognition.model.Image; +import com.amazonaws.services.rekognition.model.S3Object; +import com.amazonaws.services.rekognition.model.AgeRange; +import com.amazonaws.services.rekognition.model.Attribute; +import com.amazonaws.services.rekognition.model.DetectFacesRequest; +import com.amazonaws.services.rekognition.model.DetectFacesResult; +import com.amazonaws.services.rekognition.model.FaceDetail; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; + + +public class DetectFaces { + + + public static void main(String[] args) throws Exception { + // Change bucket to your S3 bucket that contains the image file. + // Change photo to your image file. + String photo = "input.jpg"; + String bucket = "bucket"; + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + + DetectFacesRequest request = new DetectFacesRequest() + .withImage(new Image() + .withS3Object(new S3Object() + .withName(photo) + .withBucket(bucket))) + .withAttributes(Attribute.ALL); + // Replace Attribute.ALL with Attribute.DEFAULT to get default values. + + try { + DetectFacesResult result = rekognitionClient.detectFaces(request); + List < FaceDetail > faceDetails = result.getFaceDetails(); + + for (FaceDetail face: faceDetails) { + if (request.getAttributes().contains("ALL")) { + AgeRange ageRange = face.getAgeRange(); + System.out.println("The detected face is estimated to be between " + + ageRange.getLow().toString() + " and " + ageRange.getHigh().toString() + + " years old."); + System.out.println("Here's the complete set of attributes:"); + } else { // non-default attributes have null values. + System.out.println("Here's the default set of attributes:"); + } + + ObjectMapper objectMapper = new ObjectMapper(); + System.out.println(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(face)); + } + + } catch (AmazonRekognitionException e) { + e.printStackTrace(); + } + + } + +} +// snippet-end:[rekognition.java.rekognition-image-java-detect-faces.complete] + diff --git a/java/example_code/rekognition/rekognition-image-java-detect-labels-local-file.java b/java/example_code/rekognition/rekognition-image-java-detect-labels-local-file.java new file mode 100755 index 00000000000..6c9eb3238da --- /dev/null +++ b/java/example_code/rekognition/rekognition-image-java-detect-labels-local-file.java @@ -0,0 +1,80 @@ +// snippet-sourcedescription:[rekognition-image-java-detect-labels-local-file.java demonstrates how to detect unsafe content in an image loaded from a local file.] +// snippet-service:[rekognition] +// snippet-keyword:[Java] +// snippet-keyword:[Amazon Rekognition] +// snippet-keyword:[Code Sample] +// snippet-keyword:[DetectLabels] +// snippet-keyword:[Local] +// snippet-keyword:[Image] +// snippet-sourcetype:[full-example] +// snippet-sourcedate:[2019-01-18] +// snippet-sourceauthor:[reesch(AWS)] +// snippet-start:[rekognition.java.rekognition-image-java-detect-labels-local-file.complete] + +/** + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * This file is licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. +*/ + +package aws.example.rekognition.image; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.List; +import com.amazonaws.services.rekognition.AmazonRekognition; +import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; +import com.amazonaws.AmazonClientException; +import com.amazonaws.services.rekognition.model.AmazonRekognitionException; +import com.amazonaws.services.rekognition.model.DetectLabelsRequest; +import com.amazonaws.services.rekognition.model.DetectLabelsResult; +import com.amazonaws.services.rekognition.model.Image; +import com.amazonaws.services.rekognition.model.Label; +import com.amazonaws.util.IOUtils; + +public class DetectLabelsLocalFile { + public static void main(String[] args) throws Exception { + // Change photo to the path and filename of your image. + String photo="input.jpg"; + + + ByteBuffer imageBytes; + try (InputStream inputStream = new FileInputStream(new File(photo))) { + imageBytes = ByteBuffer.wrap(IOUtils.toByteArray(inputStream)); + } + + + AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); + + DetectLabelsRequest request = new DetectLabelsRequest() + .withImage(new Image() + .withBytes(imageBytes)) + .withMaxLabels(10) + .withMinConfidence(77F); + + try { + + DetectLabelsResult result = rekognitionClient.detectLabels(request); + List