Skip to content

Commit

Permalink
feat(client-imagebuilder): This release adds support for importing im…
Browse files Browse the repository at this point in the history
…ages from ISO disk files. Added new ImportDiskImage API operation.
  • Loading branch information
awstools committed Jan 7, 2025
1 parent b2cbba5 commit 225a408
Show file tree
Hide file tree
Showing 12 changed files with 476 additions and 18 deletions.
8 changes: 8 additions & 0 deletions clients/client-imagebuilder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,14 @@ ImportComponent

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/imagebuilder/command/ImportComponentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-imagebuilder/Interface/ImportComponentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-imagebuilder/Interface/ImportComponentCommandOutput/)

</details>
<details>
<summary>
ImportDiskImage
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/imagebuilder/command/ImportDiskImageCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-imagebuilder/Interface/ImportDiskImageCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-imagebuilder/Interface/ImportDiskImageCommandOutput/)

</details>
<details>
<summary>
Expand Down
20 changes: 20 additions & 0 deletions clients/client-imagebuilder/src/Imagebuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ import {
ImportComponentCommandInput,
ImportComponentCommandOutput,
} from "./commands/ImportComponentCommand";
import {
ImportDiskImageCommand,
ImportDiskImageCommandInput,
ImportDiskImageCommandOutput,
} from "./commands/ImportDiskImageCommand";
import {
ImportVmImageCommand,
ImportVmImageCommandInput,
Expand Down Expand Up @@ -389,6 +394,7 @@ const commands = {
GetWorkflowExecutionCommand,
GetWorkflowStepExecutionCommand,
ImportComponentCommand,
ImportDiskImageCommand,
ImportVmImageCommand,
ListComponentBuildVersionsCommand,
ListComponentsCommand,
Expand Down Expand Up @@ -1023,6 +1029,20 @@ export interface Imagebuilder {
cb: (err: any, data?: ImportComponentCommandOutput) => void
): void;

/**
* @see {@link ImportDiskImageCommand}
*/
importDiskImage(
args: ImportDiskImageCommandInput,
options?: __HttpHandlerOptions
): Promise<ImportDiskImageCommandOutput>;
importDiskImage(args: ImportDiskImageCommandInput, cb: (err: any, data?: ImportDiskImageCommandOutput) => void): void;
importDiskImage(
args: ImportDiskImageCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ImportDiskImageCommandOutput) => void
): void;

/**
* @see {@link ImportVmImageCommand}
*/
Expand Down
3 changes: 3 additions & 0 deletions clients/client-imagebuilder/src/ImagebuilderClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ import {
GetWorkflowStepExecutionCommandOutput,
} from "./commands/GetWorkflowStepExecutionCommand";
import { ImportComponentCommandInput, ImportComponentCommandOutput } from "./commands/ImportComponentCommand";
import { ImportDiskImageCommandInput, ImportDiskImageCommandOutput } from "./commands/ImportDiskImageCommand";
import { ImportVmImageCommandInput, ImportVmImageCommandOutput } from "./commands/ImportVmImageCommand";
import {
ListComponentBuildVersionsCommandInput,
Expand Down Expand Up @@ -315,6 +316,7 @@ export type ServiceInputTypes =
| GetWorkflowExecutionCommandInput
| GetWorkflowStepExecutionCommandInput
| ImportComponentCommandInput
| ImportDiskImageCommandInput
| ImportVmImageCommandInput
| ListComponentBuildVersionsCommandInput
| ListComponentsCommandInput
Expand Down Expand Up @@ -394,6 +396,7 @@ export type ServiceOutputTypes =
| GetWorkflowExecutionCommandOutput
| GetWorkflowStepExecutionCommandOutput
| ImportComponentCommandOutput
| ImportDiskImageCommandOutput
| ImportVmImageCommandOutput
| ListComponentBuildVersionsCommandOutput
| ListComponentsCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export interface GetImageCommandOutput extends GetImageResponse, __MetadataBeare
* // ],
* // },
* // tags: "<TagMap>",
* // buildType: "USER_INITIATED" || "SCHEDULED" || "IMPORT",
* // buildType: "USER_INITIATED" || "SCHEDULED" || "IMPORT" || "IMPORT_ISO",
* // imageSource: "AMAZON_MANAGED" || "AWS_MARKETPLACE" || "IMPORTED" || "CUSTOM",
* // scanState: { // ImageScanState
* // status: "PENDING" || "SCANNING" || "COLLECTING" || "COMPLETED" || "ABANDONED" || "FAILED" || "TIMED_OUT",
Expand Down
122 changes: 122 additions & 0 deletions clients/client-imagebuilder/src/commands/ImportDiskImageCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// 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 { ImportDiskImageRequest, ImportDiskImageResponse } from "../models/models_0";
import { de_ImportDiskImageCommand, se_ImportDiskImageCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link ImportDiskImageCommand}.
*/
export interface ImportDiskImageCommandInput extends ImportDiskImageRequest {}
/**
* @public
*
* The output of {@link ImportDiskImageCommand}.
*/
export interface ImportDiskImageCommandOutput extends ImportDiskImageResponse, __MetadataBearer {}

/**
* <p>Import a Windows operating system image from a verified Microsoft ISO disk
* file. The following disk images are supported:</p>
* <ul>
* <li>
* <p>Windows 11 Enterprise</p>
* </li>
* </ul>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ImagebuilderClient, ImportDiskImageCommand } from "@aws-sdk/client-imagebuilder"; // ES Modules import
* // const { ImagebuilderClient, ImportDiskImageCommand } = require("@aws-sdk/client-imagebuilder"); // CommonJS import
* const client = new ImagebuilderClient(config);
* const input = { // ImportDiskImageRequest
* name: "STRING_VALUE", // required
* semanticVersion: "STRING_VALUE", // required
* description: "STRING_VALUE",
* platform: "STRING_VALUE", // required
* osVersion: "STRING_VALUE", // required
* executionRole: "STRING_VALUE",
* infrastructureConfigurationArn: "STRING_VALUE", // required
* uri: "STRING_VALUE", // required
* tags: { // TagMap
* "<keys>": "STRING_VALUE",
* },
* clientToken: "STRING_VALUE", // required
* };
* const command = new ImportDiskImageCommand(input);
* const response = await client.send(command);
* // { // ImportDiskImageResponse
* // clientToken: "STRING_VALUE",
* // imageBuildVersionArn: "STRING_VALUE",
* // };
*
* ```
*
* @param ImportDiskImageCommandInput - {@link ImportDiskImageCommandInput}
* @returns {@link ImportDiskImageCommandOutput}
* @see {@link ImportDiskImageCommandInput} for command's `input` shape.
* @see {@link ImportDiskImageCommandOutput} for command's `response` shape.
* @see {@link ImagebuilderClientResolvedConfig | config} for ImagebuilderClient's `config` shape.
*
* @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 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 ImportDiskImageCommand extends $Command
.classBuilder<
ImportDiskImageCommandInput,
ImportDiskImageCommandOutput,
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", "ImportDiskImage", {})
.n("ImagebuilderClient", "ImportDiskImageCommand")
.f(void 0, void 0)
.ser(se_ImportDiskImageCommand)
.de(de_ImportDiskImageCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: ImportDiskImageRequest;
output: ImportDiskImageResponse;
};
sdk: {
input: ImportDiskImageCommandInput;
output: ImportDiskImageCommandOutput;
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface ListImageBuildVersionsCommandOutput extends ListImageBuildVersi
* // tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
* // buildType: "USER_INITIATED" || "SCHEDULED" || "IMPORT",
* // buildType: "USER_INITIATED" || "SCHEDULED" || "IMPORT" || "IMPORT_ISO",
* // imageSource: "AMAZON_MANAGED" || "AWS_MARKETPLACE" || "IMPORTED" || "CUSTOM",
* // deprecationTime: new Date("TIMESTAMP"),
* // lifecycleExecutionId: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface ListImagePipelineImagesCommandOutput extends ListImagePipelineI
* // tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
* // buildType: "USER_INITIATED" || "SCHEDULED" || "IMPORT",
* // buildType: "USER_INITIATED" || "SCHEDULED" || "IMPORT" || "IMPORT_ISO",
* // imageSource: "AMAZON_MANAGED" || "AWS_MARKETPLACE" || "IMPORTED" || "CUSTOM",
* // deprecationTime: new Date("TIMESTAMP"),
* // lifecycleExecutionId: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface ListImagesCommandOutput extends ListImagesResponse, __MetadataB
* // osVersion: "STRING_VALUE",
* // owner: "STRING_VALUE",
* // dateCreated: "STRING_VALUE",
* // buildType: "USER_INITIATED" || "SCHEDULED" || "IMPORT",
* // buildType: "USER_INITIATED" || "SCHEDULED" || "IMPORT" || "IMPORT_ISO",
* // imageSource: "AMAZON_MANAGED" || "AWS_MARKETPLACE" || "IMPORTED" || "CUSTOM",
* // },
* // ],
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 @@ -37,6 +37,7 @@ export * from "./GetWorkflowCommand";
export * from "./GetWorkflowExecutionCommand";
export * from "./GetWorkflowStepExecutionCommand";
export * from "./ImportComponentCommand";
export * from "./ImportDiskImageCommand";
export * from "./ImportVmImageCommand";
export * from "./ListComponentBuildVersionsCommand";
export * from "./ListComponentsCommand";
Expand Down
Loading

0 comments on commit 225a408

Please sign in to comment.