Skip to content

Commit e29e42a

Browse files
authored
Service Client Codegen (#641)
* identity codegen * job service client * shadow codegen * secure tunneling codegen * update identity cmake * job cmake * update shadow code gen * Revert "secure tunneling codegen" This reverts commit 1779634. * update crt to 0.24.0 * update crt * update aws-crt-cpp * update aws-crt-cpp * update cmake codegen * update crt * update cmake code-gen * Mqtt5 Service Client samples (#642) * shadow sample * update jobs sample * identity sample * Revert "secure tunneling codegen" This reverts commit 1779634. * setup mqtt5 service client samples cmake * setup builder step to build samples * test doc gen * update test doc gen * update doxygen comment * test with latest doxygen update * update crt to latest cmake fix
1 parent 3076cca commit e29e42a

File tree

27 files changed

+1947
-6
lines changed

27 files changed

+1947
-6
lines changed

.builder/actions/build_samples.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def run(self, env):
1616
'samples/greengrass/basic_discovery',
1717
'samples/greengrass/ipc',
1818
'samples/fleet_provisioning/fleet_provisioning',
19+
'samples/fleet_provisioning/mqtt5_fleet_provisioning',
1920
'samples/jobs/describe_job_execution',
21+
'samples/jobs/mqtt5_describe_job_execution',
2022
'samples/mqtt/basic_connect',
2123
'samples/mqtt/custom_authorizer_connect',
2224
'samples/mqtt/pkcs11_connect',
@@ -33,6 +35,7 @@ def run(self, env):
3335
'samples/secure_tunneling/secure_tunnel',
3436
'samples/secure_tunneling/tunnel_notification',
3537
'samples/shadow/shadow_sync',
38+
'samples/shadow/mqtt5_shadow_sync',
3639
]
3740

3841
defender_samples = []

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ jobs:
509509
- name: run Shadow sample
510510
run: |
511511
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_shadow_cfg.json
512+
- name: run Mqtt5 Shadow sample
513+
run: |
514+
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_shadow_mqtt5_cfg.json
512515
- name: configure AWS credentials (Jobs)
513516
uses: aws-actions/configure-aws-credentials@v1
514517
with:
@@ -517,6 +520,9 @@ jobs:
517520
- name: run Jobs sample
518521
run: |
519522
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_jobs_cfg.json
523+
- name: run Mqtt5 Jobs sample
524+
run: |
525+
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_jobs_mqtt5_cfg.json
520526
- name: configure AWS credentials (Fleet provisioning)
521527
uses: aws-actions/configure-aws-credentials@v1
522528
with:
@@ -528,6 +534,12 @@ jobs:
528534
Sample_UUID=$(python3 -c "import uuid; print (uuid.uuid4())")
529535
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_fleet_provisioning_cfg.json --input_uuid ${Sample_UUID}
530536
python3 ${{ env.CI_UTILS_FOLDER }}/delete_iot_thing_ci.py --thing_name "Fleet_Thing_${Sample_UUID}" --region "us-east-1"
537+
- name: run Mqtt5 Fleet Provisioning sample
538+
run: |
539+
echo "Generating UUID for IoT thing"
540+
Sample_UUID=$(python3 -c "import uuid; print (uuid.uuid4())")
541+
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_fleet_provisioning_mqtt5_cfg.json --input_uuid ${Sample_UUID}
542+
python3 ${{ env.CI_UTILS_FOLDER }}/delete_iot_thing_ci.py --thing_name "Fleet_Thing_${Sample_UUID}" --region "us-east-1"
531543
- name: configure AWS credentials (Secure tunneling)
532544
uses: aws-actions/configure-aws-credentials@v1
533545
with:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"language": "CPP",
3+
"sample_file": "./aws-iot-device-sdk-cpp-v2/build/samples/fleet_provisioning/mqtt5_fleet_provisioning/mqtt5-fleet-provisioning",
4+
"sample_region": "us-east-1",
5+
"sample_main_class": "",
6+
"arguments": [
7+
{
8+
"name": "--endpoint",
9+
"secret": "ci/endpoint"
10+
},
11+
{
12+
"name": "--cert",
13+
"secret": "ci/FleetProvisioning/cert",
14+
"filename": "tmp_certificate.pem"
15+
},
16+
{
17+
"name": "--key",
18+
"secret": "ci/FleetProvisioning/key",
19+
"filename": "tmp_key.pem"
20+
},
21+
{
22+
"name": "--template_name",
23+
"data": "CI_FleetProvisioning_Template"
24+
},
25+
{
26+
"name": "--template_parameters",
27+
"data": "{\"SerialNumber\":\"$INPUT_UUID\"}"
28+
}
29+
]
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"language": "CPP",
3+
"sample_file": "./aws-iot-device-sdk-cpp-v2/build/samples/jobs/mqtt5_describe_job_execution/mqtt5-describe-job-execution",
4+
"sample_region": "us-east-1",
5+
"sample_main_class": "",
6+
"arguments": [
7+
{
8+
"name": "--endpoint",
9+
"secret": "ci/endpoint"
10+
},
11+
{
12+
"name": "--cert",
13+
"secret": "ci/Jobs/cert",
14+
"filename": "tmp_certificate.pem"
15+
},
16+
{
17+
"name": "--key",
18+
"secret": "ci/Jobs/key",
19+
"filename": "tmp_key.pem"
20+
},
21+
{
22+
"name": "--thing_name",
23+
"data": "CI_Jobs_Thing"
24+
},
25+
{
26+
"name": "--job_id",
27+
"data": "CI_Jobs_Thing_Job_1"
28+
}
29+
]
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"language": "CPP",
3+
"sample_file": "./aws-iot-device-sdk-cpp-v2/build/samples/shadow/mqtt5_shadow_sync/mqtt5-shadow-sync",
4+
"sample_region": "us-east-1",
5+
"sample_main_class": "",
6+
"arguments": [
7+
{
8+
"name": "--endpoint",
9+
"secret": "ci/endpoint"
10+
},
11+
{
12+
"name": "--cert",
13+
"secret": "ci/Shadow/cert",
14+
"filename": "tmp_certificate.pem"
15+
},
16+
{
17+
"name": "--key",
18+
"secret": "ci/Shadow/key",
19+
"filename": "tmp_key.pem"
20+
},
21+
{
22+
"name": "--thing_name",
23+
"data": "CI_Shadow_Thing"
24+
},
25+
{
26+
"name": "--is_ci",
27+
"data": "true"
28+
}
29+
]
30+
}

identity/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# This file is generated
2+
13
cmake_minimum_required(VERSION 3.1)
24

35
project(IotIdentity-cpp LANGUAGES CXX)
46
if (DEFINED SIMPLE_VERSION)
5-
message("Identity version is ${SIMPLE_VERSION}")
7+
message("IotIdentity version is ${SIMPLE_VERSION}")
68
set(PROJECT_VERSION ${SIMPLE_VERSION})
79
endif()
810

identity/cmake/iotidentity-cpp-config.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file is generated
2+
13
include(CMakeFindDependencyMacro)
24

35
find_dependency(aws-crt-cpp)

identity/include/aws/iotidentity/IotIdentityClient.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <aws/crt/StlAllocator.h>
1212
#include <aws/crt/Types.h>
1313

14+
#include <aws/crt/mqtt/Mqtt5Client.h>
1415
#include <aws/crt/mqtt/MqttClient.h>
1516

1617
namespace Aws
@@ -60,6 +61,7 @@ namespace Aws
6061
{
6162
public:
6263
IotIdentityClient(const std::shared_ptr<Aws::Crt::Mqtt::MqttConnection> &connection);
64+
IotIdentityClient(const std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> &mqtt5Client);
6365

6466
operator bool() const noexcept;
6567
int GetLastError() const noexcept;

identity/source/IotIdentityClient.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ namespace Aws
2626
{
2727
}
2828

29+
IotIdentityClient::IotIdentityClient(const std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> &mqtt5Client)
30+
{
31+
m_connection = Aws::Crt::Mqtt::MqttConnection::NewConnectionFromMqtt5Client(mqtt5Client);
32+
}
33+
2934
IotIdentityClient::operator bool() const noexcept { return m_connection && *m_connection; }
3035

3136
int IotIdentityClient::GetLastError() const noexcept { return aws_last_error(); }

0 commit comments

Comments
 (0)