From 967f0c20baec3297b60f3c692429dd1af029733f Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 2 Dec 2024 03:56:57 +0000 Subject: [PATCH] feat(client-imagebuilder): Added support for EC2 Image Builder's integration with AWS Marketplace for Marketplace components. --- clients/client-imagebuilder/README.md | 8 + .../client-imagebuilder/src/Imagebuilder.ts | 23 ++ .../src/ImagebuilderClient.ts | 6 + .../src/commands/GetComponentCommand.ts | 8 +- .../commands/GetMarketplaceResourceCommand.ts | 119 ++++++++++ .../ListComponentBuildVersionsCommand.ts | 2 +- .../src/commands/ListComponentsCommand.ts | 9 +- .../commands/ListContainerRecipesCommand.ts | 2 +- .../src/commands/ListImageRecipesCommand.ts | 2 +- .../src/commands/ListImagesCommand.ts | 2 +- .../src/commands/ListWorkflowsCommand.ts | 2 +- .../client-imagebuilder/src/commands/index.ts | 1 + .../src/models/models_0.ts | 138 ++++++++++- .../src/protocols/Aws_restJson1.ts | 55 +++++ .../sdk-codegen/aws-models/imagebuilder.json | 218 +++++++++++++++++- 15 files changed, 570 insertions(+), 25 deletions(-) create mode 100644 clients/client-imagebuilder/src/commands/GetMarketplaceResourceCommand.ts diff --git a/clients/client-imagebuilder/README.md b/clients/client-imagebuilder/README.md index 5127194524b9..098cc5c37121 100644 --- a/clients/client-imagebuilder/README.md +++ b/clients/client-imagebuilder/README.md @@ -469,6 +469,14 @@ GetLifecyclePolicy [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/imagebuilder/command/GetLifecyclePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-imagebuilder/Interface/GetLifecyclePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-imagebuilder/Interface/GetLifecyclePolicyCommandOutput/) + +
+ +GetMarketplaceResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/imagebuilder/command/GetMarketplaceResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-imagebuilder/Interface/GetMarketplaceResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-imagebuilder/Interface/GetMarketplaceResourceCommandOutput/) +
diff --git a/clients/client-imagebuilder/src/Imagebuilder.ts b/clients/client-imagebuilder/src/Imagebuilder.ts index 7edd20eebe48..653dcc423ae7 100644 --- a/clients/client-imagebuilder/src/Imagebuilder.ts +++ b/clients/client-imagebuilder/src/Imagebuilder.ts @@ -155,6 +155,11 @@ import { GetLifecyclePolicyCommandInput, GetLifecyclePolicyCommandOutput, } from "./commands/GetLifecyclePolicyCommand"; +import { + GetMarketplaceResourceCommand, + GetMarketplaceResourceCommandInput, + GetMarketplaceResourceCommandOutput, +} from "./commands/GetMarketplaceResourceCommand"; import { GetWorkflowCommand, GetWorkflowCommandInput, GetWorkflowCommandOutput } from "./commands/GetWorkflowCommand"; import { GetWorkflowExecutionCommand, @@ -379,6 +384,7 @@ const commands = { GetInfrastructureConfigurationCommand, GetLifecycleExecutionCommand, GetLifecyclePolicyCommand, + GetMarketplaceResourceCommand, GetWorkflowCommand, GetWorkflowExecutionCommand, GetWorkflowStepExecutionCommand, @@ -941,6 +947,23 @@ export interface Imagebuilder { cb: (err: any, data?: GetLifecyclePolicyCommandOutput) => void ): void; + /** + * @see {@link GetMarketplaceResourceCommand} + */ + getMarketplaceResource( + args: GetMarketplaceResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getMarketplaceResource( + args: GetMarketplaceResourceCommandInput, + cb: (err: any, data?: GetMarketplaceResourceCommandOutput) => void + ): void; + getMarketplaceResource( + args: GetMarketplaceResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetMarketplaceResourceCommandOutput) => void + ): void; + /** * @see {@link GetWorkflowCommand} */ diff --git a/clients/client-imagebuilder/src/ImagebuilderClient.ts b/clients/client-imagebuilder/src/ImagebuilderClient.ts index e2f5109da2a6..c8db077c116f 100644 --- a/clients/client-imagebuilder/src/ImagebuilderClient.ts +++ b/clients/client-imagebuilder/src/ImagebuilderClient.ts @@ -137,6 +137,10 @@ import { GetLifecycleExecutionCommandOutput, } from "./commands/GetLifecycleExecutionCommand"; import { GetLifecyclePolicyCommandInput, GetLifecyclePolicyCommandOutput } from "./commands/GetLifecyclePolicyCommand"; +import { + GetMarketplaceResourceCommandInput, + GetMarketplaceResourceCommandOutput, +} from "./commands/GetMarketplaceResourceCommand"; import { GetWorkflowCommandInput, GetWorkflowCommandOutput } from "./commands/GetWorkflowCommand"; import { GetWorkflowExecutionCommandInput, @@ -306,6 +310,7 @@ export type ServiceInputTypes = | GetInfrastructureConfigurationCommandInput | GetLifecycleExecutionCommandInput | GetLifecyclePolicyCommandInput + | GetMarketplaceResourceCommandInput | GetWorkflowCommandInput | GetWorkflowExecutionCommandInput | GetWorkflowStepExecutionCommandInput @@ -384,6 +389,7 @@ export type ServiceOutputTypes = | GetInfrastructureConfigurationCommandOutput | GetLifecycleExecutionCommandOutput | GetLifecyclePolicyCommandOutput + | GetMarketplaceResourceCommandOutput | GetWorkflowCommandOutput | GetWorkflowExecutionCommandOutput | GetWorkflowStepExecutionCommandOutput diff --git a/clients/client-imagebuilder/src/commands/GetComponentCommand.ts b/clients/client-imagebuilder/src/commands/GetComponentCommand.ts index 62c3753e5da8..2f8888f582f2 100644 --- a/clients/client-imagebuilder/src/commands/GetComponentCommand.ts +++ b/clients/client-imagebuilder/src/commands/GetComponentCommand.ts @@ -54,7 +54,7 @@ export interface GetComponentCommandOutput extends GetComponentResponse, __Metad * // "STRING_VALUE", * // ], * // state: { // ComponentState - * // status: "DEPRECATED", + * // status: "DEPRECATED" || "DISABLED" || "ACTIVE", * // reason: "STRING_VALUE", * // }, * // parameters: [ // ComponentParameterDetailList @@ -77,6 +77,12 @@ export interface GetComponentCommandOutput extends GetComponentResponse, __Metad * // }, * // publisher: "STRING_VALUE", * // obfuscate: true || false, + * // productCodes: [ // ProductCodeList + * // { // ProductCodeListItem + * // productCodeId: "STRING_VALUE", // required + * // productCodeType: "marketplace", // required + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-imagebuilder/src/commands/GetMarketplaceResourceCommand.ts b/clients/client-imagebuilder/src/commands/GetMarketplaceResourceCommand.ts new file mode 100644 index 000000000000..1349479e2de7 --- /dev/null +++ b/clients/client-imagebuilder/src/commands/GetMarketplaceResourceCommand.ts @@ -0,0 +1,119 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ImagebuilderClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ImagebuilderClient"; +import { GetMarketplaceResourceRequest, GetMarketplaceResourceResponse } from "../models/models_0"; +import { de_GetMarketplaceResourceCommand, se_GetMarketplaceResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetMarketplaceResourceCommand}. + */ +export interface GetMarketplaceResourceCommandInput extends GetMarketplaceResourceRequest {} +/** + * @public + * + * The output of {@link GetMarketplaceResourceCommand}. + */ +export interface GetMarketplaceResourceCommandOutput extends GetMarketplaceResourceResponse, __MetadataBearer {} + +/** + *

Verify the subscription and perform resource dependency checks on the requested + * Amazon Web Services Marketplace resource. For Amazon Web Services Marketplace components, the response contains fields to download the + * components and their artifacts.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ImagebuilderClient, GetMarketplaceResourceCommand } from "@aws-sdk/client-imagebuilder"; // ES Modules import + * // const { ImagebuilderClient, GetMarketplaceResourceCommand } = require("@aws-sdk/client-imagebuilder"); // CommonJS import + * const client = new ImagebuilderClient(config); + * const input = { // GetMarketplaceResourceRequest + * resourceType: "COMPONENT_DATA" || "COMPONENT_ARTIFACT", // required + * resourceArn: "STRING_VALUE", // required + * resourceLocation: "STRING_VALUE", + * }; + * const command = new GetMarketplaceResourceCommand(input); + * const response = await client.send(command); + * // { // GetMarketplaceResourceResponse + * // resourceArn: "STRING_VALUE", + * // url: "STRING_VALUE", + * // data: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GetMarketplaceResourceCommandInput - {@link GetMarketplaceResourceCommandInput} + * @returns {@link GetMarketplaceResourceCommandOutput} + * @see {@link GetMarketplaceResourceCommandInput} for command's `input` shape. + * @see {@link GetMarketplaceResourceCommandOutput} for command's `response` shape. + * @see {@link ImagebuilderClientResolvedConfig | config} for ImagebuilderClient's `config` shape. + * + * @throws {@link CallRateLimitExceededException} (client fault) + *

You have exceeded the permitted request rate for the specific operation.

+ * + * @throws {@link ClientException} (client fault) + *

These errors are usually caused by a client action, such as using an action or + * resource on behalf of a user that doesn't have permissions to use the action or + * resource, or specifying an invalid resource identifier.

+ * + * @throws {@link ForbiddenException} (client fault) + *

You are not authorized to perform the requested operation.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

You have requested an action that that the service doesn't support.

+ * + * @throws {@link ServiceException} (server fault) + *

This exception is thrown when the service encounters an unrecoverable + * exception.

+ * + * @throws {@link ServiceUnavailableException} (server fault) + *

The service is unable to process your request at this time.

+ * + * @throws {@link ImagebuilderServiceException} + *

Base exception class for all service exceptions from Imagebuilder service.

+ * + * @public + */ +export class GetMarketplaceResourceCommand extends $Command + .classBuilder< + GetMarketplaceResourceCommandInput, + GetMarketplaceResourceCommandOutput, + ImagebuilderClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ImagebuilderClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("imagebuilder", "GetMarketplaceResource", {}) + .n("ImagebuilderClient", "GetMarketplaceResourceCommand") + .f(void 0, void 0) + .ser(se_GetMarketplaceResourceCommand) + .de(de_GetMarketplaceResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetMarketplaceResourceRequest; + output: GetMarketplaceResourceResponse; + }; + sdk: { + input: GetMarketplaceResourceCommandInput; + output: GetMarketplaceResourceCommandOutput; + }; + }; +} diff --git a/clients/client-imagebuilder/src/commands/ListComponentBuildVersionsCommand.ts b/clients/client-imagebuilder/src/commands/ListComponentBuildVersionsCommand.ts index d7390021f7e2..eb947b6e1942 100644 --- a/clients/client-imagebuilder/src/commands/ListComponentBuildVersionsCommand.ts +++ b/clients/client-imagebuilder/src/commands/ListComponentBuildVersionsCommand.ts @@ -55,7 +55,7 @@ export interface ListComponentBuildVersionsCommandOutput extends ListComponentBu * // "STRING_VALUE", * // ], * // state: { // ComponentState - * // status: "DEPRECATED", + * // status: "DEPRECATED" || "DISABLED" || "ACTIVE", * // reason: "STRING_VALUE", * // }, * // type: "BUILD" || "TEST", diff --git a/clients/client-imagebuilder/src/commands/ListComponentsCommand.ts b/clients/client-imagebuilder/src/commands/ListComponentsCommand.ts index c5411498ea66..38aae74822ab 100644 --- a/clients/client-imagebuilder/src/commands/ListComponentsCommand.ts +++ b/clients/client-imagebuilder/src/commands/ListComponentsCommand.ts @@ -47,7 +47,7 @@ export interface ListComponentsCommandOutput extends ListComponentsResponse, __M * // const { ImagebuilderClient, ListComponentsCommand } = require("@aws-sdk/client-imagebuilder"); // CommonJS import * const client = new ImagebuilderClient(config); * const input = { // ListComponentsRequest - * owner: "Self" || "Shared" || "Amazon" || "ThirdParty", + * owner: "Self" || "Shared" || "Amazon" || "ThirdParty" || "AWSMarketplace", * filters: [ // FilterList * { // Filter * name: "STRING_VALUE", @@ -77,6 +77,13 @@ export interface ListComponentsCommandOutput extends ListComponentsResponse, __M * // type: "BUILD" || "TEST", * // owner: "STRING_VALUE", * // dateCreated: "STRING_VALUE", + * // status: "DEPRECATED" || "DISABLED" || "ACTIVE", + * // productCodes: [ // ProductCodeList + * // { // ProductCodeListItem + * // productCodeId: "STRING_VALUE", // required + * // productCodeType: "marketplace", // required + * // }, + * // ], * // }, * // ], * // nextToken: "STRING_VALUE", diff --git a/clients/client-imagebuilder/src/commands/ListContainerRecipesCommand.ts b/clients/client-imagebuilder/src/commands/ListContainerRecipesCommand.ts index ddab998cef3e..52c31dded475 100644 --- a/clients/client-imagebuilder/src/commands/ListContainerRecipesCommand.ts +++ b/clients/client-imagebuilder/src/commands/ListContainerRecipesCommand.ts @@ -36,7 +36,7 @@ export interface ListContainerRecipesCommandOutput extends ListContainerRecipesR * // const { ImagebuilderClient, ListContainerRecipesCommand } = require("@aws-sdk/client-imagebuilder"); // CommonJS import * const client = new ImagebuilderClient(config); * const input = { // ListContainerRecipesRequest - * owner: "Self" || "Shared" || "Amazon" || "ThirdParty", + * owner: "Self" || "Shared" || "Amazon" || "ThirdParty" || "AWSMarketplace", * filters: [ // FilterList * { // Filter * name: "STRING_VALUE", diff --git a/clients/client-imagebuilder/src/commands/ListImageRecipesCommand.ts b/clients/client-imagebuilder/src/commands/ListImageRecipesCommand.ts index 154c1c887485..c0b27980aaf3 100644 --- a/clients/client-imagebuilder/src/commands/ListImageRecipesCommand.ts +++ b/clients/client-imagebuilder/src/commands/ListImageRecipesCommand.ts @@ -36,7 +36,7 @@ export interface ListImageRecipesCommandOutput extends ListImageRecipesResponse, * // const { ImagebuilderClient, ListImageRecipesCommand } = require("@aws-sdk/client-imagebuilder"); // CommonJS import * const client = new ImagebuilderClient(config); * const input = { // ListImageRecipesRequest - * owner: "Self" || "Shared" || "Amazon" || "ThirdParty", + * owner: "Self" || "Shared" || "Amazon" || "ThirdParty" || "AWSMarketplace", * filters: [ // FilterList * { // Filter * name: "STRING_VALUE", diff --git a/clients/client-imagebuilder/src/commands/ListImagesCommand.ts b/clients/client-imagebuilder/src/commands/ListImagesCommand.ts index 8d8e192f1050..e2dab268bb76 100644 --- a/clients/client-imagebuilder/src/commands/ListImagesCommand.ts +++ b/clients/client-imagebuilder/src/commands/ListImagesCommand.ts @@ -37,7 +37,7 @@ export interface ListImagesCommandOutput extends ListImagesResponse, __MetadataB * // const { ImagebuilderClient, ListImagesCommand } = require("@aws-sdk/client-imagebuilder"); // CommonJS import * const client = new ImagebuilderClient(config); * const input = { // ListImagesRequest - * owner: "Self" || "Shared" || "Amazon" || "ThirdParty", + * owner: "Self" || "Shared" || "Amazon" || "ThirdParty" || "AWSMarketplace", * filters: [ // FilterList * { // Filter * name: "STRING_VALUE", diff --git a/clients/client-imagebuilder/src/commands/ListWorkflowsCommand.ts b/clients/client-imagebuilder/src/commands/ListWorkflowsCommand.ts index 4b84eebd60b7..577059558086 100644 --- a/clients/client-imagebuilder/src/commands/ListWorkflowsCommand.ts +++ b/clients/client-imagebuilder/src/commands/ListWorkflowsCommand.ts @@ -36,7 +36,7 @@ export interface ListWorkflowsCommandOutput extends ListWorkflowsResponse, __Met * // const { ImagebuilderClient, ListWorkflowsCommand } = require("@aws-sdk/client-imagebuilder"); // CommonJS import * const client = new ImagebuilderClient(config); * const input = { // ListWorkflowsRequest - * owner: "Self" || "Shared" || "Amazon" || "ThirdParty", + * owner: "Self" || "Shared" || "Amazon" || "ThirdParty" || "AWSMarketplace", * filters: [ // FilterList * { // Filter * name: "STRING_VALUE", diff --git a/clients/client-imagebuilder/src/commands/index.ts b/clients/client-imagebuilder/src/commands/index.ts index 1e66d0de5141..e25bede435b3 100644 --- a/clients/client-imagebuilder/src/commands/index.ts +++ b/clients/client-imagebuilder/src/commands/index.ts @@ -32,6 +32,7 @@ export * from "./GetImageRecipePolicyCommand"; export * from "./GetInfrastructureConfigurationCommand"; export * from "./GetLifecycleExecutionCommand"; export * from "./GetLifecyclePolicyCommand"; +export * from "./GetMarketplaceResourceCommand"; export * from "./GetWorkflowCommand"; export * from "./GetWorkflowExecutionCommand"; export * from "./GetWorkflowStepExecutionCommand"; diff --git a/clients/client-imagebuilder/src/models/models_0.ts b/clients/client-imagebuilder/src/models/models_0.ts index 91edc224977e..b080b5d1edc1 100644 --- a/clients/client-imagebuilder/src/models/models_0.ts +++ b/clients/client-imagebuilder/src/models/models_0.ts @@ -579,12 +579,48 @@ export const Platform = { */ export type Platform = (typeof Platform)[keyof typeof Platform]; +/** + * @public + * @enum + */ +export const ProductCodeType = { + MARKETPLACE: "marketplace", +} as const; + +/** + * @public + */ +export type ProductCodeType = (typeof ProductCodeType)[keyof typeof ProductCodeType]; + +/** + *

Information about a single product code.

+ * @public + */ +export interface ProductCodeListItem { + /** + *

For Amazon Web Services Marketplace components, this contains the product code ID that can be stamped onto + * an EC2 AMI to ensure that components are billed correctly. If this property is empty, + * it might mean that the component is not published.

+ * @public + */ + productCodeId: string | undefined; + + /** + *

The owner of the product code that's billed. If this property is + * empty, it might mean that the component is not published.

+ * @public + */ + productCodeType: ProductCodeType | undefined; +} + /** * @public * @enum */ export const ComponentStatus = { + ACTIVE: "ACTIVE", DEPRECATED: "DEPRECATED", + DISABLED: "DISABLED", } as const; /** @@ -682,8 +718,7 @@ export interface Component { supportedOsVersions?: string[] | undefined; /** - *

Describes the current status of the component. This is used for components that are no - * longer active.

+ *

Describes the current status of the component.

* @public */ state?: ComponentState | undefined; @@ -744,6 +779,12 @@ export interface Component { * @public */ obfuscate?: boolean | undefined; + + /** + *

Contains product codes that are used for billing purposes for Amazon Web Services Marketplace components.

+ * @public + */ + productCodes?: ProductCodeListItem[] | undefined; } /** @@ -884,8 +925,8 @@ export interface ComponentSummary { publisher?: string | undefined; /** - *

Indicates whether component source is hidden from view in the console, - * and from component detail results for API, CLI, or SDK operations.

+ *

Indicates whether component source is hidden from view in the console, and from + * component detail results for API, CLI, or SDK operations.

* @public */ obfuscate?: boolean | undefined; @@ -985,6 +1026,18 @@ export interface ComponentVersion { * @public */ dateCreated?: string | undefined; + + /** + *

Describes the current status of the component version.

+ * @public + */ + status?: ComponentStatus | undefined; + + /** + *

Contains product codes that are used for billing purposes for Amazon Web Services Marketplace components.

+ * @public + */ + productCodes?: ProductCodeListItem[] | undefined; } /** @@ -1031,8 +1084,9 @@ export interface TargetContainerRepository { service: ContainerRepositoryService | undefined; /** - *

The name of the container repository where the output container image is stored. This - * name is prefixed by the repository location.

+ *

The name of the container repository where the output container image is stored. + * This name is prefixed by the repository location. For example, + * /repository_name.

* @public */ repositoryName: string | undefined; @@ -2098,7 +2152,7 @@ export interface ImageTestsConfiguration { /** *

The maximum time in minutes that tests are permitted to run.

* - *

The timeoutMinutes attribute is not currently active. This value is + *

The timeout attribute is not currently active. This value is * ignored.

*
* @public @@ -5036,6 +5090,66 @@ export interface GetLifecyclePolicyResponse { lifecyclePolicy?: LifecyclePolicy | undefined; } +/** + * @public + * @enum + */ +export const MarketplaceResourceType = { + COMPONENT_ARTIFACT: "COMPONENT_ARTIFACT", + COMPONENT_DATA: "COMPONENT_DATA", +} as const; + +/** + * @public + */ +export type MarketplaceResourceType = (typeof MarketplaceResourceType)[keyof typeof MarketplaceResourceType]; + +/** + * @public + */ +export interface GetMarketplaceResourceRequest { + /** + *

Specifies which type of Amazon Web Services Marketplace resource Image Builder retrieves.

+ * @public + */ + resourceType: MarketplaceResourceType | undefined; + + /** + *

The Amazon Resource Name (ARN) that uniquely identifies an Amazon Web Services Marketplace resource.

+ * @public + */ + resourceArn: string | undefined; + + /** + *

The bucket path that you can specify to download the resource from Amazon S3.

+ * @public + */ + resourceLocation?: string | undefined; +} + +/** + * @public + */ +export interface GetMarketplaceResourceResponse { + /** + *

The Amazon Resource Name (ARN) for the Amazon Web Services Marketplace resource that was requested.

+ * @public + */ + resourceArn?: string | undefined; + + /** + *

The obfuscated S3 URL to download the component artifact from.

+ * @public + */ + url?: string | undefined; + + /** + *

Returns obfuscated data that contains the YAML content of the component.

+ * @public + */ + data?: string | undefined; +} + /** * @public */ @@ -5810,6 +5924,7 @@ export interface ListComponentBuildVersionsResponse { */ export const Ownership = { AMAZON: "Amazon", + AWS_MARKETPLACE: "AWSMarketplace", SELF: "Self", SHARED: "Shared", THIRDPARTY: "ThirdParty", @@ -6271,18 +6386,21 @@ export interface ListImagePackagesRequest { } /** - *

Represents a package installed on an Image Builder image.

+ *

A software package that's installed on top of the base image to create a + * customized image.

* @public */ export interface ImagePackage { /** - *

The name of the package as reported to the operating system package manager.

+ *

The name of the package that's reported to the operating system package + * manager.

* @public */ packageName?: string | undefined; /** - *

The version of the package as reported to the operating system package manager.

+ *

The version of the package that's reported to the operating system package + * manager.

* @public */ packageVersion?: string | undefined; diff --git a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts index a718b6e72cbf..90ac14004f0a 100644 --- a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts +++ b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts @@ -111,6 +111,10 @@ import { GetLifecycleExecutionCommandOutput, } from "../commands/GetLifecycleExecutionCommand"; import { GetLifecyclePolicyCommandInput, GetLifecyclePolicyCommandOutput } from "../commands/GetLifecyclePolicyCommand"; +import { + GetMarketplaceResourceCommandInput, + GetMarketplaceResourceCommandOutput, +} from "../commands/GetMarketplaceResourceCommand"; import { GetWorkflowCommandInput, GetWorkflowCommandOutput } from "../commands/GetWorkflowCommand"; import { GetWorkflowExecutionCommandInput, @@ -1038,6 +1042,30 @@ export const se_GetLifecyclePolicyCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1GetMarketplaceResourceCommand + */ +export const se_GetMarketplaceResourceCommand = async ( + input: GetMarketplaceResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/GetMarketplaceResource"); + let body: any; + body = JSON.stringify( + take(input, { + resourceArn: [], + resourceLocation: [], + resourceType: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1GetWorkflowCommand */ @@ -2748,6 +2776,29 @@ export const de_GetLifecyclePolicyCommand = async ( return contents; }; +/** + * deserializeAws_restJson1GetMarketplaceResourceCommand + */ +export const de_GetMarketplaceResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + data: __expectString, + resourceArn: __expectString, + url: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1GetWorkflowCommand */ @@ -4665,6 +4716,10 @@ const de_PackageVulnerabilityDetails = (output: any, context: __SerdeContext): P // de_Placement omitted. +// de_ProductCodeList omitted. + +// de_ProductCodeListItem omitted. + // de_RegionList omitted. // de_Remediation omitted. diff --git a/codegen/sdk-codegen/aws-models/imagebuilder.json b/codegen/sdk-codegen/aws-models/imagebuilder.json index 1d472feeb35c..20a6ffe18790 100644 --- a/codegen/sdk-codegen/aws-models/imagebuilder.json +++ b/codegen/sdk-codegen/aws-models/imagebuilder.json @@ -481,7 +481,7 @@ "state": { "target": "com.amazonaws.imagebuilder#ComponentState", "traits": { - "smithy.api#documentation": "

Describes the current status of the component. This is used for components that are no\n\t\t\tlonger active.

" + "smithy.api#documentation": "

Describes the current status of the component.

" } }, "parameters": { @@ -538,6 +538,12 @@ "smithy.api#default": false, "smithy.api#documentation": "

Indicates whether component source is hidden from view in the console, and from \n\t\t\tcomponent detail results for API, CLI, or SDK operations.

" } + }, + "productCodes": { + "target": "com.amazonaws.imagebuilder#ProductCodeList", + "traits": { + "smithy.api#documentation": "

Contains product codes that are used for billing purposes for Amazon Web Services Marketplace components.

" + } } }, "traits": { @@ -742,6 +748,18 @@ "traits": { "smithy.api#enumValue": "DEPRECATED" } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } } } }, @@ -830,7 +848,7 @@ "target": "com.amazonaws.imagebuilder#Boolean", "traits": { "smithy.api#default": false, - "smithy.api#documentation": "

Indicates whether component source is hidden from view in the console, \n\t\t\tand from component detail results for API, CLI, or SDK operations.

" + "smithy.api#documentation": "

Indicates whether component source is hidden from view in the console, and from \n\t\t\tcomponent detail results for API, CLI, or SDK operations.

" } } }, @@ -917,6 +935,18 @@ "traits": { "smithy.api#documentation": "

The date that the component was created.

" } + }, + "status": { + "target": "com.amazonaws.imagebuilder#ComponentStatus", + "traits": { + "smithy.api#documentation": "

Describes the current status of the component version.

" + } + }, + "productCodes": { + "target": "com.amazonaws.imagebuilder#ProductCodeList", + "traits": { + "smithy.api#documentation": "

Contains product codes that are used for billing purposes for Amazon Web Services Marketplace components.

" + } } }, "traits": { @@ -3891,7 +3921,7 @@ "com.amazonaws.imagebuilder#FilterValue": { "type": "string", "traits": { - "smithy.api#pattern": "^[0-9a-zA-Z./_ :-]{1,1024}$" + "smithy.api#pattern": "^[0-9a-zA-Z./_ :,{}\"-]{1,1024}$" } }, "com.amazonaws.imagebuilder#FilterValues": { @@ -4858,6 +4888,97 @@ "smithy.api#output": {} } }, + "com.amazonaws.imagebuilder#GetMarketplaceResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.imagebuilder#GetMarketplaceResourceRequest" + }, + "output": { + "target": "com.amazonaws.imagebuilder#GetMarketplaceResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.imagebuilder#CallRateLimitExceededException" + }, + { + "target": "com.amazonaws.imagebuilder#ClientException" + }, + { + "target": "com.amazonaws.imagebuilder#ForbiddenException" + }, + { + "target": "com.amazonaws.imagebuilder#InvalidRequestException" + }, + { + "target": "com.amazonaws.imagebuilder#ServiceException" + }, + { + "target": "com.amazonaws.imagebuilder#ServiceUnavailableException" + } + ], + "traits": { + "smithy.api#documentation": "

Verify the subscription and perform resource dependency checks on the requested \n\t\t\tAmazon Web Services Marketplace resource. For Amazon Web Services Marketplace components, the response contains fields to download the \n\t\t\tcomponents and their artifacts.

", + "smithy.api#http": { + "method": "POST", + "uri": "/GetMarketplaceResource", + "code": 200 + } + } + }, + "com.amazonaws.imagebuilder#GetMarketplaceResourceRequest": { + "type": "structure", + "members": { + "resourceType": { + "target": "com.amazonaws.imagebuilder#MarketplaceResourceType", + "traits": { + "smithy.api#documentation": "

Specifies which type of Amazon Web Services Marketplace resource Image Builder retrieves.

", + "smithy.api#required": {} + } + }, + "resourceArn": { + "target": "com.amazonaws.imagebuilder#ImageBuilderArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies an Amazon Web Services Marketplace resource.

", + "smithy.api#required": {} + } + }, + "resourceLocation": { + "target": "com.amazonaws.imagebuilder#MarketplaceResourceLocation", + "traits": { + "smithy.api#documentation": "

The bucket path that you can specify to download the resource from Amazon S3.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.imagebuilder#GetMarketplaceResourceResponse": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.imagebuilder#ImageBuilderArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) for the Amazon Web Services Marketplace resource that was requested.

" + } + }, + "url": { + "target": "com.amazonaws.imagebuilder#NonEmptyString", + "traits": { + "smithy.api#documentation": "

The obfuscated S3 URL to download the component artifact from.

" + } + }, + "data": { + "target": "com.amazonaws.imagebuilder#NonEmptyString", + "traits": { + "smithy.api#documentation": "

Returns obfuscated data that contains the YAML content of the component.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.imagebuilder#GetWorkflow": { "type": "operation", "input": { @@ -5476,18 +5597,18 @@ "packageName": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

The name of the package as reported to the operating system package manager.

" + "smithy.api#documentation": "

The name of the package that's reported to the operating system package \n\t\t\tmanager.

" } }, "packageVersion": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

The version of the package as reported to the operating system package manager.

" + "smithy.api#documentation": "

The version of the package that's reported to the operating system package \n\t\t\tmanager.

" } } }, "traits": { - "smithy.api#documentation": "

Represents a package installed on an Image Builder image.

" + "smithy.api#documentation": "

A software package that's installed on top of the base image to create a \n\t\t\tcustomized image.

" } }, "com.amazonaws.imagebuilder#ImagePackageList": { @@ -6325,7 +6446,7 @@ "timeoutMinutes": { "target": "com.amazonaws.imagebuilder#ImageTestsTimeoutMinutes", "traits": { - "smithy.api#documentation": "

The maximum time in minutes that tests are permitted to run.

\n \n

The timeoutMinutes attribute is not currently active. This value is\n\t\t\t\tignored.

\n
" + "smithy.api#documentation": "

The maximum time in minutes that tests are permitted to run.

\n \n

The timeout attribute is not currently active. This value is\n\t\t\t\tignored.

\n
" } } }, @@ -10327,6 +10448,33 @@ "smithy.api#documentation": "

Logging configuration defines where Image Builder uploads your logs.

" } }, + "com.amazonaws.imagebuilder#MarketplaceResourceLocation": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1024 + }, + "smithy.api#pattern": "^s3://[^/]+/.+[^/]$" + } + }, + "com.amazonaws.imagebuilder#MarketplaceResourceType": { + "type": "enum", + "members": { + "COMPONENT_DATA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPONENT_DATA" + } + }, + "COMPONENT_ARTIFACT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPONENT_ARTIFACT" + } + } + } + }, "com.amazonaws.imagebuilder#MaxParallelLaunches": { "type": "integer", "traits": { @@ -10485,6 +10633,12 @@ "traits": { "smithy.api#enumValue": "ThirdParty" } + }, + "AWS_MARKETPLACE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AWSMarketplace" + } } } }, @@ -10671,6 +10825,51 @@ } } }, + "com.amazonaws.imagebuilder#ProductCodeId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[A-Za-z0-9]{1,25}$" + } + }, + "com.amazonaws.imagebuilder#ProductCodeList": { + "type": "list", + "member": { + "target": "com.amazonaws.imagebuilder#ProductCodeListItem" + } + }, + "com.amazonaws.imagebuilder#ProductCodeListItem": { + "type": "structure", + "members": { + "productCodeId": { + "target": "com.amazonaws.imagebuilder#ProductCodeId", + "traits": { + "smithy.api#documentation": "

For Amazon Web Services Marketplace components, this contains the product code ID that can be stamped onto \n\t\t\tan EC2 AMI to ensure that components are billed correctly. If this property is empty, \n\t\t\tit might mean that the component is not published.

", + "smithy.api#required": {} + } + }, + "productCodeType": { + "target": "com.amazonaws.imagebuilder#ProductCodeType", + "traits": { + "smithy.api#documentation": "

The owner of the product code that's billed. If this property is \n\t\t\tempty, it might mean that the component is not published.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about a single product code.

" + } + }, + "com.amazonaws.imagebuilder#ProductCodeType": { + "type": "enum", + "members": { + "MARKETPLACE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "marketplace" + } + } + } + }, "com.amazonaws.imagebuilder#PutComponentPolicy": { "type": "operation", "input": { @@ -11875,7 +12074,7 @@ "repositoryName": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

The name of the container repository where the output container image is stored. This\n\t\t\tname is prefixed by the repository location.

", + "smithy.api#documentation": "

The name of the container repository where the output container image is stored. \n\t\t\tThis name is prefixed by the repository location. For example, \n\t\t\t/repository_name.

", "smithy.api#required": {} } } @@ -13673,6 +13872,9 @@ { "target": "com.amazonaws.imagebuilder#GetLifecyclePolicy" }, + { + "target": "com.amazonaws.imagebuilder#GetMarketplaceResource" + }, { "target": "com.amazonaws.imagebuilder#GetWorkflow" },