Chilkat Online Tools

GetImage delphiDll Example

EC2 Image Builder

var
rest: HCkRest;
success: Boolean;
authAws: HCkAuthAws;
sbResponseBody: HCkStringBuilder;
respStatusCode: Integer;
jResp: HCkJsonObject;
componentArn: PWideChar;
j: Integer;
count_j: Integer;
name: PWideChar;
k: Integer;
count_k: Integer;
strVal: PWideChar;
deviceName: PWideChar;
DeleteOnTermination: Integer;
ebsEncrypted: Integer;
Iops: Integer;
ebsKmsKeyId: PWideChar;
SnapshotId: PWideChar;
Throughput: Integer;
VolumeSize: Integer;
VolumeType: PWideChar;
noDevice: PWideChar;
virtualName: PWideChar;
AmiTagsString: PWideChar;
amiDistributionConfigurationDescription: PWideChar;
amiDistributionConfigurationKmsKeyId: PWideChar;
amiDistributionConfigurationName: PWideChar;
containerDistributionConfigurationDescription: PWideChar;
TargetRepositoryRepositoryName: PWideChar;
TargetRepositoryService: PWideChar;
region: PWideChar;
DiskImageFormat: PWideChar;
RoleName: PWideChar;
S3Bucket: PWideChar;
S3Prefix: PWideChar;
accountId: PWideChar;
enabled: Integer;
LaunchTemplateId: PWideChar;
LaunchTemplateName: PWideChar;
LaunchTemplateVersion: PWideChar;
maxParallelLaunches: Integer;
TargetResourceCount: Integer;
launchTemplateId: PWideChar;
setDefaultVersion: Integer;
ebsDeleteOnTermination: Integer;
ebsIops: Integer;
ebsSnapshotId: PWideChar;
ebsThroughput: Integer;
ebsVolumeSize: Integer;
ebsVolumeType: PWideChar;
description: PWideChar;
image: PWideChar;
stateReason: PWideChar;
stateStatus: PWideChar;
Arn: PWideChar;
BuildType: PWideChar;
ContainerRecipeArn: PWideChar;
ContainerType: PWideChar;
DateCreated: PWideChar;
Description: PWideChar;
DockerfileTemplateData: PWideChar;
Encrypted: Integer;
Image: PWideChar;
KmsKeyId: PWideChar;
Name: PWideChar;
Owner: PWideChar;
ParentImage: PWideChar;
Platform: PWideChar;
v_String: PWideChar;
RepositoryName: PWideChar;
Service: PWideChar;
Version: PWideChar;
WorkingDirectory: PWideChar;
imageDateCreated: PWideChar;
DistributionConfigurationArn: PWideChar;
DistributionConfigurationDateCreated: PWideChar;
DateUpdated: PWideChar;
DistributionConfigurationDescription: PWideChar;
DistributionConfigurationName: PWideChar;
TagsString: PWideChar;
TimeoutMinutes: Integer;
EnhancedImageMetadataEnabled: Integer;
UninstallAfterBuild: Integer;
UserDataOverride: PWideChar;
ImageRecipeArn: PWideChar;
ImageRecipeDateCreated: PWideChar;
ImageRecipeDescription: PWideChar;
ImageRecipeName: PWideChar;
ImageRecipeOwner: PWideChar;
ImageRecipeParentImage: PWideChar;
ImageRecipePlatform: PWideChar;
v_Type: PWideChar;
ImageRecipeVersion: PWideChar;
ImageRecipeWorkingDirectory: PWideChar;
ImageTestsEnabled: Integer;
ImageTestsConfigurationTimeoutMinutes: Integer;
InfrastructureConfigurationArn: PWideChar;
InfrastructureConfigurationDateCreated: PWideChar;
InfrastructureConfigurationDateUpdated: PWideChar;
InfrastructureConfigurationDescription: PWideChar;
HttpPutResponseHopLimit: Integer;
HttpTokens: PWideChar;
InstanceProfileName: PWideChar;
KeyPair: PWideChar;
S3BucketName: PWideChar;
S3KeyPrefix: PWideChar;
InfrastructureConfigurationName: PWideChar;
ResourceTagsString: PWideChar;
SnsTopicArn: PWideChar;
SubnetId: PWideChar;
TerminateInstanceOnFailure: Integer;
imageName: PWideChar;
OsVersion: PWideChar;
imagePlatform: PWideChar;
SourcePipelineArn: PWideChar;
SourcePipelineName: PWideChar;
Reason: PWideChar;
Status: PWideChar;
imageType: PWideChar;
imageVersion: PWideChar;
requestId: PWideChar;
i: Integer;
count_i: Integer;

begin
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

rest := CkRest_Create();

authAws := CkAuthAws_Create();
CkAuthAws_putAccessKey(authAws,'AWS_ACCESS_KEY');
CkAuthAws_putSecretKey(authAws,'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.)
CkAuthAws_putRegion(authAws,'us-west-2');
CkAuthAws_putServiceName(authAws,'imagebuilder');
// SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
CkRest_SetAuthAws(rest,authAws);

// URL: https://imagebuilder.us-west-2.amazonaws.com/
// Use the same region as specified above.
success := CkRest_Connect(rest,'imagebuilder.us-west-2.amazonaws.com',443,True,True);
if (success <> True) then
  begin
    Memo1.Lines.Add('ConnectFailReason: ' + IntToStr(CkRest_getConnectFailReason(rest)));
    Memo1.Lines.Add(CkRest__lastErrorText(rest));
    Exit;
  end;

CkRest_AddHeader(rest,'Content-Type','application/x-amz-json-1.1');
CkRest_AddHeader(rest,'X-Amz-Target','GetImage');

sbResponseBody := CkStringBuilder_Create();
success := CkRest_FullRequestNoBodySb(rest,'GET','/GetImage',sbResponseBody);
if (success <> True) then
  begin
    Memo1.Lines.Add(CkRest__lastErrorText(rest));
    Exit;
  end;
respStatusCode := CkRest_getResponseStatusCode(rest);
Memo1.Lines.Add('response status code = ' + IntToStr(respStatusCode));
if (respStatusCode <> 200) then
  begin
    Memo1.Lines.Add('Response Header:');
    Memo1.Lines.Add(CkRest__responseHeader(rest));
    Memo1.Lines.Add('Response Body:');
    Memo1.Lines.Add(CkStringBuilder__getAsString(sbResponseBody));
    Exit;
  end;

jResp := CkJsonObject_Create();
CkJsonObject_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

Arn := CkJsonObject__stringOf(jResp,'image.arn');
BuildType := CkJsonObject__stringOf(jResp,'image.buildType');
ContainerRecipeArn := CkJsonObject__stringOf(jResp,'image.containerRecipe.arn');
ContainerType := CkJsonObject__stringOf(jResp,'image.containerRecipe.containerType');
DateCreated := CkJsonObject__stringOf(jResp,'image.containerRecipe.dateCreated');
Description := CkJsonObject__stringOf(jResp,'image.containerRecipe.description');
DockerfileTemplateData := CkJsonObject__stringOf(jResp,'image.containerRecipe.dockerfileTemplateData');
Encrypted := CkJsonObject_IntOf(jResp,'image.containerRecipe.encrypted');
Image := CkJsonObject__stringOf(jResp,'image.containerRecipe.instanceConfiguration.image');
KmsKeyId := CkJsonObject__stringOf(jResp,'image.containerRecipe.kmsKeyId');
Name := CkJsonObject__stringOf(jResp,'image.containerRecipe.name');
Owner := CkJsonObject__stringOf(jResp,'image.containerRecipe.owner');
ParentImage := CkJsonObject__stringOf(jResp,'image.containerRecipe.parentImage');
Platform := CkJsonObject__stringOf(jResp,'image.containerRecipe.platform');
v_String := CkJsonObject__stringOf(jResp,'image.containerRecipe.tags.string');
RepositoryName := CkJsonObject__stringOf(jResp,'image.containerRecipe.targetRepository.repositoryName');
Service := CkJsonObject__stringOf(jResp,'image.containerRecipe.targetRepository.service');
Version := CkJsonObject__stringOf(jResp,'image.containerRecipe.version');
WorkingDirectory := CkJsonObject__stringOf(jResp,'image.containerRecipe.workingDirectory');
imageDateCreated := CkJsonObject__stringOf(jResp,'image.dateCreated');
DistributionConfigurationArn := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.arn');
DistributionConfigurationDateCreated := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.dateCreated');
DateUpdated := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.dateUpdated');
DistributionConfigurationDescription := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.description');
DistributionConfigurationName := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.name');
TagsString := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.tags.string');
TimeoutMinutes := CkJsonObject_IntOf(jResp,'image.distributionConfiguration.timeoutMinutes');
EnhancedImageMetadataEnabled := CkJsonObject_IntOf(jResp,'image.enhancedImageMetadataEnabled');
UninstallAfterBuild := CkJsonObject_IntOf(jResp,'image.imageRecipe.additionalInstanceConfiguration.systemsManagerAgent.uninstallAfterBuild');
UserDataOverride := CkJsonObject__stringOf(jResp,'image.imageRecipe.additionalInstanceConfiguration.userDataOverride');
ImageRecipeArn := CkJsonObject__stringOf(jResp,'image.imageRecipe.arn');
ImageRecipeDateCreated := CkJsonObject__stringOf(jResp,'image.imageRecipe.dateCreated');
ImageRecipeDescription := CkJsonObject__stringOf(jResp,'image.imageRecipe.description');
ImageRecipeName := CkJsonObject__stringOf(jResp,'image.imageRecipe.name');
ImageRecipeOwner := CkJsonObject__stringOf(jResp,'image.imageRecipe.owner');
ImageRecipeParentImage := CkJsonObject__stringOf(jResp,'image.imageRecipe.parentImage');
ImageRecipePlatform := CkJsonObject__stringOf(jResp,'image.imageRecipe.platform');
TagsString := CkJsonObject__stringOf(jResp,'image.imageRecipe.tags.string');
v_Type := CkJsonObject__stringOf(jResp,'image.imageRecipe.type');
ImageRecipeVersion := CkJsonObject__stringOf(jResp,'image.imageRecipe.version');
ImageRecipeWorkingDirectory := CkJsonObject__stringOf(jResp,'image.imageRecipe.workingDirectory');
ImageTestsEnabled := CkJsonObject_IntOf(jResp,'image.imageTestsConfiguration.imageTestsEnabled');
ImageTestsConfigurationTimeoutMinutes := CkJsonObject_IntOf(jResp,'image.imageTestsConfiguration.timeoutMinutes');
InfrastructureConfigurationArn := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.arn');
InfrastructureConfigurationDateCreated := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.dateCreated');
InfrastructureConfigurationDateUpdated := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.dateUpdated');
InfrastructureConfigurationDescription := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.description');
HttpPutResponseHopLimit := CkJsonObject_IntOf(jResp,'image.infrastructureConfiguration.instanceMetadataOptions.httpPutResponseHopLimit');
HttpTokens := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.instanceMetadataOptions.httpTokens');
InstanceProfileName := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.instanceProfileName');
KeyPair := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.keyPair');
S3BucketName := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.logging.s3Logs.s3BucketName');
S3KeyPrefix := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.logging.s3Logs.s3KeyPrefix');
InfrastructureConfigurationName := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.name');
ResourceTagsString := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.resourceTags.string');
SnsTopicArn := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.snsTopicArn');
SubnetId := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.subnetId');
TagsString := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.tags.string');
TerminateInstanceOnFailure := CkJsonObject_IntOf(jResp,'image.infrastructureConfiguration.terminateInstanceOnFailure');
imageName := CkJsonObject__stringOf(jResp,'image.name');
OsVersion := CkJsonObject__stringOf(jResp,'image.osVersion');
imagePlatform := CkJsonObject__stringOf(jResp,'image.platform');
SourcePipelineArn := CkJsonObject__stringOf(jResp,'image.sourcePipelineArn');
SourcePipelineName := CkJsonObject__stringOf(jResp,'image.sourcePipelineName');
Reason := CkJsonObject__stringOf(jResp,'image.state.reason');
Status := CkJsonObject__stringOf(jResp,'image.state.status');
TagsString := CkJsonObject__stringOf(jResp,'image.tags.string');
imageType := CkJsonObject__stringOf(jResp,'image.type');
imageVersion := CkJsonObject__stringOf(jResp,'image.version');
requestId := CkJsonObject__stringOf(jResp,'requestId');
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'image.containerRecipe.components');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    componentArn := CkJsonObject__stringOf(jResp,'image.containerRecipe.components[i].componentArn');
    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.containerRecipe.components[i].parameters');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        name := CkJsonObject__stringOf(jResp,'image.containerRecipe.components[i].parameters[j].name');
        k := 0;
        count_k := CkJsonObject_SizeOfArray(jResp,'image.containerRecipe.components[i].parameters[j].value');
        while k < count_k do
          begin
            CkJsonObject_putK(jResp,k);
            strVal := CkJsonObject__stringOf(jResp,'image.containerRecipe.components[i].parameters[j].value[k]');
            k := k + 1;
          end;

        j := j + 1;
      end;

    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    deviceName := CkJsonObject__stringOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].deviceName');
    DeleteOnTermination := CkJsonObject_IntOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.deleteOnTermination');
    ebsEncrypted := CkJsonObject_IntOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.encrypted');
    Iops := CkJsonObject_IntOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.iops');
    ebsKmsKeyId := CkJsonObject__stringOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.kmsKeyId');
    SnapshotId := CkJsonObject__stringOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.snapshotId');
    Throughput := CkJsonObject_IntOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.throughput');
    VolumeSize := CkJsonObject_IntOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.volumeSize');
    VolumeType := CkJsonObject__stringOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.volumeType');
    noDevice := CkJsonObject__stringOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].noDevice');
    virtualName := CkJsonObject__stringOf(jResp,'image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].virtualName');
    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    AmiTagsString := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.amiTags.string');
    amiDistributionConfigurationDescription := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.description');
    amiDistributionConfigurationKmsKeyId := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.kmsKeyId');
    amiDistributionConfigurationName := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.name');
    containerDistributionConfigurationDescription := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].containerDistributionConfiguration.description');
    TargetRepositoryRepositoryName := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].containerDistributionConfiguration.targetRepository.repositoryName');
    TargetRepositoryService := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].containerDistributionConfiguration.targetRepository.service');
    region := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].region');
    DiskImageFormat := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].s3ExportConfiguration.diskImageFormat');
    RoleName := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].s3ExportConfiguration.roleName');
    S3Bucket := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].s3ExportConfiguration.s3Bucket');
    S3Prefix := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].s3ExportConfiguration.s3Prefix');
    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationalUnitArns');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationalUnitArns[j]');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationArns');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationArns[j]');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userGroups');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userGroups[j]');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userIds');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userIds[j]');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.targetAccountIds');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].amiDistributionConfiguration.targetAccountIds[j]');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions[i].containerDistributionConfiguration.containerTags');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].containerDistributionConfiguration.containerTags[j]');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions[i].fastLaunchConfigurations');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        accountId := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].accountId');
        enabled := CkJsonObject_IntOf(jResp,'image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].enabled');
        LaunchTemplateId := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateId');
        LaunchTemplateName := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateName');
        LaunchTemplateVersion := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateVersion');
        maxParallelLaunches := CkJsonObject_IntOf(jResp,'image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].maxParallelLaunches');
        TargetResourceCount := CkJsonObject_IntOf(jResp,'image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].snapshotConfiguration.targetResourceCount');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions[i].launchTemplateConfigurations');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        accountId := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].accountId');
        launchTemplateId := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].launchTemplateId');
        setDefaultVersion := CkJsonObject_IntOf(jResp,'image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].setDefaultVersion');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.distributionConfiguration.distributions[i].licenseConfigurationArns');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'image.distributionConfiguration.distributions[i].licenseConfigurationArns[j]');
        j := j + 1;
      end;

    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'image.imageRecipe.blockDeviceMappings');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    deviceName := CkJsonObject__stringOf(jResp,'image.imageRecipe.blockDeviceMappings[i].deviceName');
    ebsDeleteOnTermination := CkJsonObject_IntOf(jResp,'image.imageRecipe.blockDeviceMappings[i].ebs.deleteOnTermination');
    ebsEncrypted := CkJsonObject_IntOf(jResp,'image.imageRecipe.blockDeviceMappings[i].ebs.encrypted');
    ebsIops := CkJsonObject_IntOf(jResp,'image.imageRecipe.blockDeviceMappings[i].ebs.iops');
    ebsKmsKeyId := CkJsonObject__stringOf(jResp,'image.imageRecipe.blockDeviceMappings[i].ebs.kmsKeyId');
    ebsSnapshotId := CkJsonObject__stringOf(jResp,'image.imageRecipe.blockDeviceMappings[i].ebs.snapshotId');
    ebsThroughput := CkJsonObject_IntOf(jResp,'image.imageRecipe.blockDeviceMappings[i].ebs.throughput');
    ebsVolumeSize := CkJsonObject_IntOf(jResp,'image.imageRecipe.blockDeviceMappings[i].ebs.volumeSize');
    ebsVolumeType := CkJsonObject__stringOf(jResp,'image.imageRecipe.blockDeviceMappings[i].ebs.volumeType');
    noDevice := CkJsonObject__stringOf(jResp,'image.imageRecipe.blockDeviceMappings[i].noDevice');
    virtualName := CkJsonObject__stringOf(jResp,'image.imageRecipe.blockDeviceMappings[i].virtualName');
    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'image.imageRecipe.components');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    componentArn := CkJsonObject__stringOf(jResp,'image.imageRecipe.components[i].componentArn');
    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.imageRecipe.components[i].parameters');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        name := CkJsonObject__stringOf(jResp,'image.imageRecipe.components[i].parameters[j].name');
        k := 0;
        count_k := CkJsonObject_SizeOfArray(jResp,'image.imageRecipe.components[i].parameters[j].value');
        while k < count_k do
          begin
            CkJsonObject_putK(jResp,k);
            strVal := CkJsonObject__stringOf(jResp,'image.imageRecipe.components[i].parameters[j].value[k]');
            k := k + 1;
          end;

        j := j + 1;
      end;

    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'image.infrastructureConfiguration.instanceTypes');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    strVal := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.instanceTypes[i]');
    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'image.infrastructureConfiguration.securityGroupIds');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    strVal := CkJsonObject__stringOf(jResp,'image.infrastructureConfiguration.securityGroupIds[i]');
    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'image.outputResources.amis');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    accountId := CkJsonObject__stringOf(jResp,'image.outputResources.amis[i].accountId');
    description := CkJsonObject__stringOf(jResp,'image.outputResources.amis[i].description');
    image := CkJsonObject__stringOf(jResp,'image.outputResources.amis[i].image');
    name := CkJsonObject__stringOf(jResp,'image.outputResources.amis[i].name');
    region := CkJsonObject__stringOf(jResp,'image.outputResources.amis[i].region');
    stateReason := CkJsonObject__stringOf(jResp,'image.outputResources.amis[i].state.reason');
    stateStatus := CkJsonObject__stringOf(jResp,'image.outputResources.amis[i].state.status');
    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'image.outputResources.containers');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    region := CkJsonObject__stringOf(jResp,'image.outputResources.containers[i].region');
    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'image.outputResources.containers[i].imageUris');
    while j < count_j do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'image.outputResources.containers[i].imageUris[j]');
        j := j + 1;
      end;

    i := i + 1;
  end;

// 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"
// }

CkRest_Dispose(rest);
CkAuthAws_Dispose(authAws);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jResp);