Skip to content

Commit

Permalink
feat(client-ecr): Released two new APIs along with documentation upda…
Browse files Browse the repository at this point in the history
…tes. The GetAccountSetting API is used to view the current basic scan type version setting for your registry, while the PutAccountSetting API is used to update the basic scan type version for your registry.
  • Loading branch information
awstools committed Aug 5, 2024
1 parent 80cb054 commit 6da4252
Show file tree
Hide file tree
Showing 9 changed files with 562 additions and 6 deletions.
16 changes: 16 additions & 0 deletions clients/client-ecr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,14 @@ DescribeRepositoryCreationTemplates

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/DescribeRepositoryCreationTemplatesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DescribeRepositoryCreationTemplatesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DescribeRepositoryCreationTemplatesCommandOutput/)

</details>
<details>
<summary>
GetAccountSetting
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/GetAccountSettingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/GetAccountSettingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/GetAccountSettingCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -459,6 +467,14 @@ ListTagsForResource

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/ListTagsForResourceCommandOutput/)

</details>
<details>
<summary>
PutAccountSetting
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/PutAccountSettingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/PutAccountSettingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/PutAccountSettingCommandOutput/)

</details>
<details>
<summary>
Expand Down
46 changes: 46 additions & 0 deletions clients/client-ecr/src/ECR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ import {
DescribeRepositoryCreationTemplatesCommandInput,
DescribeRepositoryCreationTemplatesCommandOutput,
} from "./commands/DescribeRepositoryCreationTemplatesCommand";
import {
GetAccountSettingCommand,
GetAccountSettingCommandInput,
GetAccountSettingCommandOutput,
} from "./commands/GetAccountSettingCommand";
import {
GetAuthorizationTokenCommand,
GetAuthorizationTokenCommandInput,
Expand Down Expand Up @@ -153,6 +158,11 @@ import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import {
PutAccountSettingCommand,
PutAccountSettingCommandInput,
PutAccountSettingCommandOutput,
} from "./commands/PutAccountSettingCommand";
import { PutImageCommand, PutImageCommandInput, PutImageCommandOutput } from "./commands/PutImageCommand";
import {
PutImageScanningConfigurationCommand,
Expand Down Expand Up @@ -249,6 +259,7 @@ const commands = {
DescribeRegistryCommand,
DescribeRepositoriesCommand,
DescribeRepositoryCreationTemplatesCommand,
GetAccountSettingCommand,
GetAuthorizationTokenCommand,
GetDownloadUrlForLayerCommand,
GetLifecyclePolicyCommand,
Expand All @@ -259,6 +270,7 @@ const commands = {
InitiateLayerUploadCommand,
ListImagesCommand,
ListTagsForResourceCommand,
PutAccountSettingCommand,
PutImageCommand,
PutImageScanningConfigurationCommand,
PutImageTagMutabilityCommand,
Expand Down Expand Up @@ -631,6 +643,23 @@ export interface ECR {
cb: (err: any, data?: DescribeRepositoryCreationTemplatesCommandOutput) => void
): void;

/**
* @see {@link GetAccountSettingCommand}
*/
getAccountSetting(
args: GetAccountSettingCommandInput,
options?: __HttpHandlerOptions
): Promise<GetAccountSettingCommandOutput>;
getAccountSetting(
args: GetAccountSettingCommandInput,
cb: (err: any, data?: GetAccountSettingCommandOutput) => void
): void;
getAccountSetting(
args: GetAccountSettingCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetAccountSettingCommandOutput) => void
): void;

/**
* @see {@link GetAuthorizationTokenCommand}
*/
Expand Down Expand Up @@ -798,6 +827,23 @@ export interface ECR {
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
): void;

/**
* @see {@link PutAccountSettingCommand}
*/
putAccountSetting(
args: PutAccountSettingCommandInput,
options?: __HttpHandlerOptions
): Promise<PutAccountSettingCommandOutput>;
putAccountSetting(
args: PutAccountSettingCommandInput,
cb: (err: any, data?: PutAccountSettingCommandOutput) => void
): void;
putAccountSetting(
args: PutAccountSettingCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PutAccountSettingCommandOutput) => void
): void;

/**
* @see {@link PutImageCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-ecr/src/ECRClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ import {
DescribeRepositoryCreationTemplatesCommandInput,
DescribeRepositoryCreationTemplatesCommandOutput,
} from "./commands/DescribeRepositoryCreationTemplatesCommand";
import { GetAccountSettingCommandInput, GetAccountSettingCommandOutput } from "./commands/GetAccountSettingCommand";
import {
GetAuthorizationTokenCommandInput,
GetAuthorizationTokenCommandOutput,
Expand Down Expand Up @@ -150,6 +151,7 @@ import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { PutAccountSettingCommandInput, PutAccountSettingCommandOutput } from "./commands/PutAccountSettingCommand";
import { PutImageCommandInput, PutImageCommandOutput } from "./commands/PutImageCommand";
import {
PutImageScanningConfigurationCommandInput,
Expand Down Expand Up @@ -229,6 +231,7 @@ export type ServiceInputTypes =
| DescribeRegistryCommandInput
| DescribeRepositoriesCommandInput
| DescribeRepositoryCreationTemplatesCommandInput
| GetAccountSettingCommandInput
| GetAuthorizationTokenCommandInput
| GetDownloadUrlForLayerCommandInput
| GetLifecyclePolicyCommandInput
Expand All @@ -239,6 +242,7 @@ export type ServiceInputTypes =
| InitiateLayerUploadCommandInput
| ListImagesCommandInput
| ListTagsForResourceCommandInput
| PutAccountSettingCommandInput
| PutImageCommandInput
| PutImageScanningConfigurationCommandInput
| PutImageTagMutabilityCommandInput
Expand Down Expand Up @@ -281,6 +285,7 @@ export type ServiceOutputTypes =
| DescribeRegistryCommandOutput
| DescribeRepositoriesCommandOutput
| DescribeRepositoryCreationTemplatesCommandOutput
| GetAccountSettingCommandOutput
| GetAuthorizationTokenCommandOutput
| GetDownloadUrlForLayerCommandOutput
| GetLifecyclePolicyCommandOutput
Expand All @@ -291,6 +296,7 @@ export type ServiceOutputTypes =
| InitiateLayerUploadCommandOutput
| ListImagesCommandOutput
| ListTagsForResourceCommandOutput
| PutAccountSettingCommandOutput
| PutImageCommandOutput
| PutImageScanningConfigurationCommandOutput
| PutImageTagMutabilityCommandOutput
Expand Down
93 changes: 93 additions & 0 deletions clients/client-ecr/src/commands/GetAccountSettingCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// 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 { ECRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECRClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetAccountSettingRequest, GetAccountSettingResponse } from "../models/models_0";
import { de_GetAccountSettingCommand, se_GetAccountSettingCommand } from "../protocols/Aws_json1_1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link GetAccountSettingCommand}.
*/
export interface GetAccountSettingCommandInput extends GetAccountSettingRequest {}
/**
* @public
*
* The output of {@link GetAccountSettingCommand}.
*/
export interface GetAccountSettingCommandOutput extends GetAccountSettingResponse, __MetadataBearer {}

/**
* <p>Retrieves the basic scan type version name.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ECRClient, GetAccountSettingCommand } from "@aws-sdk/client-ecr"; // ES Modules import
* // const { ECRClient, GetAccountSettingCommand } = require("@aws-sdk/client-ecr"); // CommonJS import
* const client = new ECRClient(config);
* const input = { // GetAccountSettingRequest
* name: "STRING_VALUE", // required
* };
* const command = new GetAccountSettingCommand(input);
* const response = await client.send(command);
* // { // GetAccountSettingResponse
* // name: "STRING_VALUE",
* // value: "STRING_VALUE",
* // };
*
* ```
*
* @param GetAccountSettingCommandInput - {@link GetAccountSettingCommandInput}
* @returns {@link GetAccountSettingCommandOutput}
* @see {@link GetAccountSettingCommandInput} for command's `input` shape.
* @see {@link GetAccountSettingCommandOutput} for command's `response` shape.
* @see {@link ECRClientResolvedConfig | config} for ECRClient's `config` shape.
*
* @throws {@link InvalidParameterException} (client fault)
* <p>The specified parameter is invalid. Review the available parameters for the API
* request.</p>
*
* @throws {@link ServerException} (server fault)
* <p>These errors are usually caused by a server-side issue.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>There was an exception validating this request.</p>
*
* @throws {@link ECRServiceException}
* <p>Base exception class for all service exceptions from ECR service.</p>
*
* @public
*/
export class GetAccountSettingCommand extends $Command
.classBuilder<
GetAccountSettingCommandInput,
GetAccountSettingCommandOutput,
ECRClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: ECRClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AmazonEC2ContainerRegistry_V20150921", "GetAccountSetting", {})
.n("ECRClient", "GetAccountSettingCommand")
.f(void 0, void 0)
.ser(se_GetAccountSettingCommand)
.de(de_GetAccountSettingCommand)
.build() {}
100 changes: 100 additions & 0 deletions clients/client-ecr/src/commands/PutAccountSettingCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// 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 { ECRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECRClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { PutAccountSettingRequest, PutAccountSettingResponse } from "../models/models_0";
import { de_PutAccountSettingCommand, se_PutAccountSettingCommand } from "../protocols/Aws_json1_1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link PutAccountSettingCommand}.
*/
export interface PutAccountSettingCommandInput extends PutAccountSettingRequest {}
/**
* @public
*
* The output of {@link PutAccountSettingCommand}.
*/
export interface PutAccountSettingCommandOutput extends PutAccountSettingResponse, __MetadataBearer {}

/**
* <p>Allows you to change the basic scan type version by setting the <code>name</code>
* parameter to either <code>CLAIR</code> to <code>AWS_NATIVE</code>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ECRClient, PutAccountSettingCommand } from "@aws-sdk/client-ecr"; // ES Modules import
* // const { ECRClient, PutAccountSettingCommand } = require("@aws-sdk/client-ecr"); // CommonJS import
* const client = new ECRClient(config);
* const input = { // PutAccountSettingRequest
* name: "STRING_VALUE", // required
* value: "STRING_VALUE", // required
* };
* const command = new PutAccountSettingCommand(input);
* const response = await client.send(command);
* // { // PutAccountSettingResponse
* // name: "STRING_VALUE",
* // value: "STRING_VALUE",
* // };
*
* ```
*
* @param PutAccountSettingCommandInput - {@link PutAccountSettingCommandInput}
* @returns {@link PutAccountSettingCommandOutput}
* @see {@link PutAccountSettingCommandInput} for command's `input` shape.
* @see {@link PutAccountSettingCommandOutput} for command's `response` shape.
* @see {@link ECRClientResolvedConfig | config} for ECRClient's `config` shape.
*
* @throws {@link InvalidParameterException} (client fault)
* <p>The specified parameter is invalid. Review the available parameters for the API
* request.</p>
*
* @throws {@link LimitExceededException} (client fault)
* <p>The operation did not succeed because it would have exceeded a service limit for your
* account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html">Amazon ECR service quotas</a> in
* the Amazon Elastic Container Registry User Guide.</p>
*
* @throws {@link ServerException} (server fault)
* <p>These errors are usually caused by a server-side issue.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>There was an exception validating this request.</p>
*
* @throws {@link ECRServiceException}
* <p>Base exception class for all service exceptions from ECR service.</p>
*
* @public
*/
export class PutAccountSettingCommand extends $Command
.classBuilder<
PutAccountSettingCommandInput,
PutAccountSettingCommandOutput,
ECRClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: ECRClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AmazonEC2ContainerRegistry_V20150921", "PutAccountSetting", {})
.n("ECRClient", "PutAccountSettingCommand")
.f(void 0, void 0)
.ser(se_PutAccountSettingCommand)
.de(de_PutAccountSettingCommand)
.build() {}
2 changes: 2 additions & 0 deletions clients/client-ecr/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export * from "./DescribePullThroughCacheRulesCommand";
export * from "./DescribeRegistryCommand";
export * from "./DescribeRepositoriesCommand";
export * from "./DescribeRepositoryCreationTemplatesCommand";
export * from "./GetAccountSettingCommand";
export * from "./GetAuthorizationTokenCommand";
export * from "./GetDownloadUrlForLayerCommand";
export * from "./GetLifecyclePolicyCommand";
Expand All @@ -30,6 +31,7 @@ export * from "./GetRepositoryPolicyCommand";
export * from "./InitiateLayerUploadCommand";
export * from "./ListImagesCommand";
export * from "./ListTagsForResourceCommand";
export * from "./PutAccountSettingCommand";
export * from "./PutImageCommand";
export * from "./PutImageScanningConfigurationCommand";
export * from "./PutImageTagMutabilityCommand";
Expand Down
Loading

0 comments on commit 6da4252

Please sign in to comment.