Skip to content

Commit 9dad776

Browse files
authored
4437 c++ aurora mvp (#4513)
c++ aurora mvp
1 parent e0c86e0 commit 9dad776

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2607
-35
lines changed

.doc_gen/metadata/aurora_metadata.yaml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ aurora_DescribeDBClusterParameterGroups:
5959
snippet_tags:
6060
- python.example_code.aurora.helper.AuroraWrapper_decl
6161
- python.example_code.aurora.DescribeDBClusterParameterGroups
62+
C++:
63+
versions:
64+
- sdk_version: 1
65+
github: cpp/example_code/aurora
66+
sdkguide:
67+
excerpts:
68+
- description:
69+
snippet_tags:
70+
- cpp.example_code.aurora.client_configuration
71+
- cpp.example_code.aurora.client
72+
- cpp.example_code.aurora.DescribeDBClusterParameterGroups1
73+
- cpp.example_code.aurora.DescribeDBClusterParameterGroups2
6274
services:
6375
aurora: {DescribeDBClusterParameterGroups}
6476
aurora_CreateDBClusterParameterGroup:
@@ -104,6 +116,17 @@ aurora_CreateDBClusterParameterGroup:
104116
snippet_tags:
105117
- python.example_code.aurora.helper.AuroraWrapper_decl
106118
- python.example_code.aurora.CreateDBClusterParameterGroup
119+
C++:
120+
versions:
121+
- sdk_version: 1
122+
github: cpp/example_code/aurora
123+
sdkguide:
124+
excerpts:
125+
- description:
126+
snippet_tags:
127+
- cpp.example_code.aurora.client_configuration
128+
- cpp.example_code.aurora.client
129+
- cpp.example_code.aurora.CreateDBClusterParameterGroup
107130
services:
108131
aurora: {CreateDBClusterParameterGroup}
109132
aurora_DeleteDBClusterParameterGroup:
@@ -149,6 +172,17 @@ aurora_DeleteDBClusterParameterGroup:
149172
snippet_tags:
150173
- python.example_code.aurora.helper.AuroraWrapper_decl
151174
- python.example_code.aurora.DeleteDBClusterParameterGroup
175+
C++:
176+
versions:
177+
- sdk_version: 1
178+
github: cpp/example_code/aurora
179+
sdkguide:
180+
excerpts:
181+
- description:
182+
snippet_tags:
183+
- cpp.example_code.aurora.client_configuration
184+
- cpp.example_code.aurora.client
185+
- cpp.example_code.aurora.DeleteDBClusterParameterGroup
152186
services:
153187
aurora: {DeleteDBClusterParameterGroup}
154188
aurora_DescribeDBClusterParameters:
@@ -194,6 +228,17 @@ aurora_DescribeDBClusterParameters:
194228
snippet_tags:
195229
- python.example_code.aurora.helper.AuroraWrapper_decl
196230
- python.example_code.aurora.DescribeDBClusterParameters
231+
C++:
232+
versions:
233+
- sdk_version: 1
234+
github: cpp/example_code/aurora
235+
sdkguide:
236+
excerpts:
237+
- description:
238+
snippet_tags:
239+
- cpp.example_code.aurora.client_configuration
240+
- cpp.example_code.aurora.client
241+
- cpp.example_code.aurora.DescribeDBClusterParameters
197242
services:
198243
aurora: {DescribeDBClusterParameters}
199244
aurora_ModifyDBClusterParameterGroup:
@@ -239,6 +284,17 @@ aurora_ModifyDBClusterParameterGroup:
239284
snippet_tags:
240285
- python.example_code.aurora.helper.AuroraWrapper_decl
241286
- python.example_code.aurora.ModifyDBClusterParameterGroup
287+
C++:
288+
versions:
289+
- sdk_version: 1
290+
github: cpp/example_code/aurora
291+
sdkguide:
292+
excerpts:
293+
- description:
294+
snippet_tags:
295+
- cpp.example_code.aurora.client_configuration
296+
- cpp.example_code.aurora.client
297+
- cpp.example_code.aurora.ModifyDBClusterParameterGroup
242298
services:
243299
aurora: {ModifyDBClusterParameterGroup}
244300
aurora_DescribeDBClusters:
@@ -284,6 +340,17 @@ aurora_DescribeDBClusters:
284340
snippet_tags:
285341
- python.example_code.aurora.helper.AuroraWrapper_decl
286342
- python.example_code.aurora.DescribeDBClusters
343+
C++:
344+
versions:
345+
- sdk_version: 1
346+
github: cpp/example_code/aurora
347+
sdkguide:
348+
excerpts:
349+
- description:
350+
snippet_tags:
351+
- cpp.example_code.aurora.client_configuration
352+
- cpp.example_code.aurora.client
353+
- cpp.example_code.aurora.DescribeDBClusters
287354
services:
288355
aurora: {DescribeDBClusters}
289356
aurora_CreateDBCluster:
@@ -329,6 +396,17 @@ aurora_CreateDBCluster:
329396
snippet_tags:
330397
- python.example_code.aurora.helper.AuroraWrapper_decl
331398
- python.example_code.aurora.CreateDBCluster
399+
C++:
400+
versions:
401+
- sdk_version: 1
402+
github: cpp/example_code/aurora
403+
sdkguide:
404+
excerpts:
405+
- description:
406+
snippet_tags:
407+
- cpp.example_code.aurora.client_configuration
408+
- cpp.example_code.aurora.client
409+
- cpp.example_code.aurora.CreateDBCluster
332410
services:
333411
aurora: {CreateDBCluster}
334412
aurora_DeleteDBCluster:
@@ -374,6 +452,17 @@ aurora_DeleteDBCluster:
374452
snippet_tags:
375453
- python.example_code.aurora.helper.AuroraWrapper_decl
376454
- python.example_code.aurora.DeleteDBCluster
455+
C++:
456+
versions:
457+
- sdk_version: 1
458+
github: cpp/example_code/aurora
459+
sdkguide:
460+
excerpts:
461+
- description:
462+
snippet_tags:
463+
- cpp.example_code.aurora.client_configuration
464+
- cpp.example_code.aurora.client
465+
- cpp.example_code.aurora.DeleteDBCluster
377466
services:
378467
aurora: {DeleteDBCluster}
379468
aurora_CreateDBClusterSnapshot:
@@ -419,6 +508,17 @@ aurora_CreateDBClusterSnapshot:
419508
snippet_tags:
420509
- python.example_code.aurora.helper.AuroraWrapper_decl
421510
- python.example_code.aurora.CreateDBClusterSnapshot
511+
C++:
512+
versions:
513+
- sdk_version: 1
514+
github: cpp/example_code/aurora
515+
sdkguide:
516+
excerpts:
517+
- description:
518+
snippet_tags:
519+
- cpp.example_code.aurora.client_configuration
520+
- cpp.example_code.aurora.client
521+
- cpp.example_code.aurora.CreateDBClusterSnapshot
422522
services:
423523
aurora: {CreateDBClusterSnapshot}
424524
aurora_DescribeDBClusterSnapshots:
@@ -464,6 +564,17 @@ aurora_DescribeDBClusterSnapshots:
464564
snippet_tags:
465565
- python.example_code.aurora.helper.AuroraWrapper_decl
466566
- python.example_code.aurora.DescribeDBClusterSnapshots
567+
C++:
568+
versions:
569+
- sdk_version: 1
570+
github: cpp/example_code/aurora
571+
sdkguide:
572+
excerpts:
573+
- description:
574+
snippet_tags:
575+
- cpp.example_code.aurora.client_configuration
576+
- cpp.example_code.aurora.client
577+
- cpp.example_code.aurora.DescribeDBClusterSnapshots
467578
services:
468579
aurora: {DescribeDBClusterSnapshots}
469580
aurora_CreateDBInstance:
@@ -509,6 +620,17 @@ aurora_CreateDBInstance:
509620
snippet_tags:
510621
- python.example_code.aurora.helper.AuroraWrapper_decl
511622
- python.example_code.aurora.CreateDBInstance_InCluster
623+
C++:
624+
versions:
625+
- sdk_version: 1
626+
github: cpp/example_code/aurora
627+
sdkguide:
628+
excerpts:
629+
- description:
630+
snippet_tags:
631+
- cpp.example_code.aurora.client_configuration
632+
- cpp.example_code.aurora.client
633+
- cpp.example_code.aurora.CreateDBInstance
512634
services:
513635
aurora: {CreateDBInstance}
514636
aurora_DescribeDBEngineVersions:
@@ -554,6 +676,17 @@ aurora_DescribeDBEngineVersions:
554676
snippet_tags:
555677
- python.example_code.aurora.helper.AuroraWrapper_decl
556678
- python.example_code.aurora.DescribeDBEngineVersions
679+
C++:
680+
versions:
681+
- sdk_version: 1
682+
github: cpp/example_code/aurora
683+
sdkguide:
684+
excerpts:
685+
- description:
686+
snippet_tags:
687+
- cpp.example_code.aurora.client_configuration
688+
- cpp.example_code.aurora.client
689+
- cpp.example_code.aurora.DescribeDBEngineVersions
557690
services:
558691
aurora: {DescribeDBEngineVersions}
559692
aurora_DescribeOrderableDBInstanceOptions:
@@ -590,6 +723,17 @@ aurora_DescribeOrderableDBInstanceOptions:
590723
snippet_tags:
591724
- python.example_code.aurora.helper.AuroraWrapper_decl
592725
- python.example_code.aurora.DescribeOrderableDBInstanceOptions
726+
C++:
727+
versions:
728+
- sdk_version: 1
729+
github: cpp/example_code/aurora
730+
sdkguide:
731+
excerpts:
732+
- description:
733+
snippet_tags:
734+
- cpp.example_code.aurora.client_configuration
735+
- cpp.example_code.aurora.client
736+
- cpp.example_code.aurora.DescribeOrderableDBInstanceOptions
593737
services:
594738
aurora: {DescribeOrderableDBInstanceOptions}
595739
aurora_DescribeDBInstances:
@@ -635,6 +779,17 @@ aurora_DescribeDBInstances:
635779
snippet_tags:
636780
- python.example_code.aurora.helper.AuroraWrapper_decl
637781
- python.example_code.aurora.DescribeDBInstances
782+
C++:
783+
versions:
784+
- sdk_version: 1
785+
github: cpp/example_code/aurora
786+
sdkguide:
787+
excerpts:
788+
- description:
789+
snippet_tags:
790+
- cpp.example_code.aurora.client_configuration
791+
- cpp.example_code.aurora.client
792+
- cpp.example_code.aurora.DescribeDBInstances
638793
services:
639794
aurora: {DescribeDBInstances}
640795
aurora_DeleteDBInstance:
@@ -680,6 +835,17 @@ aurora_DeleteDBInstance:
680835
snippet_tags:
681836
- python.example_code.aurora.helper.AuroraWrapper_decl
682837
- python.example_code.aurora.DeleteDBInstance
838+
C++:
839+
versions:
840+
- sdk_version: 1
841+
github: cpp/example_code/aurora
842+
sdkguide:
843+
excerpts:
844+
- description:
845+
snippet_tags:
846+
- cpp.example_code.aurora.client_configuration
847+
- cpp.example_code.aurora.client
848+
- cpp.example_code.aurora.DeleteDBInstance
683849
services:
684850
aurora: {DeleteDBInstance}
685851
aurora_Scenario_GetStartedClusters:
@@ -737,6 +903,16 @@ aurora_Scenario_GetStartedClusters:
737903
manage &AUR; actions.
738904
snippet_tags:
739905
- python.example_code.aurora.helper.AuroraWrapper_full
906+
C++:
907+
versions:
908+
- sdk_version: 1
909+
github: cpp/example_code/aurora
910+
sdkguide:
911+
excerpts:
912+
- description:
913+
snippet_tags:
914+
- cpp.example_code.aurora.client_configuration
915+
- cpp.example_code.aurora.get_started_clusters
740916
services:
741917
aurora: {CreateDBCluster, CreateDBClusterParameterGroup, CreateDBClusterSnapshot,
742918
CreateDBInstance, DeleteDBCluster, DeleteDBClusterParameterGroup, DeleteDBInstance,

.github/pre_validate/pre_validate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
'DeleteCollectionExample/DeleteCollection',
154154
'com/awssupport/latest/APIReference/index',
155155
'DescribeDbClusterParameterGroupsResponse',
156-
'DeleteCollectionExample/DeleteCollection'
156+
'DeleteCollectionExample/DeleteCollection',
157+
'aws/rds/model/DescribeDBInstancesRequest'
157158
}
158159

159160
def check_files(root, quiet):
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Set the minimum required version of CMake for this project.
5+
cmake_minimum_required(VERSION 3.11)
6+
7+
set(SERVICE_NAME aurora)
8+
set(SERVICE_COMPONENTS rds)
9+
10+
# Set this project's name.
11+
project("${SERVICE_NAME}-examples")
12+
13+
# Set the location of where Windows can find the installed libraries of the SDK.
14+
if(MSVC)
15+
string(REPLACE ";" "/aws-cpp-sdk-all;" SYSTEM_MODULE_PATH "${CMAKE_SYSTEM_PREFIX_PATH}/aws-cpp-sdk-all")
16+
list(APPEND CMAKE_PREFIX_PATH ${SYSTEM_MODULE_PATH})
17+
endif()
18+
19+
# Set the C++ standard to use to build this target.
20+
set(CMAKE_CXX_STANDARD 11)
21+
22+
# Enable CTest for testing these code examples.
23+
if(BUILD_TESTS)
24+
include(CTest)
25+
endif()
26+
27+
# Build shared libraries by default.
28+
if(NOT DEFINED BUILD_SHARED_LIBS)
29+
set(BUILD_SHARED_LIBS ON)
30+
endif()
31+
32+
# Find the AWS SDK for C++ package.
33+
find_package(AWSSDK REQUIRED COMPONENTS ${SERVICE_COMPONENTS})
34+
35+
# If the compiler is some version of Microsoft Visual C++, or another compiler simulating C++,
36+
# and building as shared libraries, then dynamically link to those shared libraries.
37+
if(MSVC AND BUILD_SHARED_LIBS)
38+
add_definitions(-DUSE_IMPORT_EXPORT)
39+
# Copy relevant AWS SDK for C++ libraries into the current binary directory for running and debugging.
40+
41+
set(CMAKE_BUILD_TYPE Debug) # Explicitly setting CMAKE_BUILD_TYPE is necessary in Windows to copy DLLs.
42+
43+
list(APPEND SERVICE_LIST ${SERVICE_COMPONENTS})
44+
45+
AWSSDK_CPY_DYN_LIBS(SERVICE_LIST "" ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
46+
endif()
47+
48+
# AWSDOC_SOURCE can be defined in the command line to limit the files in a build. For example,
49+
# you can limit files to one action.
50+
if(NOT DEFINED AWSDOC_SOURCE)
51+
file(GLOB AWSDOC_SOURCE
52+
"*.cpp"
53+
)
54+
endif()
55+
56+
# Check whether the target system is Windows, including Win64.
57+
if(WIN32)
58+
# Check whether the compiler is some version of Microsoft Visual C++, or another compiler simulating C++.
59+
if(MSVC)
60+
source_group("Source Files" FILES ${AWSDOC_SOURCE})
61+
endif(MSVC)
62+
endif()
63+
64+
foreach(file ${AWSDOC_SOURCE})
65+
get_filename_component(EXAMPLE ${file} NAME_WE)
66+
67+
# Build the code example executables.
68+
set(EXAMPLE_EXE run_${EXAMPLE})
69+
70+
add_executable(${EXAMPLE_EXE} ${file})
71+
72+
target_link_libraries(${EXAMPLE_EXE} ${AWSSDK_LINK_LIBRARIES}
73+
${AWSSDK_PLATFORM_DEPS})
74+
75+
endforeach()
76+
77+
78+
if(BUILD_TESTS)
79+
add_subdirectory(tests)
80+
endif()
81+

0 commit comments

Comments
 (0)