Skip to content

Commit

Permalink
# This is a combination of 2 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

fixing snippet build error

# The commit message #2 will be skipped:

# Updating copyright to 2019
  • Loading branch information
jschwarzwalder committed Jan 4, 2019
1 parent 9d9c3c9 commit 9191233
Show file tree
Hide file tree
Showing 105 changed files with 797 additions and 798 deletions.
164 changes: 82 additions & 82 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
.. Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
International License (the "License"). You may not use this file except in compliance with the
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.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 repository contains AWS SDK code examples used in the public `AWS documentation repositories
<https://www.github.com/awsdocs>`_.

About the examples
==================

The code examples are organized by programming language. For instance, all of the examples for the
`AWS SDK for Java Developer Guide <https://www.github.com/awsdocs/aws-java-developer-guide>`_ are
kept in the `java <java>`_ directory.

Building and running examples
-----------------------------

Inside each of the language-specific directories, you'll find a **README** file that explains how to
build and run the examples contained within it.

The example code inside the language-specific directories is organized by
the AWS service abbreviation ("s3" for `Amazon S3 <https://aws.amazon.com/s3>`_ examples, and so
on).

Submitting code examples for use in AWS documentation
=====================================================

If you plan to contribute examples for use in the documentation (the purpose of this repository),
please read this section carefully so that we can work together more effectively.

* **Make sure that the code can be built and run**. There's nothing more frustrating in developer
documentation than code examples that don't work. Build the code and test it before submitting it!

* **Do not include personal account data, keys or IDs in your examples**. Code should obtain access
keys from the standard SDK credentials and config files, use environment variables or external
data files, or query the user for this information.

* **Format code lines to 80 characters**. Long lines can be enclosed in a scrollable box for HTML,
but in a PDF build, long lines will often spill off the side of the page, making the code
unreadable. If your code includes long text strings, consider breaking these into smaller chunks
and concatenating them together.

* **Use short(er) variable names**. To aid in readability and to help keep line length down, use
*short yet descriptive* names for variables. Do *not* simply mimic class names when creating
variables that represent an object of that class. It nearly always results in excessively long
variable names, making it difficult to keep code lines within 80 characters.

* **Use spaces, not tabs, for indentation**. Tabs are variable-length in most editors, but will
usually render as 8 characters wide in printed documentation. *Always use spaces* to ensure
consistent formatting in printed code.

You can ignore this rule for makefiles, which may *require* the use of tabs, but these are
typically only used for building examples, and are not included in documentation.

* **Minimize the use of comments**. Code is ignored for translation, so comments in code are not
translated for the printed documentation's target language. Comments should not be needed in most
code used for documentation, since the goal is clarity and ease of understanding. By making code
self-explanatory, you'll make better code for documentation and reduce the need to add comments.

* **Place comments on separate lines from code**. If you *must* add a comment for explanation or any
other purpose, make sure that it's placed on a separate line from code (*not* inline). This
allows readers of the source file to read the comment, yet it can be stripped out when including
snippets from the file within documentation.

* **All code must be submitted under the Apache 2.0 license**, as noted in the following **Copyright
and License** section.

Copyright and License
=====================

All content in this repository, unless otherwise stated, is Copyright © 2010-2018, Amazon Web
Services, Inc. or its affiliates. All rights reserved.

Except where otherwise noted, all examples in this collection are licensed under the `Apache
license, version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`_ (the "License"). The full
license text is provided in the ``LICENSE`` file accompanying this repository.
.. Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
International License (the "License"). You may not use this file except in compliance with the
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.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 repository contains AWS SDK code examples used in the public `AWS documentation repositories
<https://www.github.com/awsdocs>`_.

About the examples
==================

The code examples are organized by programming language. For instance, all of the examples for the
`AWS SDK for Java Developer Guide <https://www.github.com/awsdocs/aws-java-developer-guide>`_ are
kept in the `java <java>`_ directory.

Building and running examples
-----------------------------

Inside each of the language-specific directories, you'll find a **README** file that explains how to
build and run the examples contained within it.

The example code inside the language-specific directories is organized by
the AWS service abbreviation ("s3" for `Amazon S3 <https://aws.amazon.com/s3>`_ examples, and so
on).

Submitting code examples for use in AWS documentation
=====================================================

If you plan to contribute examples for use in the documentation (the purpose of this repository),
please read this section carefully so that we can work together more effectively.

* **Make sure that the code can be built and run**. There's nothing more frustrating in developer
documentation than code examples that don't work. Build the code and test it before submitting it!

* **Do not include personal account data, keys or IDs in your examples**. Code should obtain access
keys from the standard SDK credentials and config files, use environment variables or external
data files, or query the user for this information.

* **Format code lines to 80 characters**. Long lines can be enclosed in a scrollable box for HTML,
but in a PDF build, long lines will often spill off the side of the page, making the code
unreadable. If your code includes long text strings, consider breaking these into smaller chunks
and concatenating them together.

* **Use short(er) variable names**. To aid in readability and to help keep line length down, use
*short yet descriptive* names for variables. Do *not* simply mimic class names when creating
variables that represent an object of that class. It nearly always results in excessively long
variable names, making it difficult to keep code lines within 80 characters.

* **Use spaces, not tabs, for indentation**. Tabs are variable-length in most editors, but will
usually render as 8 characters wide in printed documentation. *Always use spaces* to ensure
consistent formatting in printed code.

You can ignore this rule for makefiles, which may *require* the use of tabs, but these are
typically only used for building examples, and are not included in documentation.

* **Minimize the use of comments**. Code is ignored for translation, so comments in code are not
translated for the printed documentation's target language. Comments should not be needed in most
code used for documentation, since the goal is clarity and ease of understanding. By making code
self-explanatory, you'll make better code for documentation and reduce the need to add comments.

* **Place comments on separate lines from code**. If you *must* add a comment for explanation or any
other purpose, make sure that it's placed on a separate line from code (*not* inline). This
allows readers of the source file to read the comment, yet it can be stripped out when including
snippets from the file within documentation.

* **All code must be submitted under the Apache 2.0 license**, as noted in the following **Copyright
and License** section.

Copyright and License
=====================

All content in this repository, unless otherwise stated, is Copyright © 2010-2018, Amazon Web
Services, Inc. or its affiliates. All rights reserved.

Except where otherwise noted, all examples in this collection are licensed under the `Apache
license, version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`_ (the "License"). The full
license text is provided in the ``LICENSE`` file accompanying this repository.
56 changes: 28 additions & 28 deletions cpp/example_code/cloudtrail/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Copyright 2010-2018 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.

cmake_minimum_required(VERSION 3.2)
project(cloudtrail-examples)
set (CMAKE_CXX_STANDARD 11)

# Locate the aws sdk for c++ package.
find_package(AWSSDK REQUIRED COMPONENTS cloudtrail)

set(EXAMPLES "")
list(APPEND EXAMPLES "create_trail")
list(APPEND EXAMPLES "delete_trail")
list(APPEND EXAMPLES "describe_trails")
list(APPEND EXAMPLES "lookup_events")

# The executables to build.
foreach(EXAMPLE IN LISTS EXAMPLES)
add_executable(${EXAMPLE} ${EXAMPLE}.cpp)
target_link_libraries(${EXAMPLE} ${AWSSDK_LINK_LIBRARIES})
endforeach()

# Copyright 2010-2018 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.

cmake_minimum_required(VERSION 3.2)
project(cloudtrail-examples)
set (CMAKE_CXX_STANDARD 11)

# Locate the aws sdk for c++ package.
find_package(AWSSDK REQUIRED COMPONENTS cloudtrail)

set(EXAMPLES "")
list(APPEND EXAMPLES "create_trail")
list(APPEND EXAMPLES "delete_trail")
list(APPEND EXAMPLES "describe_trails")
list(APPEND EXAMPLES "lookup_events")

# The executables to build.
foreach(EXAMPLE IN LISTS EXAMPLES)
add_executable(${EXAMPLE} ${EXAMPLE}.cpp)
target_link_libraries(${EXAMPLE} ${AWSSDK_LINK_LIBRARIES})
endforeach()

74 changes: 37 additions & 37 deletions cpp/example_code/cloudwatch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# Copyright 2010-2018 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.

cmake_minimum_required(VERSION 3.2)
project(cloudwatch-examples)
set (CMAKE_CXX_STANDARD 11)

# Locate the aws sdk for c++ package.
find_package(AWSSDK REQUIRED COMPONENTS monitoring events logs)

set(EXAMPLES "")
list(APPEND EXAMPLES "describe_alarms")
list(APPEND EXAMPLES "delete_alarm")
list(APPEND EXAMPLES "put_metric_alarm")
list(APPEND EXAMPLES "enable_alarm_actions")
list(APPEND EXAMPLES "disable_alarm_actions")
list(APPEND EXAMPLES "list_metrics")
list(APPEND EXAMPLES "put_metric_data")
list(APPEND EXAMPLES "put_rule")
list(APPEND EXAMPLES "put_targets")
list(APPEND EXAMPLES "put_events")
list(APPEND EXAMPLES "describe_subscription_filters")
list(APPEND EXAMPLES "delete_subscription_filter")
list(APPEND EXAMPLES "put_subscription_filter")

# The executables to build.
foreach(EXAMPLE IN LISTS EXAMPLES)
add_executable(${EXAMPLE} ${EXAMPLE}.cpp)
target_link_libraries(${EXAMPLE} ${AWSSDK_LINK_LIBRARIES})
endforeach()

# Copyright 2010-2018 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.

cmake_minimum_required(VERSION 3.2)
project(cloudwatch-examples)
set (CMAKE_CXX_STANDARD 11)

# Locate the aws sdk for c++ package.
find_package(AWSSDK REQUIRED COMPONENTS monitoring events logs)

set(EXAMPLES "")
list(APPEND EXAMPLES "describe_alarms")
list(APPEND EXAMPLES "delete_alarm")
list(APPEND EXAMPLES "put_metric_alarm")
list(APPEND EXAMPLES "enable_alarm_actions")
list(APPEND EXAMPLES "disable_alarm_actions")
list(APPEND EXAMPLES "list_metrics")
list(APPEND EXAMPLES "put_metric_data")
list(APPEND EXAMPLES "put_rule")
list(APPEND EXAMPLES "put_targets")
list(APPEND EXAMPLES "put_events")
list(APPEND EXAMPLES "describe_subscription_filters")
list(APPEND EXAMPLES "delete_subscription_filter")
list(APPEND EXAMPLES "put_subscription_filter")

# The executables to build.
foreach(EXAMPLE IN LISTS EXAMPLES)
add_executable(${EXAMPLE} ${EXAMPLE}.cpp)
target_link_libraries(${EXAMPLE} ${AWSSDK_LINK_LIBRARIES})
endforeach()

2 changes: 1 addition & 1 deletion cpp/example_code/cloudwatch/disable_alarm_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


/*
Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
Expand Down
2 changes: 1 addition & 1 deletion cpp/example_code/cloudwatch/enable_alarm_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


/*
Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
Expand Down
2 changes: 1 addition & 1 deletion cpp/example_code/cloudwatch/list_metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


/*
Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
Expand Down
1 change: 0 additions & 1 deletion cpp/example_code/cloudwatch/put_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,3 @@ int main(int argc, char** argv)
return 0;
}


54 changes: 27 additions & 27 deletions cpp/example_code/codebuild/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Copyright 2010-2018 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.

cmake_minimum_required(VERSION 3.2)
project(codebuild-examples)
set (CMAKE_CXX_STANDARD 11)

# Locate the aws sdk for c++ package.
find_package(AWSSDK REQUIRED COMPONENTS codebuild)

set(EXAMPLES "")
list(APPEND EXAMPLES "build_project")
list(APPEND EXAMPLES "list_builds")
list(APPEND EXAMPLES "list_projects")


# The executables to build.
foreach(EXAMPLE IN LISTS EXAMPLES)
add_executable(${EXAMPLE} ${EXAMPLE}.cpp)
target_link_libraries(${EXAMPLE} ${AWSSDK_LINK_LIBRARIES})
endforeach()
# Copyright 2010-2018 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.

cmake_minimum_required(VERSION 3.2)
project(codebuild-examples)
set (CMAKE_CXX_STANDARD 11)

# Locate the aws sdk for c++ package.
find_package(AWSSDK REQUIRED COMPONENTS codebuild)

set(EXAMPLES "")
list(APPEND EXAMPLES "build_project")
list(APPEND EXAMPLES "list_builds")
list(APPEND EXAMPLES "list_projects")


# The executables to build.
foreach(EXAMPLE IN LISTS EXAMPLES)
add_executable(${EXAMPLE} ${EXAMPLE}.cpp)
target_link_libraries(${EXAMPLE} ${AWSSDK_LINK_LIBRARIES})
endforeach()
Loading

0 comments on commit 9191233

Please sign in to comment.