GetImage unicodeC Example
#include <C_CkRestW.h>
#include <C_CkAuthAwsW.h>
#include <C_CkStringBuilderW.h>
#include <C_CkJsonObjectW.h>
void ChilkatSample(void)
{
HCkRestW rest;
BOOL success;
HCkAuthAwsW authAws;
HCkStringBuilderW sbResponseBody;
int respStatusCode;
HCkJsonObjectW jResp;
const wchar_t *componentArn;
int j;
int count_j;
const wchar_t *name;
int k;
int count_k;
const wchar_t *strVal;
const wchar_t *deviceName;
int DeleteOnTermination;
int ebsEncrypted;
int Iops;
const wchar_t *ebsKmsKeyId;
const wchar_t *SnapshotId;
int Throughput;
int VolumeSize;
const wchar_t *VolumeType;
const wchar_t *noDevice;
const wchar_t *virtualName;
const wchar_t *AmiTagsString;
const wchar_t *amiDistributionConfigurationDescription;
const wchar_t *amiDistributionConfigurationKmsKeyId;
const wchar_t *amiDistributionConfigurationName;
const wchar_t *containerDistributionConfigurationDescription;
const wchar_t *TargetRepositoryRepositoryName;
const wchar_t *TargetRepositoryService;
const wchar_t *region;
const wchar_t *DiskImageFormat;
const wchar_t *RoleName;
const wchar_t *S3Bucket;
const wchar_t *S3Prefix;
const wchar_t *accountId;
int enabled;
const wchar_t *LaunchTemplateId;
const wchar_t *LaunchTemplateName;
const wchar_t *LaunchTemplateVersion;
int maxParallelLaunches;
int TargetResourceCount;
const wchar_t *launchTemplateId;
int setDefaultVersion;
int ebsDeleteOnTermination;
int ebsIops;
const wchar_t *ebsSnapshotId;
int ebsThroughput;
int ebsVolumeSize;
const wchar_t *ebsVolumeType;
const wchar_t *description;
const wchar_t *image;
const wchar_t *stateReason;
const wchar_t *stateStatus;
const wchar_t *Arn;
const wchar_t *BuildType;
const wchar_t *ContainerRecipeArn;
const wchar_t *ContainerType;
const wchar_t *DateCreated;
const wchar_t *Description;
const wchar_t *DockerfileTemplateData;
int Encrypted;
const wchar_t *Image;
const wchar_t *KmsKeyId;
const wchar_t *Name;
const wchar_t *Owner;
const wchar_t *ParentImage;
const wchar_t *Platform;
const wchar_t *v_String;
const wchar_t *RepositoryName;
const wchar_t *Service;
const wchar_t *Version;
const wchar_t *WorkingDirectory;
const wchar_t *imageDateCreated;
const wchar_t *DistributionConfigurationArn;
const wchar_t *DistributionConfigurationDateCreated;
const wchar_t *DateUpdated;
const wchar_t *DistributionConfigurationDescription;
const wchar_t *DistributionConfigurationName;
const wchar_t *TagsString;
int TimeoutMinutes;
int EnhancedImageMetadataEnabled;
int UninstallAfterBuild;
const wchar_t *UserDataOverride;
const wchar_t *ImageRecipeArn;
const wchar_t *ImageRecipeDateCreated;
const wchar_t *ImageRecipeDescription;
const wchar_t *ImageRecipeName;
const wchar_t *ImageRecipeOwner;
const wchar_t *ImageRecipeParentImage;
const wchar_t *ImageRecipePlatform;
const wchar_t *v_Type;
const wchar_t *ImageRecipeVersion;
const wchar_t *ImageRecipeWorkingDirectory;
int ImageTestsEnabled;
int ImageTestsConfigurationTimeoutMinutes;
const wchar_t *InfrastructureConfigurationArn;
const wchar_t *InfrastructureConfigurationDateCreated;
const wchar_t *InfrastructureConfigurationDateUpdated;
const wchar_t *InfrastructureConfigurationDescription;
int HttpPutResponseHopLimit;
const wchar_t *HttpTokens;
const wchar_t *InstanceProfileName;
const wchar_t *KeyPair;
const wchar_t *S3BucketName;
const wchar_t *S3KeyPrefix;
const wchar_t *InfrastructureConfigurationName;
const wchar_t *ResourceTagsString;
const wchar_t *SnsTopicArn;
const wchar_t *SubnetId;
int TerminateInstanceOnFailure;
const wchar_t *imageName;
const wchar_t *OsVersion;
const wchar_t *imagePlatform;
const wchar_t *SourcePipelineArn;
const wchar_t *SourcePipelineName;
const wchar_t *Reason;
const wchar_t *Status;
const wchar_t *imageType;
const wchar_t *imageVersion;
const wchar_t *requestId;
int i;
int count_i;
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
rest = CkRestW_Create();
authAws = CkAuthAwsW_Create();
CkAuthAwsW_putAccessKey(authAws,L"AWS_ACCESS_KEY");
CkAuthAwsW_putSecretKey(authAws,L"AWS_SECRET_KEY");
// Don't forget to change the region to your particular region. (Also make the same change in the call to Connect below.)
CkAuthAwsW_putRegion(authAws,L"us-west-2");
CkAuthAwsW_putServiceName(authAws,L"imagebuilder");
// SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
CkRestW_SetAuthAws(rest,authAws);
// URL: https://imagebuilder.us-west-2.amazonaws.com/
// Use the same region as specified above.
success = CkRestW_Connect(rest,L"imagebuilder.us-west-2.amazonaws.com",443,TRUE,TRUE);
if (success != TRUE) {
wprintf(L"ConnectFailReason: %d\n",CkRestW_getConnectFailReason(rest));
wprintf(L"%s\n",CkRestW_lastErrorText(rest));
CkRestW_Dispose(rest);
CkAuthAwsW_Dispose(authAws);
return;
}
CkRestW_AddHeader(rest,L"Content-Type",L"application/x-amz-json-1.1");
CkRestW_AddHeader(rest,L"X-Amz-Target",L"GetImage");
sbResponseBody = CkStringBuilderW_Create();
success = CkRestW_FullRequestNoBodySb(rest,L"GET",L"/GetImage",sbResponseBody);
if (success != TRUE) {
wprintf(L"%s\n",CkRestW_lastErrorText(rest));
CkRestW_Dispose(rest);
CkAuthAwsW_Dispose(authAws);
CkStringBuilderW_Dispose(sbResponseBody);
return;
}
respStatusCode = CkRestW_getResponseStatusCode(rest);
wprintf(L"response status code = %d\n",respStatusCode);
if (respStatusCode != 200) {
wprintf(L"Response Header:\n");
wprintf(L"%s\n",CkRestW_responseHeader(rest));
wprintf(L"Response Body:\n");
wprintf(L"%s\n",CkStringBuilderW_getAsString(sbResponseBody));
CkRestW_Dispose(rest);
CkAuthAwsW_Dispose(authAws);
CkStringBuilderW_Dispose(sbResponseBody);
return;
}
jResp = CkJsonObjectW_Create();
CkJsonObjectW_LoadSb(jResp,sbResponseBody);
// The following code parses the JSON response.
// A sample JSON response is shown below the sample code.
// Use this online tool to generate parsing code from sample JSON:
// Generate Parsing Code from JSON
// Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.
// See this example explaining how this memory should be used: const char * functions.
Arn = CkJsonObjectW_stringOf(jResp,L"image.arn");
BuildType = CkJsonObjectW_stringOf(jResp,L"image.buildType");
ContainerRecipeArn = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.arn");
ContainerType = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.containerType");
DateCreated = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.dateCreated");
Description = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.description");
DockerfileTemplateData = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.dockerfileTemplateData");
Encrypted = CkJsonObjectW_IntOf(jResp,L"image.containerRecipe.encrypted");
Image = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.instanceConfiguration.image");
KmsKeyId = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.kmsKeyId");
Name = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.name");
Owner = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.owner");
ParentImage = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.parentImage");
Platform = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.platform");
v_String = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.tags.string");
RepositoryName = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.targetRepository.repositoryName");
Service = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.targetRepository.service");
Version = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.version");
WorkingDirectory = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.workingDirectory");
imageDateCreated = CkJsonObjectW_stringOf(jResp,L"image.dateCreated");
DistributionConfigurationArn = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.arn");
DistributionConfigurationDateCreated = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.dateCreated");
DateUpdated = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.dateUpdated");
DistributionConfigurationDescription = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.description");
DistributionConfigurationName = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.name");
TagsString = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.tags.string");
TimeoutMinutes = CkJsonObjectW_IntOf(jResp,L"image.distributionConfiguration.timeoutMinutes");
EnhancedImageMetadataEnabled = CkJsonObjectW_IntOf(jResp,L"image.enhancedImageMetadataEnabled");
UninstallAfterBuild = CkJsonObjectW_IntOf(jResp,L"image.imageRecipe.additionalInstanceConfiguration.systemsManagerAgent.uninstallAfterBuild");
UserDataOverride = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.additionalInstanceConfiguration.userDataOverride");
ImageRecipeArn = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.arn");
ImageRecipeDateCreated = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.dateCreated");
ImageRecipeDescription = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.description");
ImageRecipeName = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.name");
ImageRecipeOwner = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.owner");
ImageRecipeParentImage = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.parentImage");
ImageRecipePlatform = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.platform");
TagsString = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.tags.string");
v_Type = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.type");
ImageRecipeVersion = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.version");
ImageRecipeWorkingDirectory = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.workingDirectory");
ImageTestsEnabled = CkJsonObjectW_IntOf(jResp,L"image.imageTestsConfiguration.imageTestsEnabled");
ImageTestsConfigurationTimeoutMinutes = CkJsonObjectW_IntOf(jResp,L"image.imageTestsConfiguration.timeoutMinutes");
InfrastructureConfigurationArn = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.arn");
InfrastructureConfigurationDateCreated = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.dateCreated");
InfrastructureConfigurationDateUpdated = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.dateUpdated");
InfrastructureConfigurationDescription = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.description");
HttpPutResponseHopLimit = CkJsonObjectW_IntOf(jResp,L"image.infrastructureConfiguration.instanceMetadataOptions.httpPutResponseHopLimit");
HttpTokens = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.instanceMetadataOptions.httpTokens");
InstanceProfileName = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.instanceProfileName");
KeyPair = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.keyPair");
S3BucketName = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.logging.s3Logs.s3BucketName");
S3KeyPrefix = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.logging.s3Logs.s3KeyPrefix");
InfrastructureConfigurationName = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.name");
ResourceTagsString = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.resourceTags.string");
SnsTopicArn = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.snsTopicArn");
SubnetId = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.subnetId");
TagsString = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.tags.string");
TerminateInstanceOnFailure = CkJsonObjectW_IntOf(jResp,L"image.infrastructureConfiguration.terminateInstanceOnFailure");
imageName = CkJsonObjectW_stringOf(jResp,L"image.name");
OsVersion = CkJsonObjectW_stringOf(jResp,L"image.osVersion");
imagePlatform = CkJsonObjectW_stringOf(jResp,L"image.platform");
SourcePipelineArn = CkJsonObjectW_stringOf(jResp,L"image.sourcePipelineArn");
SourcePipelineName = CkJsonObjectW_stringOf(jResp,L"image.sourcePipelineName");
Reason = CkJsonObjectW_stringOf(jResp,L"image.state.reason");
Status = CkJsonObjectW_stringOf(jResp,L"image.state.status");
TagsString = CkJsonObjectW_stringOf(jResp,L"image.tags.string");
imageType = CkJsonObjectW_stringOf(jResp,L"image.type");
imageVersion = CkJsonObjectW_stringOf(jResp,L"image.version");
requestId = CkJsonObjectW_stringOf(jResp,L"requestId");
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"image.containerRecipe.components");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
componentArn = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.components[i].componentArn");
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.containerRecipe.components[i].parameters");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
name = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.components[i].parameters[j].name");
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"image.containerRecipe.components[i].parameters[j].value");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
strVal = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.components[i].parameters[j].value[k]");
k = k + 1;
}
j = j + 1;
}
i = i + 1;
}
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
deviceName = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].deviceName");
DeleteOnTermination = CkJsonObjectW_IntOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.deleteOnTermination");
ebsEncrypted = CkJsonObjectW_IntOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.encrypted");
Iops = CkJsonObjectW_IntOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.iops");
ebsKmsKeyId = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.kmsKeyId");
SnapshotId = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.snapshotId");
Throughput = CkJsonObjectW_IntOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.throughput");
VolumeSize = CkJsonObjectW_IntOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.volumeSize");
VolumeType = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.volumeType");
noDevice = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].noDevice");
virtualName = CkJsonObjectW_stringOf(jResp,L"image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].virtualName");
i = i + 1;
}
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
AmiTagsString = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.amiTags.string");
amiDistributionConfigurationDescription = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.description");
amiDistributionConfigurationKmsKeyId = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.kmsKeyId");
amiDistributionConfigurationName = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.name");
containerDistributionConfigurationDescription = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].containerDistributionConfiguration.description");
TargetRepositoryRepositoryName = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].containerDistributionConfiguration.targetRepository.repositoryName");
TargetRepositoryService = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].containerDistributionConfiguration.targetRepository.service");
region = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].region");
DiskImageFormat = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].s3ExportConfiguration.diskImageFormat");
RoleName = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].s3ExportConfiguration.roleName");
S3Bucket = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].s3ExportConfiguration.s3Bucket");
S3Prefix = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].s3ExportConfiguration.s3Prefix");
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationalUnitArns");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationalUnitArns[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationArns");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationArns[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userGroups");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userGroups[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userIds");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userIds[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.targetAccountIds");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].amiDistributionConfiguration.targetAccountIds[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions[i].containerDistributionConfiguration.containerTags");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].containerDistributionConfiguration.containerTags[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions[i].fastLaunchConfigurations");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
accountId = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].accountId");
enabled = CkJsonObjectW_IntOf(jResp,L"image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].enabled");
LaunchTemplateId = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateId");
LaunchTemplateName = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateName");
LaunchTemplateVersion = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateVersion");
maxParallelLaunches = CkJsonObjectW_IntOf(jResp,L"image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].maxParallelLaunches");
TargetResourceCount = CkJsonObjectW_IntOf(jResp,L"image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].snapshotConfiguration.targetResourceCount");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions[i].launchTemplateConfigurations");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
accountId = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].accountId");
launchTemplateId = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].launchTemplateId");
setDefaultVersion = CkJsonObjectW_IntOf(jResp,L"image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].setDefaultVersion");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.distributionConfiguration.distributions[i].licenseConfigurationArns");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"image.distributionConfiguration.distributions[i].licenseConfigurationArns[j]");
j = j + 1;
}
i = i + 1;
}
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"image.imageRecipe.blockDeviceMappings");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
deviceName = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].deviceName");
ebsDeleteOnTermination = CkJsonObjectW_IntOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].ebs.deleteOnTermination");
ebsEncrypted = CkJsonObjectW_IntOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].ebs.encrypted");
ebsIops = CkJsonObjectW_IntOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].ebs.iops");
ebsKmsKeyId = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].ebs.kmsKeyId");
ebsSnapshotId = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].ebs.snapshotId");
ebsThroughput = CkJsonObjectW_IntOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].ebs.throughput");
ebsVolumeSize = CkJsonObjectW_IntOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].ebs.volumeSize");
ebsVolumeType = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].ebs.volumeType");
noDevice = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].noDevice");
virtualName = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.blockDeviceMappings[i].virtualName");
i = i + 1;
}
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"image.imageRecipe.components");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
componentArn = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.components[i].componentArn");
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.imageRecipe.components[i].parameters");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
name = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.components[i].parameters[j].name");
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"image.imageRecipe.components[i].parameters[j].value");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
strVal = CkJsonObjectW_stringOf(jResp,L"image.imageRecipe.components[i].parameters[j].value[k]");
k = k + 1;
}
j = j + 1;
}
i = i + 1;
}
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"image.infrastructureConfiguration.instanceTypes");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
strVal = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.instanceTypes[i]");
i = i + 1;
}
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"image.infrastructureConfiguration.securityGroupIds");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
strVal = CkJsonObjectW_stringOf(jResp,L"image.infrastructureConfiguration.securityGroupIds[i]");
i = i + 1;
}
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"image.outputResources.amis");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
accountId = CkJsonObjectW_stringOf(jResp,L"image.outputResources.amis[i].accountId");
description = CkJsonObjectW_stringOf(jResp,L"image.outputResources.amis[i].description");
image = CkJsonObjectW_stringOf(jResp,L"image.outputResources.amis[i].image");
name = CkJsonObjectW_stringOf(jResp,L"image.outputResources.amis[i].name");
region = CkJsonObjectW_stringOf(jResp,L"image.outputResources.amis[i].region");
stateReason = CkJsonObjectW_stringOf(jResp,L"image.outputResources.amis[i].state.reason");
stateStatus = CkJsonObjectW_stringOf(jResp,L"image.outputResources.amis[i].state.status");
i = i + 1;
}
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"image.outputResources.containers");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
region = CkJsonObjectW_stringOf(jResp,L"image.outputResources.containers[i].region");
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"image.outputResources.containers[i].imageUris");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"image.outputResources.containers[i].imageUris[j]");
j = j + 1;
}
i = i + 1;
}
// A sample JSON response body parsed by the above code:
// {
// "image": {
// "arn": "string",
// "buildType": "string",
// "containerRecipe": {
// "arn": "string",
// "components": [
// {
// "componentArn": "string",
// "parameters": [
// {
// "name": "string",
// "value": [
// "string"
// ]
// }
// ]
// }
// ],
// "containerType": "string",
// "dateCreated": "string",
// "description": "string",
// "dockerfileTemplateData": "string",
// "encrypted": boolean,
// "instanceConfiguration": {
// "blockDeviceMappings": [
// {
// "deviceName": "string",
// "ebs": {
// "deleteOnTermination": boolean,
// "encrypted": boolean,
// "iops": number,
// "kmsKeyId": "string",
// "snapshotId": "string",
// "throughput": number,
// "volumeSize": number,
// "volumeType": "string"
// },
// "noDevice": "string",
// "virtualName": "string"
// }
// ],
// "image": "string"
// },
// "kmsKeyId": "string",
// "name": "string",
// "owner": "string",
// "parentImage": "string",
// "platform": "string",
// "tags": {
// "string": "string"
// },
// "targetRepository": {
// "repositoryName": "string",
// "service": "string"
// },
// "version": "string",
// "workingDirectory": "string"
// },
// "dateCreated": "string",
// "distributionConfiguration": {
// "arn": "string",
// "dateCreated": "string",
// "dateUpdated": "string",
// "description": "string",
// "distributions": [
// {
// "amiDistributionConfiguration": {
// "amiTags": {
// "string": "string"
// },
// "description": "string",
// "kmsKeyId": "string",
// "launchPermission": {
// "organizationalUnitArns": [
// "string"
// ],
// "organizationArns": [
// "string"
// ],
// "userGroups": [
// "string"
// ],
// "userIds": [
// "string"
// ]
// },
// "name": "string",
// "targetAccountIds": [
// "string"
// ]
// },
// "containerDistributionConfiguration": {
// "containerTags": [
// "string"
// ],
// "description": "string",
// "targetRepository": {
// "repositoryName": "string",
// "service": "string"
// }
// },
// "fastLaunchConfigurations": [
// {
// "accountId": "string",
// "enabled": boolean,
// "launchTemplate": {
// "launchTemplateId": "string",
// "launchTemplateName": "string",
// "launchTemplateVersion": "string"
// },
// "maxParallelLaunches": number,
// "snapshotConfiguration": {
// "targetResourceCount": number
// }
// }
// ],
// "launchTemplateConfigurations": [
// {
// "accountId": "string",
// "launchTemplateId": "string",
// "setDefaultVersion": boolean
// }
// ],
// "licenseConfigurationArns": [
// "string"
// ],
// "region": "string",
// "s3ExportConfiguration": {
// "diskImageFormat": "string",
// "roleName": "string",
// "s3Bucket": "string",
// "s3Prefix": "string"
// }
// }
// ],
// "name": "string",
// "tags": {
// "string": "string"
// },
// "timeoutMinutes": number
// },
// "enhancedImageMetadataEnabled": boolean,
// "imageRecipe": {
// "additionalInstanceConfiguration": {
// "systemsManagerAgent": {
// "uninstallAfterBuild": boolean
// },
// "userDataOverride": "string"
// },
// "arn": "string",
// "blockDeviceMappings": [
// {
// "deviceName": "string",
// "ebs": {
// "deleteOnTermination": boolean,
// "encrypted": boolean,
// "iops": number,
// "kmsKeyId": "string",
// "snapshotId": "string",
// "throughput": number,
// "volumeSize": number,
// "volumeType": "string"
// },
// "noDevice": "string",
// "virtualName": "string"
// }
// ],
// "components": [
// {
// "componentArn": "string",
// "parameters": [
// {
// "name": "string",
// "value": [
// "string"
// ]
// }
// ]
// }
// ],
// "dateCreated": "string",
// "description": "string",
// "name": "string",
// "owner": "string",
// "parentImage": "string",
// "platform": "string",
// "tags": {
// "string": "string"
// },
// "type": "string",
// "version": "string",
// "workingDirectory": "string"
// },
// "imageTestsConfiguration": {
// "imageTestsEnabled": boolean,
// "timeoutMinutes": number
// },
// "infrastructureConfiguration": {
// "arn": "string",
// "dateCreated": "string",
// "dateUpdated": "string",
// "description": "string",
// "instanceMetadataOptions": {
// "httpPutResponseHopLimit": number,
// "httpTokens": "string"
// },
// "instanceProfileName": "string",
// "instanceTypes": [
// "string"
// ],
// "keyPair": "string",
// "logging": {
// "s3Logs": {
// "s3BucketName": "string",
// "s3KeyPrefix": "string"
// }
// },
// "name": "string",
// "resourceTags": {
// "string": "string"
// },
// "securityGroupIds": [
// "string"
// ],
// "snsTopicArn": "string",
// "subnetId": "string",
// "tags": {
// "string": "string"
// },
// "terminateInstanceOnFailure": boolean
// },
// "name": "string",
// "osVersion": "string",
// "outputResources": {
// "amis": [
// {
// "accountId": "string",
// "description": "string",
// "image": "string",
// "name": "string",
// "region": "string",
// "state": {
// "reason": "string",
// "status": "string"
// }
// }
// ],
// "containers": [
// {
// "imageUris": [
// "string"
// ],
// "region": "string"
// }
// ]
// },
// "platform": "string",
// "sourcePipelineArn": "string",
// "sourcePipelineName": "string",
// "state": {
// "reason": "string",
// "status": "string"
// },
// "tags": {
// "string": "string"
// },
// "type": "string",
// "version": "string"
// },
// "requestId": "string"
// }
CkRestW_Dispose(rest);
CkAuthAwsW_Dispose(authAws);
CkStringBuilderW_Dispose(sbResponseBody);
CkJsonObjectW_Dispose(jResp);
}