Skip to content

Commit 2aff6cb

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit dabda1fa of spec repo
1 parent e0921ec commit 2aff6cb

File tree

15 files changed

+543
-4
lines changed

15 files changed

+543
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-12-17 15:50:58.597261",
8-
"spec_repo_commit": "b82d3677"
7+
"regenerated": "2024-12-18 15:52:25.397040",
8+
"spec_repo_commit": "dabda1fa"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-17 15:50:58.611708",
13-
"spec_repo_commit": "b82d3677"
12+
"regenerated": "2024-12-18 15:52:25.412713",
13+
"spec_repo_commit": "dabda1fa"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2615,6 +2615,57 @@ components:
26152615
$ref: '#/components/schemas/AwsCURConfig'
26162616
type: array
26172617
type: object
2618+
AwsScanOptionsAttributes:
2619+
description: Attributes for the AWS scan options.
2620+
properties:
2621+
lambda:
2622+
description: Indicates if scanning of Lambda functions is enabled.
2623+
example: true
2624+
type: boolean
2625+
sensitive_data:
2626+
description: Indicates if scanning for sensitive data is enabled.
2627+
example: false
2628+
type: boolean
2629+
vuln_containers_os:
2630+
description: Indicates if scanning for vulnerabilities in containers is
2631+
enabled.
2632+
example: true
2633+
type: boolean
2634+
vuln_host_os:
2635+
description: Indicates if scanning for vulnerabilities in hosts is enabled.
2636+
example: true
2637+
type: boolean
2638+
type: object
2639+
AwsScanOptionsData:
2640+
description: Single AWS Scan Options entry.
2641+
properties:
2642+
attributes:
2643+
$ref: '#/components/schemas/AwsScanOptionsAttributes'
2644+
id:
2645+
description: The ID of the AWS account.
2646+
example: '184366314700'
2647+
type: string
2648+
type:
2649+
$ref: '#/components/schemas/AwsScanOptionsType'
2650+
type: object
2651+
AwsScanOptionsResponse:
2652+
description: Response object that includes a list of AWS scan options.
2653+
properties:
2654+
data:
2655+
description: A list of AWS scan options.
2656+
items:
2657+
$ref: '#/components/schemas/AwsScanOptionsData'
2658+
type: array
2659+
type: object
2660+
AwsScanOptionsType:
2661+
default: aws_scan_options
2662+
description: The type of the resource. The value should always be `aws_scan_options`.
2663+
enum:
2664+
- aws_scan_options
2665+
example: aws_scan_options
2666+
type: string
2667+
x-enum-varnames:
2668+
- AWS_SCAN_OPTIONS
26182669
AzureUCConfig:
26192670
description: Azure config.
26202671
properties:
@@ -29269,6 +29320,24 @@ info:
2926929320
version: '1.0'
2927029321
openapi: 3.0.0
2927129322
paths:
29323+
/api/v2/agentless_scanning/accounts/aws:
29324+
get:
29325+
description: Fetches the scan options configured for AWS accounts.
29326+
operationId: ListAwsScanOptions
29327+
responses:
29328+
'200':
29329+
content:
29330+
application/json:
29331+
schema:
29332+
$ref: '#/components/schemas/AwsScanOptionsResponse'
29333+
description: OK
29334+
'403':
29335+
$ref: '#/components/responses/NotAuthorizedResponse'
29336+
'429':
29337+
$ref: '#/components/responses/TooManyRequestsResponse'
29338+
summary: Get AWS Scan Options
29339+
tags:
29340+
- Agentless Scanning
2927229341
/api/v2/api_keys:
2927329342
get:
2927429343
description: List all API keys available for your account.
@@ -46530,6 +46599,11 @@ tags:
4653046599
externalDocs:
4653146600
url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection
4653246601
name: AWS Logs Integration
46602+
- description: "Datadog Agentless Scanning provides visibility into risks and vulnerabilities\nwithin
46603+
your hosts, running containers, and serverless functions\u2014all without\nrequiring
46604+
teams to install agents on every host or where agents cannot be installed.\nGo
46605+
to https://www.datadoghq.com/blog/agentless-scanning/ to learn more"
46606+
name: Agentless Scanning
4653346607
- description: Deploy and disable apps in App Builder.
4653446608
name: App Deployment
4653546609
- description: Create, read, update, and delete apps in App Builder.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-12-18T15:40:11.636Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"log": {
3+
"_recordingName": "Agentless Scanning/Get AWS Scan Options returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "2cb6ecfe386c3349268926da480a6b5d",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
}
23+
],
24+
"headersSize": 530,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [],
28+
"url": "https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws"
29+
},
30+
"response": {
31+
"bodySize": 11,
32+
"content": {
33+
"mimeType": "application/vnd.api+json",
34+
"size": 11,
35+
"text": "{\"data\":[]}"
36+
},
37+
"cookies": [],
38+
"headers": [
39+
{
40+
"name": "content-type",
41+
"value": "application/vnd.api+json"
42+
}
43+
],
44+
"headersSize": 674,
45+
"httpVersion": "HTTP/1.1",
46+
"redirectURL": "",
47+
"status": 200,
48+
"statusText": "OK"
49+
},
50+
"startedDateTime": "2024-12-18T15:40:11.830Z",
51+
"time": 308
52+
}
53+
],
54+
"pages": [],
55+
"version": "1.2"
56+
}
57+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Get AWS Scan Options returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.AgentlessScanningApi(configuration);
9+
10+
apiInstance
11+
.listAwsScanOptions()
12+
.then((data: v2.AwsScanOptionsResponse) => {
13+
console.log(
14+
"API called successfully. Returned data: " + JSON.stringify(data)
15+
);
16+
})
17+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,9 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
23062306
"v1.Validate": {
23072307
"operationResponseType": "AuthenticationValidationResponse",
23082308
},
2309+
"v2.ListAwsScanOptions": {
2310+
"operationResponseType": "AwsScanOptionsResponse",
2311+
},
23092312
"v2.ListAPIKeys": {
23102313
"pageSize": {
23112314
"type": "number",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@endpoint(agentless-scanning) @endpoint(agentless-scanning-v2)
2+
Feature: Agentless Scanning
3+
Datadog Agentless Scanning provides visibility into risks and
4+
vulnerabilities within your hosts, running containers, and serverless
5+
functions—all without requiring teams to install agents on every host or
6+
where agents cannot be installed. Go to
7+
https://www.datadoghq.com/blog/agentless-scanning/ to learn more
8+
9+
@team:DataDog/k9-cloud-security-platform
10+
Scenario: Get AWS Scan Options returns "OK" response
11+
Given a valid "apiKeyAuth" key in the system
12+
And a valid "appKeyAuth" key in the system
13+
And an instance of "AgentlessScanning" API
14+
And new "ListAwsScanOptions" request
15+
When the request is sent
16+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
2+
"ListAwsScanOptions": {
3+
"tag": "Agentless Scanning",
4+
"undo": {
5+
"type": "safe"
6+
}
7+
},
28
"ListAPIKeys": {
39
"tag": "Key Management",
410
"undo": {
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
import { BaseAPIRequestFactory } from "../../datadog-api-client-common/baseapi";
2+
import {
3+
Configuration,
4+
applySecurityAuthentication,
5+
} from "../../datadog-api-client-common/configuration";
6+
import {
7+
RequestContext,
8+
HttpMethod,
9+
ResponseContext,
10+
} from "../../datadog-api-client-common/http/http";
11+
12+
import { logger } from "../../../logger";
13+
import { ObjectSerializer } from "../models/ObjectSerializer";
14+
import { ApiException } from "../../datadog-api-client-common/exception";
15+
16+
import { APIErrorResponse } from "../models/APIErrorResponse";
17+
import { AwsScanOptionsResponse } from "../models/AwsScanOptionsResponse";
18+
19+
export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory {
20+
public async listAwsScanOptions(
21+
_options?: Configuration
22+
): Promise<RequestContext> {
23+
const _config = _options || this.configuration;
24+
25+
// Path Params
26+
const localVarPath = "/api/v2/agentless_scanning/accounts/aws";
27+
28+
// Make Request Context
29+
const requestContext = _config
30+
.getServer("v2.AgentlessScanningApi.listAwsScanOptions")
31+
.makeRequestContext(localVarPath, HttpMethod.GET);
32+
requestContext.setHeaderParam("Accept", "application/json");
33+
requestContext.setHttpConfig(_config.httpConfig);
34+
35+
// Apply auth methods
36+
applySecurityAuthentication(_config, requestContext, [
37+
"apiKeyAuth",
38+
"appKeyAuth",
39+
]);
40+
41+
return requestContext;
42+
}
43+
}
44+
45+
export class AgentlessScanningApiResponseProcessor {
46+
/**
47+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
48+
* to the expected objects
49+
*
50+
* @params response Response returned by the server for a request to listAwsScanOptions
51+
* @throws ApiException if the response code was not in [200, 299]
52+
*/
53+
public async listAwsScanOptions(
54+
response: ResponseContext
55+
): Promise<AwsScanOptionsResponse> {
56+
const contentType = ObjectSerializer.normalizeMediaType(
57+
response.headers["content-type"]
58+
);
59+
if (response.httpStatusCode === 200) {
60+
const body: AwsScanOptionsResponse = ObjectSerializer.deserialize(
61+
ObjectSerializer.parse(await response.body.text(), contentType),
62+
"AwsScanOptionsResponse"
63+
) as AwsScanOptionsResponse;
64+
return body;
65+
}
66+
if (response.httpStatusCode === 403 || response.httpStatusCode === 429) {
67+
const bodyText = ObjectSerializer.parse(
68+
await response.body.text(),
69+
contentType
70+
);
71+
let body: APIErrorResponse;
72+
try {
73+
body = ObjectSerializer.deserialize(
74+
bodyText,
75+
"APIErrorResponse"
76+
) as APIErrorResponse;
77+
} catch (error) {
78+
logger.debug(`Got error deserializing error: ${error}`);
79+
throw new ApiException<APIErrorResponse>(
80+
response.httpStatusCode,
81+
bodyText
82+
);
83+
}
84+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
85+
}
86+
87+
// Work around for missing responses in specification, e.g. for petstore.yaml
88+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
89+
const body: AwsScanOptionsResponse = ObjectSerializer.deserialize(
90+
ObjectSerializer.parse(await response.body.text(), contentType),
91+
"AwsScanOptionsResponse",
92+
""
93+
) as AwsScanOptionsResponse;
94+
return body;
95+
}
96+
97+
const body = (await response.body.text()) || "";
98+
throw new ApiException<string>(
99+
response.httpStatusCode,
100+
'Unknown API Status Code!\nBody: "' + body + '"'
101+
);
102+
}
103+
}
104+
105+
export class AgentlessScanningApi {
106+
private requestFactory: AgentlessScanningApiRequestFactory;
107+
private responseProcessor: AgentlessScanningApiResponseProcessor;
108+
private configuration: Configuration;
109+
110+
public constructor(
111+
configuration: Configuration,
112+
requestFactory?: AgentlessScanningApiRequestFactory,
113+
responseProcessor?: AgentlessScanningApiResponseProcessor
114+
) {
115+
this.configuration = configuration;
116+
this.requestFactory =
117+
requestFactory || new AgentlessScanningApiRequestFactory(configuration);
118+
this.responseProcessor =
119+
responseProcessor || new AgentlessScanningApiResponseProcessor();
120+
}
121+
122+
/**
123+
* Fetches the scan options configured for AWS accounts.
124+
* @param param The request object
125+
*/
126+
public listAwsScanOptions(
127+
options?: Configuration
128+
): Promise<AwsScanOptionsResponse> {
129+
const requestContextPromise =
130+
this.requestFactory.listAwsScanOptions(options);
131+
return requestContextPromise.then((requestContext) => {
132+
return this.configuration.httpApi
133+
.send(requestContext)
134+
.then((responseContext) => {
135+
return this.responseProcessor.listAwsScanOptions(responseContext);
136+
});
137+
});
138+
}
139+
}

packages/datadog-api-client-v2/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export {
2727

2828
export { AWSLogsIntegrationApi } from "./apis/AWSLogsIntegrationApi";
2929

30+
export { AgentlessScanningApi } from "./apis/AgentlessScanningApi";
31+
3032
export {
3133
AppDeploymentApiDeployAppRequest,
3234
AppDeploymentApiDisableAppRequest,
@@ -737,6 +739,10 @@ export { AWSRegions } from "./models/AWSRegions";
737739
export { AWSRegionsIncludeAll } from "./models/AWSRegionsIncludeAll";
738740
export { AWSRegionsIncludeOnly } from "./models/AWSRegionsIncludeOnly";
739741
export { AWSResourcesConfig } from "./models/AWSResourcesConfig";
742+
export { AwsScanOptionsAttributes } from "./models/AwsScanOptionsAttributes";
743+
export { AwsScanOptionsData } from "./models/AwsScanOptionsData";
744+
export { AwsScanOptionsResponse } from "./models/AwsScanOptionsResponse";
745+
export { AwsScanOptionsType } from "./models/AwsScanOptionsType";
740746
export { AWSTracesConfig } from "./models/AWSTracesConfig";
741747
export { AzureUCConfig } from "./models/AzureUCConfig";
742748
export { AzureUCConfigPair } from "./models/AzureUCConfigPair";

0 commit comments

Comments
 (0)