Skip to content

Commit 3bfec92

Browse files
author
awstools
committed
feat(client-inspector2): This release adds GetClustersForImage API and filter updates as part of the mapping of container images to running containers feature.
1 parent b522468 commit 3bfec92

26 files changed

+1608
-355
lines changed

clients/client-inspector2/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,14 @@ GetCisScanResultDetails
387387

388388
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/inspector2/command/GetCisScanResultDetailsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-inspector2/Interface/GetCisScanResultDetailsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-inspector2/Interface/GetCisScanResultDetailsCommandOutput/)
389389

390+
</details>
391+
<details>
392+
<summary>
393+
GetClustersForImage
394+
</summary>
395+
396+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/inspector2/command/GetClustersForImageCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-inspector2/Interface/GetClustersForImageCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-inspector2/Interface/GetClustersForImageCommandOutput/)
397+
390398
</details>
391399
<details>
392400
<summary>

clients/client-inspector2/src/Inspector2.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ import {
109109
GetCisScanResultDetailsCommandInput,
110110
GetCisScanResultDetailsCommandOutput,
111111
} from "./commands/GetCisScanResultDetailsCommand";
112+
import {
113+
GetClustersForImageCommand,
114+
GetClustersForImageCommandInput,
115+
GetClustersForImageCommandOutput,
116+
} from "./commands/GetClustersForImageCommand";
112117
import {
113118
GetConfigurationCommand,
114119
GetConfigurationCommandInput,
@@ -299,6 +304,7 @@ const commands = {
299304
EnableDelegatedAdminAccountCommand,
300305
GetCisScanReportCommand,
301306
GetCisScanResultDetailsCommand,
307+
GetClustersForImageCommand,
302308
GetConfigurationCommand,
303309
GetDelegatedAdminAccountCommand,
304310
GetEc2DeepInspectionConfigurationCommand,
@@ -706,6 +712,23 @@ export interface Inspector2 {
706712
cb: (err: any, data?: GetCisScanResultDetailsCommandOutput) => void
707713
): void;
708714

715+
/**
716+
* @see {@link GetClustersForImageCommand}
717+
*/
718+
getClustersForImage(
719+
args: GetClustersForImageCommandInput,
720+
options?: __HttpHandlerOptions
721+
): Promise<GetClustersForImageCommandOutput>;
722+
getClustersForImage(
723+
args: GetClustersForImageCommandInput,
724+
cb: (err: any, data?: GetClustersForImageCommandOutput) => void
725+
): void;
726+
getClustersForImage(
727+
args: GetClustersForImageCommandInput,
728+
options: __HttpHandlerOptions,
729+
cb: (err: any, data?: GetClustersForImageCommandOutput) => void
730+
): void;
731+
709732
/**
710733
* @see {@link GetConfigurationCommand}
711734
*/

clients/client-inspector2/src/Inspector2Client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ import {
118118
GetCisScanResultDetailsCommandInput,
119119
GetCisScanResultDetailsCommandOutput,
120120
} from "./commands/GetCisScanResultDetailsCommand";
121+
import {
122+
GetClustersForImageCommandInput,
123+
GetClustersForImageCommandOutput,
124+
} from "./commands/GetClustersForImageCommand";
121125
import { GetConfigurationCommandInput, GetConfigurationCommandOutput } from "./commands/GetConfigurationCommand";
122126
import {
123127
GetDelegatedAdminAccountCommandInput,
@@ -252,6 +256,7 @@ export type ServiceInputTypes =
252256
| EnableDelegatedAdminAccountCommandInput
253257
| GetCisScanReportCommandInput
254258
| GetCisScanResultDetailsCommandInput
259+
| GetClustersForImageCommandInput
255260
| GetConfigurationCommandInput
256261
| GetDelegatedAdminAccountCommandInput
257262
| GetEc2DeepInspectionConfigurationCommandInput
@@ -316,6 +321,7 @@ export type ServiceOutputTypes =
316321
| EnableDelegatedAdminAccountCommandOutput
317322
| GetCisScanReportCommandOutput
318323
| GetCisScanResultDetailsCommandOutput
324+
| GetClustersForImageCommandOutput
319325
| GetConfigurationCommandOutput
320326
| GetDelegatedAdminAccountCommandOutput
321327
| GetEc2DeepInspectionConfigurationCommandOutput

clients/client-inspector2/src/commands/CreateFilterCommand.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ export interface CreateFilterCommandOutput extends CreateFilterResponse, __Metad
117117
* ecrImageRepositoryName: "<StringFilterList>",
118118
* ecrImageTags: "<StringFilterList>",
119119
* ecrImageHash: "<StringFilterList>",
120+
* ecrImageLastInUseAt: [
121+
* {
122+
* startInclusive: new Date("TIMESTAMP"),
123+
* endInclusive: new Date("TIMESTAMP"),
124+
* },
125+
* ],
126+
* ecrImageInUseCount: [
127+
* {
128+
* upperInclusive: Number("double"),
129+
* lowerInclusive: Number("double"),
130+
* },
131+
* ],
120132
* portRange: [ // PortRangeFilterList
121133
* { // PortRangeFilter
122134
* beginInclusive: Number("int"),
@@ -149,12 +161,7 @@ export interface CreateFilterCommandOutput extends CreateFilterResponse, __Metad
149161
* lambdaFunctionName: "<StringFilterList>",
150162
* lambdaFunctionLayers: "<StringFilterList>",
151163
* lambdaFunctionRuntime: "<StringFilterList>",
152-
* lambdaFunctionLastModifiedAt: [
153-
* {
154-
* startInclusive: new Date("TIMESTAMP"),
155-
* endInclusive: new Date("TIMESTAMP"),
156-
* },
157-
* ],
164+
* lambdaFunctionLastModifiedAt: "<DateFilterList>",
158165
* lambdaFunctionExecutionRoleArn: "<StringFilterList>",
159166
* exploitAvailable: "<StringFilterList>",
160167
* codeVulnerabilityDetectorName: "<StringFilterList>",

clients/client-inspector2/src/commands/CreateFindingsReportCommand.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@ export interface CreateFindingsReportCommandOutput extends CreateFindingsReportR
115115
* ecrImageRepositoryName: "<StringFilterList>",
116116
* ecrImageTags: "<StringFilterList>",
117117
* ecrImageHash: "<StringFilterList>",
118+
* ecrImageLastInUseAt: [
119+
* {
120+
* startInclusive: new Date("TIMESTAMP"),
121+
* endInclusive: new Date("TIMESTAMP"),
122+
* },
123+
* ],
124+
* ecrImageInUseCount: [
125+
* {
126+
* upperInclusive: Number("double"),
127+
* lowerInclusive: Number("double"),
128+
* },
129+
* ],
118130
* portRange: [ // PortRangeFilterList
119131
* { // PortRangeFilter
120132
* beginInclusive: Number("int"),
@@ -147,12 +159,7 @@ export interface CreateFindingsReportCommandOutput extends CreateFindingsReportR
147159
* lambdaFunctionName: "<StringFilterList>",
148160
* lambdaFunctionLayers: "<StringFilterList>",
149161
* lambdaFunctionRuntime: "<StringFilterList>",
150-
* lambdaFunctionLastModifiedAt: [
151-
* {
152-
* startInclusive: new Date("TIMESTAMP"),
153-
* endInclusive: new Date("TIMESTAMP"),
154-
* },
155-
* ],
162+
* lambdaFunctionLastModifiedAt: "<DateFilterList>",
156163
* lambdaFunctionExecutionRoleArn: "<StringFilterList>",
157164
* exploitAvailable: "<StringFilterList>",
158165
* codeVulnerabilityDetectorName: "<StringFilterList>",
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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 { commonParams } from "../endpoint/EndpointParameters";
8+
import { Inspector2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Inspector2Client";
9+
import { GetClustersForImageRequest, GetClustersForImageResponse } from "../models/models_0";
10+
import { de_GetClustersForImageCommand, se_GetClustersForImageCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link GetClustersForImageCommand}.
21+
*/
22+
export interface GetClustersForImageCommandInput extends GetClustersForImageRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link GetClustersForImageCommand}.
27+
*/
28+
export interface GetClustersForImageCommandOutput extends GetClustersForImageResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns a list of clusters and metadata associated with an image.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { Inspector2Client, GetClustersForImageCommand } from "@aws-sdk/client-inspector2"; // ES Modules import
36+
* // const { Inspector2Client, GetClustersForImageCommand } = require("@aws-sdk/client-inspector2"); // CommonJS import
37+
* const client = new Inspector2Client(config);
38+
* const input = { // GetClustersForImageRequest
39+
* filter: { // ClusterForImageFilterCriteria
40+
* resourceId: "STRING_VALUE", // required
41+
* },
42+
* maxResults: Number("int"),
43+
* nextToken: "STRING_VALUE",
44+
* };
45+
* const command = new GetClustersForImageCommand(input);
46+
* const response = await client.send(command);
47+
* // { // GetClustersForImageResponse
48+
* // cluster: [ // ClusterInformationList // required
49+
* // { // ClusterInformation
50+
* // clusterArn: "STRING_VALUE", // required
51+
* // clusterDetails: [ // ClusterDetailsList
52+
* // { // ClusterDetails
53+
* // lastInUse: new Date("TIMESTAMP"), // required
54+
* // runningUnitCount: Number("long"),
55+
* // stoppedUnitCount: Number("long"),
56+
* // clusterMetadata: { // ClusterMetadata Union: only one key present
57+
* // awsEcsMetadataDetails: { // AwsEcsMetadataDetails
58+
* // detailsGroup: "STRING_VALUE", // required
59+
* // taskDefinitionArn: "STRING_VALUE", // required
60+
* // },
61+
* // awsEksMetadataDetails: { // AwsEksMetadataDetails
62+
* // namespace: "STRING_VALUE",
63+
* // workloadInfoList: [ // AwsEksWorkloadInfoList
64+
* // { // AwsEksWorkloadInfo
65+
* // name: "STRING_VALUE", // required
66+
* // type: "STRING_VALUE", // required
67+
* // },
68+
* // ],
69+
* // },
70+
* // },
71+
* // },
72+
* // ],
73+
* // },
74+
* // ],
75+
* // nextToken: "STRING_VALUE",
76+
* // };
77+
*
78+
* ```
79+
*
80+
* @param GetClustersForImageCommandInput - {@link GetClustersForImageCommandInput}
81+
* @returns {@link GetClustersForImageCommandOutput}
82+
* @see {@link GetClustersForImageCommandInput} for command's `input` shape.
83+
* @see {@link GetClustersForImageCommandOutput} for command's `response` shape.
84+
* @see {@link Inspector2ClientResolvedConfig | config} for Inspector2Client's `config` shape.
85+
*
86+
* @throws {@link AccessDeniedException} (client fault)
87+
* <p>You do not have sufficient access to perform this action.</p>
88+
*
89+
* @throws {@link InternalServerException} (server fault)
90+
* <p>The request has failed due to an internal failure of the Amazon Inspector service.</p>
91+
*
92+
* @throws {@link ThrottlingException} (client fault)
93+
* <p>The limit on the number of requests per second was exceeded.</p>
94+
*
95+
* @throws {@link ValidationException} (client fault)
96+
* <p>The request has failed validation due to missing required fields or having invalid
97+
* inputs.</p>
98+
*
99+
* @throws {@link Inspector2ServiceException}
100+
* <p>Base exception class for all service exceptions from Inspector2 service.</p>
101+
*
102+
*
103+
* @public
104+
*/
105+
export class GetClustersForImageCommand extends $Command
106+
.classBuilder<
107+
GetClustersForImageCommandInput,
108+
GetClustersForImageCommandOutput,
109+
Inspector2ClientResolvedConfig,
110+
ServiceInputTypes,
111+
ServiceOutputTypes
112+
>()
113+
.ep(commonParams)
114+
.m(function (this: any, Command: any, cs: any, config: Inspector2ClientResolvedConfig, o: any) {
115+
return [
116+
getSerdePlugin(config, this.serialize, this.deserialize),
117+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
118+
];
119+
})
120+
.s("Inspector2", "GetClustersForImage", {})
121+
.n("Inspector2Client", "GetClustersForImageCommand")
122+
.f(void 0, void 0)
123+
.ser(se_GetClustersForImageCommand)
124+
.de(de_GetClustersForImageCommand)
125+
.build() {
126+
/** @internal type navigation helper, not in runtime. */
127+
protected declare static __types: {
128+
api: {
129+
input: GetClustersForImageRequest;
130+
output: GetClustersForImageResponse;
131+
};
132+
sdk: {
133+
input: GetClustersForImageCommandInput;
134+
output: GetClustersForImageCommandOutput;
135+
};
136+
};
137+
}

clients/client-inspector2/src/commands/GetConfigurationCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export interface GetConfigurationCommandOutput extends GetConfigurationResponse,
4545
* // status: "STRING_VALUE",
4646
* // updatedAt: new Date("TIMESTAMP"),
4747
* // pullDateRescanDuration: "STRING_VALUE",
48+
* // pullDateRescanMode: "STRING_VALUE",
4849
* // },
4950
* // },
5051
* // ec2Configuration: { // Ec2ConfigurationState

clients/client-inspector2/src/commands/GetFindingsReportStatusCommand.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@ export interface GetFindingsReportStatusCommandOutput extends GetFindingsReportS
129129
* // ecrImageRepositoryName: "<StringFilterList>",
130130
* // ecrImageTags: "<StringFilterList>",
131131
* // ecrImageHash: "<StringFilterList>",
132+
* // ecrImageLastInUseAt: [
133+
* // {
134+
* // startInclusive: new Date("TIMESTAMP"),
135+
* // endInclusive: new Date("TIMESTAMP"),
136+
* // },
137+
* // ],
138+
* // ecrImageInUseCount: [
139+
* // {
140+
* // upperInclusive: Number("double"),
141+
* // lowerInclusive: Number("double"),
142+
* // },
143+
* // ],
132144
* // portRange: [ // PortRangeFilterList
133145
* // { // PortRangeFilter
134146
* // beginInclusive: Number("int"),
@@ -161,12 +173,7 @@ export interface GetFindingsReportStatusCommandOutput extends GetFindingsReportS
161173
* // lambdaFunctionName: "<StringFilterList>",
162174
* // lambdaFunctionLayers: "<StringFilterList>",
163175
* // lambdaFunctionRuntime: "<StringFilterList>",
164-
* // lambdaFunctionLastModifiedAt: [
165-
* // {
166-
* // startInclusive: new Date("TIMESTAMP"),
167-
* // endInclusive: new Date("TIMESTAMP"),
168-
* // },
169-
* // ],
176+
* // lambdaFunctionLastModifiedAt: "<DateFilterList>",
170177
* // lambdaFunctionExecutionRoleArn: "<StringFilterList>",
171178
* // exploitAvailable: "<StringFilterList>",
172179
* // codeVulnerabilityDetectorName: "<StringFilterList>",

clients/client-inspector2/src/commands/GetSbomExportCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { Inspector2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Inspector2Client";
9-
import { GetSbomExportRequest, GetSbomExportResponse } from "../models/models_0";
9+
import { GetSbomExportRequest } from "../models/models_0";
10+
import { GetSbomExportResponse } from "../models/models_1";
1011
import { de_GetSbomExportCommand, se_GetSbomExportCommand } from "../protocols/Aws_restJson1";
1112

1213
/**

clients/client-inspector2/src/commands/ListAccountPermissionsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { Inspector2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Inspector2Client";
9-
import { ListAccountPermissionsRequest, ListAccountPermissionsResponse } from "../models/models_0";
9+
import { ListAccountPermissionsRequest, ListAccountPermissionsResponse } from "../models/models_1";
1010
import { de_ListAccountPermissionsCommand, se_ListAccountPermissionsCommand } from "../protocols/Aws_restJson1";
1111

1212
/**

clients/client-inspector2/src/commands/ListCisScanConfigurationsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { Inspector2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Inspector2Client";
9-
import { ListCisScanConfigurationsRequest, ListCisScanConfigurationsResponse } from "../models/models_0";
9+
import { ListCisScanConfigurationsRequest, ListCisScanConfigurationsResponse } from "../models/models_1";
1010
import { de_ListCisScanConfigurationsCommand, se_ListCisScanConfigurationsCommand } from "../protocols/Aws_restJson1";
1111

1212
/**

clients/client-inspector2/src/commands/ListCisScanResultsAggregatedByChecksCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Inspector2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes }
99
import {
1010
ListCisScanResultsAggregatedByChecksRequest,
1111
ListCisScanResultsAggregatedByChecksResponse,
12-
} from "../models/models_0";
12+
} from "../models/models_1";
1313
import {
1414
de_ListCisScanResultsAggregatedByChecksCommand,
1515
se_ListCisScanResultsAggregatedByChecksCommand,

clients/client-inspector2/src/commands/ListCoverageCommand.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ export interface ListCoverageCommandOutput extends ListCoverageResponse, __Metad
101101
* endInclusive: new Date("TIMESTAMP"),
102102
* },
103103
* ],
104+
* ecrImageLastInUseAt: [
105+
* {
106+
* startInclusive: new Date("TIMESTAMP"),
107+
* endInclusive: new Date("TIMESTAMP"),
108+
* },
109+
* ],
110+
* ecrImageInUseCount: [ // CoverageNumberFilterList
111+
* { // CoverageNumberFilter
112+
* upperInclusive: Number("long"),
113+
* lowerInclusive: Number("long"),
114+
* },
115+
* ],
104116
* },
105117
* };
106118
* const command = new ListCoverageCommand(input);
@@ -127,6 +139,8 @@ export interface ListCoverageCommandOutput extends ListCoverageResponse, __Metad
127139
* // "STRING_VALUE",
128140
* // ],
129141
* // imagePulledAt: new Date("TIMESTAMP"),
142+
* // lastInUseAt: new Date("TIMESTAMP"),
143+
* // inUseCount: Number("long"),
130144
* // },
131145
* // ec2: { // Ec2Metadata
132146
* // tags: { // TagMap

0 commit comments

Comments
 (0)