Skip to content

Commit

Permalink
feat(client-imagebuilder): Added support for EC2 Image Builder's inte…
Browse files Browse the repository at this point in the history
…gration with AWS Marketplace for Marketplace components.
  • Loading branch information
awstools committed Dec 2, 2024
1 parent 4ed232e commit 967f0c2
Show file tree
Hide file tree
Showing 15 changed files with 570 additions and 25 deletions.
8 changes: 8 additions & 0 deletions clients/client-imagebuilder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

</details>
<details>
<summary>
GetMarketplaceResource
</summary>

[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/)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-imagebuilder/src/Imagebuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -379,6 +384,7 @@ const commands = {
GetInfrastructureConfigurationCommand,
GetLifecycleExecutionCommand,
GetLifecyclePolicyCommand,
GetMarketplaceResourceCommand,
GetWorkflowCommand,
GetWorkflowExecutionCommand,
GetWorkflowStepExecutionCommand,
Expand Down Expand Up @@ -941,6 +947,23 @@ export interface Imagebuilder {
cb: (err: any, data?: GetLifecyclePolicyCommandOutput) => void
): void;

/**
* @see {@link GetMarketplaceResourceCommand}
*/
getMarketplaceResource(
args: GetMarketplaceResourceCommandInput,
options?: __HttpHandlerOptions
): Promise<GetMarketplaceResourceCommandOutput>;
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}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-imagebuilder/src/ImagebuilderClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -306,6 +310,7 @@ export type ServiceInputTypes =
| GetInfrastructureConfigurationCommandInput
| GetLifecycleExecutionCommandInput
| GetLifecyclePolicyCommandInput
| GetMarketplaceResourceCommandInput
| GetWorkflowCommandInput
| GetWorkflowExecutionCommandInput
| GetWorkflowStepExecutionCommandInput
Expand Down Expand Up @@ -384,6 +389,7 @@ export type ServiceOutputTypes =
| GetInfrastructureConfigurationCommandOutput
| GetLifecycleExecutionCommandOutput
| GetLifecyclePolicyCommandOutput
| GetMarketplaceResourceCommandOutput
| GetWorkflowCommandOutput
| GetWorkflowExecutionCommandOutput
| GetWorkflowStepExecutionCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
* // },
* // ],
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {}

/**
* <p>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.</p>
* @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)
* <p>You have exceeded the permitted request rate for the specific operation.</p>
*
* @throws {@link ClientException} (client fault)
* <p>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.</p>
*
* @throws {@link ForbiddenException} (client fault)
* <p>You are not authorized to perform the requested operation.</p>
*
* @throws {@link InvalidRequestException} (client fault)
* <p>You have requested an action that that the service doesn't support.</p>
*
* @throws {@link ServiceException} (server fault)
* <p>This exception is thrown when the service encounters an unrecoverable
* exception.</p>
*
* @throws {@link ServiceUnavailableException} (server fault)
* <p>The service is unable to process your request at this time.</p>
*
* @throws {@link ImagebuilderServiceException}
* <p>Base exception class for all service exceptions from Imagebuilder service.</p>
*
* @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;
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions clients/client-imagebuilder/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading

0 comments on commit 967f0c2

Please sign in to comment.