Skip to content

Commit 79fb03b

Browse files
author
awstools
committed
feat(client-inspector2): This release adds CSV format to GetCisScanReport for Inspector v2
1 parent 9dac593 commit 79fb03b

File tree

6 files changed

+107
-46
lines changed

6 files changed

+107
-46
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export interface GetCisScanReportCommandOutput extends GetCisScanReportResponse,
3939
* targetAccounts: [ // ReportTargetAccounts
4040
* "STRING_VALUE",
4141
* ],
42+
* reportFormat: "PDF" || "CSV",
4243
* };
4344
* const command = new GetCisScanReportCommand(input);
4445
* const response = await client.send(command);
@@ -61,6 +62,9 @@ export interface GetCisScanReportCommandOutput extends GetCisScanReportResponse,
6162
* @throws {@link InternalServerException} (server fault)
6263
* <p>The request has failed due to an internal failure of the Amazon Inspector service.</p>
6364
*
65+
* @throws {@link ResourceNotFoundException} (client fault)
66+
* <p>The operation tried to access an invalid resource. Make sure the resource is specified correctly.</p>
67+
*
6468
* @throws {@link ThrottlingException} (client fault)
6569
* <p>The limit on the number of requests per second was exceeded.</p>
6670
*

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { Inspector2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Inspector2Client";
9-
import { ListCisScanResultsAggregatedByTargetResourceRequest } from "../models/models_0";
10-
import { ListCisScanResultsAggregatedByTargetResourceResponse } from "../models/models_1";
9+
import {
10+
ListCisScanResultsAggregatedByTargetResourceRequest,
11+
ListCisScanResultsAggregatedByTargetResourceResponse,
12+
} from "../models/models_1";
1113
import {
1214
de_ListCisScanResultsAggregatedByTargetResourceCommand,
1315
se_ListCisScanResultsAggregatedByTargetResourceCommand,

clients/client-inspector2/src/models/models_0.ts

+25-42
Original file line numberDiff line numberDiff line change
@@ -3328,6 +3328,20 @@ export interface CisNumberFilter {
33283328
lowerInclusive?: number;
33293329
}
33303330

3331+
/**
3332+
* @public
3333+
* @enum
3334+
*/
3335+
export const CisReportFormat = {
3336+
CSV: "CSV",
3337+
PDF: "PDF",
3338+
} as const;
3339+
3340+
/**
3341+
* @public
3342+
*/
3343+
export type CisReportFormat = (typeof CisReportFormat)[keyof typeof CisReportFormat];
3344+
33313345
/**
33323346
* @public
33333347
* @enum
@@ -7144,6 +7158,16 @@ export interface GetCisScanReportRequest {
71447158
* @public
71457159
*/
71467160
targetAccounts?: string[];
7161+
7162+
/**
7163+
* <p>
7164+
* The format of the report.
7165+
* Valid values are <code>PDF</code> and <code>CSV</code>.
7166+
* If no value is specified, the report format defaults to <code>PDF</code>.
7167+
* </p>
7168+
* @public
7169+
*/
7170+
reportFormat?: CisReportFormat;
71477171
}
71487172

71497173
/**
@@ -7152,7 +7176,7 @@ export interface GetCisScanReportRequest {
71527176
export interface GetCisScanReportResponse {
71537177
/**
71547178
* <p>
7155-
* The URL where a PDF of the CIS scan report can be downloaded.
7179+
* The URL where a PDF or CSV of the CIS scan report can be downloaded.
71567180
* </p>
71577181
* @public
71587182
*/
@@ -7740,44 +7764,3 @@ export interface ListCisScanResultsAggregatedByChecksResponse {
77407764
*/
77417765
nextToken?: string;
77427766
}
7743-
7744-
/**
7745-
* @public
7746-
*/
7747-
export interface ListCisScanResultsAggregatedByTargetResourceRequest {
7748-
/**
7749-
* <p>The scan ARN.</p>
7750-
* @public
7751-
*/
7752-
scanArn: string | undefined;
7753-
7754-
/**
7755-
* <p>The filter criteria.</p>
7756-
* @public
7757-
*/
7758-
filterCriteria?: CisScanResultsAggregatedByTargetResourceFilterCriteria;
7759-
7760-
/**
7761-
* <p>The sort by order.</p>
7762-
* @public
7763-
*/
7764-
sortBy?: CisScanResultsAggregatedByTargetResourceSortBy;
7765-
7766-
/**
7767-
* <p>The sort order.</p>
7768-
* @public
7769-
*/
7770-
sortOrder?: CisSortOrder;
7771-
7772-
/**
7773-
* <p>The pagination token from a previous request that's used to retrieve the next page of results.</p>
7774-
* @public
7775-
*/
7776-
nextToken?: string;
7777-
7778-
/**
7779-
* <p>The maximum number of scan results aggregated by a target resource to be returned in a single page of results.</p>
7780-
* @public
7781-
*/
7782-
maxResults?: number;
7783-
}

clients/client-inspector2/src/models/models_1.ts

+43
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
CisDateFilter,
1010
CisNumberFilter,
1111
CisScan,
12+
CisScanResultsAggregatedByTargetResourceFilterCriteria,
13+
CisScanResultsAggregatedByTargetResourceSortBy,
1214
CisScanStatusFilter,
1315
CisSecurityLevel,
1416
CisSessionMessage,
@@ -42,6 +44,47 @@ import {
4244
TagFilter,
4345
} from "./models_0";
4446

47+
/**
48+
* @public
49+
*/
50+
export interface ListCisScanResultsAggregatedByTargetResourceRequest {
51+
/**
52+
* <p>The scan ARN.</p>
53+
* @public
54+
*/
55+
scanArn: string | undefined;
56+
57+
/**
58+
* <p>The filter criteria.</p>
59+
* @public
60+
*/
61+
filterCriteria?: CisScanResultsAggregatedByTargetResourceFilterCriteria;
62+
63+
/**
64+
* <p>The sort by order.</p>
65+
* @public
66+
*/
67+
sortBy?: CisScanResultsAggregatedByTargetResourceSortBy;
68+
69+
/**
70+
* <p>The sort order.</p>
71+
* @public
72+
*/
73+
sortOrder?: CisSortOrder;
74+
75+
/**
76+
* <p>The pagination token from a previous request that's used to retrieve the next page of results.</p>
77+
* @public
78+
*/
79+
nextToken?: string;
80+
81+
/**
82+
* <p>The maximum number of scan results aggregated by a target resource to be returned in a single page of results.</p>
83+
* @public
84+
*/
85+
maxResults?: number;
86+
}
87+
4588
/**
4689
* @public
4790
*/

clients/client-inspector2/src/protocols/Aws_restJson1.ts

+1
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ export const se_GetCisScanReportCommand = async (
794794
let body: any;
795795
body = JSON.stringify(
796796
take(input, {
797+
reportFormat: [],
797798
scanArn: [],
798799
targetAccounts: (_) => _json(_),
799800
})

codegen/sdk-codegen/aws-models/inspector2.json

+30-2
Original file line numberDiff line numberDiff line change
@@ -1860,6 +1860,23 @@
18601860
"smithy.api#pattern": "^\\d{12}|o-[a-z0-9]{10,32}$"
18611861
}
18621862
},
1863+
"com.amazonaws.inspector2#CisReportFormat": {
1864+
"type": "enum",
1865+
"members": {
1866+
"PDF": {
1867+
"target": "smithy.api#Unit",
1868+
"traits": {
1869+
"smithy.api#enumValue": "PDF"
1870+
}
1871+
},
1872+
"CSV": {
1873+
"target": "smithy.api#Unit",
1874+
"traits": {
1875+
"smithy.api#enumValue": "CSV"
1876+
}
1877+
}
1878+
}
1879+
},
18631880
"com.amazonaws.inspector2#CisReportStatus": {
18641881
"type": "enum",
18651882
"members": {
@@ -6967,6 +6984,9 @@
69676984
{
69686985
"target": "com.amazonaws.inspector2#InternalServerException"
69696986
},
6987+
{
6988+
"target": "com.amazonaws.inspector2#ResourceNotFoundException"
6989+
},
69706990
{
69716991
"target": "com.amazonaws.inspector2#ThrottlingException"
69726992
},
@@ -6980,7 +7000,8 @@
69807000
{
69817001
"title": "Sample GetCisScanReport Call",
69827002
"input": {
6983-
"scanArn": "arn:aws:inspector2:us-east-1:123412341234:owner/123412341234/cis-scan/624b746d-e080-44ae-8c1d-48e653365a38"
7003+
"scanArn": "arn:aws:inspector2:us-east-1:123412341234:owner/123412341234/cis-scan/624b746d-e080-44ae-8c1d-48e653365a38",
7004+
"reportFormat": "PDF"
69847005
},
69857006
"output": {
69867007
"url": "www.s3.amazon.com/abcdef",
@@ -7010,6 +7031,13 @@
70107031
"traits": {
70117032
"smithy.api#documentation": "<p>The target accounts.</p>"
70127033
}
7034+
},
7035+
"reportFormat": {
7036+
"target": "com.amazonaws.inspector2#CisReportFormat",
7037+
"traits": {
7038+
"smithy.api#default": "PDF",
7039+
"smithy.api#documentation": "<p>\n The format of the report. \n Valid values are <code>PDF</code> and <code>CSV</code>. \n If no value is specified, the report format defaults to <code>PDF</code>.\n </p>"
7040+
}
70137041
}
70147042
},
70157043
"traits": {
@@ -7022,7 +7050,7 @@
70227050
"url": {
70237051
"target": "smithy.api#String",
70247052
"traits": {
7025-
"smithy.api#documentation": "<p>\n The URL where a PDF of the CIS scan report can be downloaded.\n </p>"
7053+
"smithy.api#documentation": "<p>\n The URL where a PDF or CSV of the CIS scan report can be downloaded.\n </p>"
70267054
}
70277055
},
70287056
"status": {

0 commit comments

Comments
 (0)