Skip to content

Commit 6da4252

Browse files
author
awstools
committed
feat(client-ecr): Released two new APIs along with documentation updates. 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.
1 parent 80cb054 commit 6da4252

File tree

9 files changed

+562
-6
lines changed

9 files changed

+562
-6
lines changed

clients/client-ecr/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,14 @@ DescribeRepositoryCreationTemplates
379379

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

382+
</details>
383+
<details>
384+
<summary>
385+
GetAccountSetting
386+
</summary>
387+
388+
[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/)
389+
382390
</details>
383391
<details>
384392
<summary>
@@ -459,6 +467,14 @@ ListTagsForResource
459467

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

470+
</details>
471+
<details>
472+
<summary>
473+
PutAccountSetting
474+
</summary>
475+
476+
[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/)
477+
462478
</details>
463479
<details>
464480
<summary>

clients/client-ecr/src/ECR.ts

+46
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ import {
107107
DescribeRepositoryCreationTemplatesCommandInput,
108108
DescribeRepositoryCreationTemplatesCommandOutput,
109109
} from "./commands/DescribeRepositoryCreationTemplatesCommand";
110+
import {
111+
GetAccountSettingCommand,
112+
GetAccountSettingCommandInput,
113+
GetAccountSettingCommandOutput,
114+
} from "./commands/GetAccountSettingCommand";
110115
import {
111116
GetAuthorizationTokenCommand,
112117
GetAuthorizationTokenCommandInput,
@@ -153,6 +158,11 @@ import {
153158
ListTagsForResourceCommandInput,
154159
ListTagsForResourceCommandOutput,
155160
} from "./commands/ListTagsForResourceCommand";
161+
import {
162+
PutAccountSettingCommand,
163+
PutAccountSettingCommandInput,
164+
PutAccountSettingCommandOutput,
165+
} from "./commands/PutAccountSettingCommand";
156166
import { PutImageCommand, PutImageCommandInput, PutImageCommandOutput } from "./commands/PutImageCommand";
157167
import {
158168
PutImageScanningConfigurationCommand,
@@ -249,6 +259,7 @@ const commands = {
249259
DescribeRegistryCommand,
250260
DescribeRepositoriesCommand,
251261
DescribeRepositoryCreationTemplatesCommand,
262+
GetAccountSettingCommand,
252263
GetAuthorizationTokenCommand,
253264
GetDownloadUrlForLayerCommand,
254265
GetLifecyclePolicyCommand,
@@ -259,6 +270,7 @@ const commands = {
259270
InitiateLayerUploadCommand,
260271
ListImagesCommand,
261272
ListTagsForResourceCommand,
273+
PutAccountSettingCommand,
262274
PutImageCommand,
263275
PutImageScanningConfigurationCommand,
264276
PutImageTagMutabilityCommand,
@@ -631,6 +643,23 @@ export interface ECR {
631643
cb: (err: any, data?: DescribeRepositoryCreationTemplatesCommandOutput) => void
632644
): void;
633645

646+
/**
647+
* @see {@link GetAccountSettingCommand}
648+
*/
649+
getAccountSetting(
650+
args: GetAccountSettingCommandInput,
651+
options?: __HttpHandlerOptions
652+
): Promise<GetAccountSettingCommandOutput>;
653+
getAccountSetting(
654+
args: GetAccountSettingCommandInput,
655+
cb: (err: any, data?: GetAccountSettingCommandOutput) => void
656+
): void;
657+
getAccountSetting(
658+
args: GetAccountSettingCommandInput,
659+
options: __HttpHandlerOptions,
660+
cb: (err: any, data?: GetAccountSettingCommandOutput) => void
661+
): void;
662+
634663
/**
635664
* @see {@link GetAuthorizationTokenCommand}
636665
*/
@@ -798,6 +827,23 @@ export interface ECR {
798827
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
799828
): void;
800829

830+
/**
831+
* @see {@link PutAccountSettingCommand}
832+
*/
833+
putAccountSetting(
834+
args: PutAccountSettingCommandInput,
835+
options?: __HttpHandlerOptions
836+
): Promise<PutAccountSettingCommandOutput>;
837+
putAccountSetting(
838+
args: PutAccountSettingCommandInput,
839+
cb: (err: any, data?: PutAccountSettingCommandOutput) => void
840+
): void;
841+
putAccountSetting(
842+
args: PutAccountSettingCommandInput,
843+
options: __HttpHandlerOptions,
844+
cb: (err: any, data?: PutAccountSettingCommandOutput) => void
845+
): void;
846+
801847
/**
802848
* @see {@link PutImageCommand}
803849
*/

clients/client-ecr/src/ECRClient.ts

+6
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ import {
119119
DescribeRepositoryCreationTemplatesCommandInput,
120120
DescribeRepositoryCreationTemplatesCommandOutput,
121121
} from "./commands/DescribeRepositoryCreationTemplatesCommand";
122+
import { GetAccountSettingCommandInput, GetAccountSettingCommandOutput } from "./commands/GetAccountSettingCommand";
122123
import {
123124
GetAuthorizationTokenCommandInput,
124125
GetAuthorizationTokenCommandOutput,
@@ -150,6 +151,7 @@ import {
150151
ListTagsForResourceCommandInput,
151152
ListTagsForResourceCommandOutput,
152153
} from "./commands/ListTagsForResourceCommand";
154+
import { PutAccountSettingCommandInput, PutAccountSettingCommandOutput } from "./commands/PutAccountSettingCommand";
153155
import { PutImageCommandInput, PutImageCommandOutput } from "./commands/PutImageCommand";
154156
import {
155157
PutImageScanningConfigurationCommandInput,
@@ -229,6 +231,7 @@ export type ServiceInputTypes =
229231
| DescribeRegistryCommandInput
230232
| DescribeRepositoriesCommandInput
231233
| DescribeRepositoryCreationTemplatesCommandInput
234+
| GetAccountSettingCommandInput
232235
| GetAuthorizationTokenCommandInput
233236
| GetDownloadUrlForLayerCommandInput
234237
| GetLifecyclePolicyCommandInput
@@ -239,6 +242,7 @@ export type ServiceInputTypes =
239242
| InitiateLayerUploadCommandInput
240243
| ListImagesCommandInput
241244
| ListTagsForResourceCommandInput
245+
| PutAccountSettingCommandInput
242246
| PutImageCommandInput
243247
| PutImageScanningConfigurationCommandInput
244248
| PutImageTagMutabilityCommandInput
@@ -281,6 +285,7 @@ export type ServiceOutputTypes =
281285
| DescribeRegistryCommandOutput
282286
| DescribeRepositoriesCommandOutput
283287
| DescribeRepositoryCreationTemplatesCommandOutput
288+
| GetAccountSettingCommandOutput
284289
| GetAuthorizationTokenCommandOutput
285290
| GetDownloadUrlForLayerCommandOutput
286291
| GetLifecyclePolicyCommandOutput
@@ -291,6 +296,7 @@ export type ServiceOutputTypes =
291296
| InitiateLayerUploadCommandOutput
292297
| ListImagesCommandOutput
293298
| ListTagsForResourceCommandOutput
299+
| PutAccountSettingCommandOutput
294300
| PutImageCommandOutput
295301
| PutImageScanningConfigurationCommandOutput
296302
| PutImageTagMutabilityCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { ECRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECRClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { GetAccountSettingRequest, GetAccountSettingResponse } from "../models/models_0";
10+
import { de_GetAccountSettingCommand, se_GetAccountSettingCommand } from "../protocols/Aws_json1_1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link GetAccountSettingCommand}.
21+
*/
22+
export interface GetAccountSettingCommandInput extends GetAccountSettingRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link GetAccountSettingCommand}.
27+
*/
28+
export interface GetAccountSettingCommandOutput extends GetAccountSettingResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Retrieves the basic scan type version name.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { ECRClient, GetAccountSettingCommand } from "@aws-sdk/client-ecr"; // ES Modules import
36+
* // const { ECRClient, GetAccountSettingCommand } = require("@aws-sdk/client-ecr"); // CommonJS import
37+
* const client = new ECRClient(config);
38+
* const input = { // GetAccountSettingRequest
39+
* name: "STRING_VALUE", // required
40+
* };
41+
* const command = new GetAccountSettingCommand(input);
42+
* const response = await client.send(command);
43+
* // { // GetAccountSettingResponse
44+
* // name: "STRING_VALUE",
45+
* // value: "STRING_VALUE",
46+
* // };
47+
*
48+
* ```
49+
*
50+
* @param GetAccountSettingCommandInput - {@link GetAccountSettingCommandInput}
51+
* @returns {@link GetAccountSettingCommandOutput}
52+
* @see {@link GetAccountSettingCommandInput} for command's `input` shape.
53+
* @see {@link GetAccountSettingCommandOutput} for command's `response` shape.
54+
* @see {@link ECRClientResolvedConfig | config} for ECRClient's `config` shape.
55+
*
56+
* @throws {@link InvalidParameterException} (client fault)
57+
* <p>The specified parameter is invalid. Review the available parameters for the API
58+
* request.</p>
59+
*
60+
* @throws {@link ServerException} (server fault)
61+
* <p>These errors are usually caused by a server-side issue.</p>
62+
*
63+
* @throws {@link ValidationException} (client fault)
64+
* <p>There was an exception validating this request.</p>
65+
*
66+
* @throws {@link ECRServiceException}
67+
* <p>Base exception class for all service exceptions from ECR service.</p>
68+
*
69+
* @public
70+
*/
71+
export class GetAccountSettingCommand extends $Command
72+
.classBuilder<
73+
GetAccountSettingCommandInput,
74+
GetAccountSettingCommandOutput,
75+
ECRClientResolvedConfig,
76+
ServiceInputTypes,
77+
ServiceOutputTypes
78+
>()
79+
.ep({
80+
...commonParams,
81+
})
82+
.m(function (this: any, Command: any, cs: any, config: ECRClientResolvedConfig, o: any) {
83+
return [
84+
getSerdePlugin(config, this.serialize, this.deserialize),
85+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
86+
];
87+
})
88+
.s("AmazonEC2ContainerRegistry_V20150921", "GetAccountSetting", {})
89+
.n("ECRClient", "GetAccountSettingCommand")
90+
.f(void 0, void 0)
91+
.ser(se_GetAccountSettingCommand)
92+
.de(de_GetAccountSettingCommand)
93+
.build() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { ECRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECRClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { PutAccountSettingRequest, PutAccountSettingResponse } from "../models/models_0";
10+
import { de_PutAccountSettingCommand, se_PutAccountSettingCommand } from "../protocols/Aws_json1_1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link PutAccountSettingCommand}.
21+
*/
22+
export interface PutAccountSettingCommandInput extends PutAccountSettingRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link PutAccountSettingCommand}.
27+
*/
28+
export interface PutAccountSettingCommandOutput extends PutAccountSettingResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Allows you to change the basic scan type version by setting the <code>name</code>
32+
* parameter to either <code>CLAIR</code> to <code>AWS_NATIVE</code>.</p>
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { ECRClient, PutAccountSettingCommand } from "@aws-sdk/client-ecr"; // ES Modules import
37+
* // const { ECRClient, PutAccountSettingCommand } = require("@aws-sdk/client-ecr"); // CommonJS import
38+
* const client = new ECRClient(config);
39+
* const input = { // PutAccountSettingRequest
40+
* name: "STRING_VALUE", // required
41+
* value: "STRING_VALUE", // required
42+
* };
43+
* const command = new PutAccountSettingCommand(input);
44+
* const response = await client.send(command);
45+
* // { // PutAccountSettingResponse
46+
* // name: "STRING_VALUE",
47+
* // value: "STRING_VALUE",
48+
* // };
49+
*
50+
* ```
51+
*
52+
* @param PutAccountSettingCommandInput - {@link PutAccountSettingCommandInput}
53+
* @returns {@link PutAccountSettingCommandOutput}
54+
* @see {@link PutAccountSettingCommandInput} for command's `input` shape.
55+
* @see {@link PutAccountSettingCommandOutput} for command's `response` shape.
56+
* @see {@link ECRClientResolvedConfig | config} for ECRClient's `config` shape.
57+
*
58+
* @throws {@link InvalidParameterException} (client fault)
59+
* <p>The specified parameter is invalid. Review the available parameters for the API
60+
* request.</p>
61+
*
62+
* @throws {@link LimitExceededException} (client fault)
63+
* <p>The operation did not succeed because it would have exceeded a service limit for your
64+
* account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html">Amazon ECR service quotas</a> in
65+
* the Amazon Elastic Container Registry User Guide.</p>
66+
*
67+
* @throws {@link ServerException} (server fault)
68+
* <p>These errors are usually caused by a server-side issue.</p>
69+
*
70+
* @throws {@link ValidationException} (client fault)
71+
* <p>There was an exception validating this request.</p>
72+
*
73+
* @throws {@link ECRServiceException}
74+
* <p>Base exception class for all service exceptions from ECR service.</p>
75+
*
76+
* @public
77+
*/
78+
export class PutAccountSettingCommand extends $Command
79+
.classBuilder<
80+
PutAccountSettingCommandInput,
81+
PutAccountSettingCommandOutput,
82+
ECRClientResolvedConfig,
83+
ServiceInputTypes,
84+
ServiceOutputTypes
85+
>()
86+
.ep({
87+
...commonParams,
88+
})
89+
.m(function (this: any, Command: any, cs: any, config: ECRClientResolvedConfig, o: any) {
90+
return [
91+
getSerdePlugin(config, this.serialize, this.deserialize),
92+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
93+
];
94+
})
95+
.s("AmazonEC2ContainerRegistry_V20150921", "PutAccountSetting", {})
96+
.n("ECRClient", "PutAccountSettingCommand")
97+
.f(void 0, void 0)
98+
.ser(se_PutAccountSettingCommand)
99+
.de(de_PutAccountSettingCommand)
100+
.build() {}

clients/client-ecr/src/commands/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export * from "./DescribePullThroughCacheRulesCommand";
2020
export * from "./DescribeRegistryCommand";
2121
export * from "./DescribeRepositoriesCommand";
2222
export * from "./DescribeRepositoryCreationTemplatesCommand";
23+
export * from "./GetAccountSettingCommand";
2324
export * from "./GetAuthorizationTokenCommand";
2425
export * from "./GetDownloadUrlForLayerCommand";
2526
export * from "./GetLifecyclePolicyCommand";
@@ -30,6 +31,7 @@ export * from "./GetRepositoryPolicyCommand";
3031
export * from "./InitiateLayerUploadCommand";
3132
export * from "./ListImagesCommand";
3233
export * from "./ListTagsForResourceCommand";
34+
export * from "./PutAccountSettingCommand";
3335
export * from "./PutImageCommand";
3436
export * from "./PutImageScanningConfigurationCommand";
3537
export * from "./PutImageTagMutabilityCommand";

0 commit comments

Comments
 (0)