Skip to content

Commit 2167990

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authoredMar 5, 2025
Document Agentless AWS on demand routes (#2741)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 35017bb commit 2167990

32 files changed

+2391
-35
lines changed
 

‎.apigentools-info

+4-4
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": "2025-03-05 14:38:26.282976",
8-
"spec_repo_commit": "0c376cca"
7+
"regenerated": "2025-03-05 15:56:05.282215",
8+
"spec_repo_commit": "fe5af5dc"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-05 14:38:26.302710",
13-
"spec_repo_commit": "0c376cca"
12+
"regenerated": "2025-03-05 15:56:05.298364",
13+
"spec_repo_commit": "fe5af5dc"
1414
}
1515
}
1616
}

‎.generator/schemas/v2/openapi.yaml

+210-9
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,14 @@ components:
554554
required: false
555555
schema:
556556
type: string
557+
OnDemandTaskId:
558+
description: The UUID of the task.
559+
example: 6d09294c-9ad9-42fd-a759-a0c1599b4828
560+
in: path
561+
name: task_id
562+
required: true
563+
schema:
564+
type: string
557565
OpsgenieServiceIDPathParameter:
558566
description: The UUID of the service.
559567
in: path
@@ -1750,10 +1758,6 @@ components:
17501758
type: string
17511759
type: array
17521760
type: object
1753-
AccountId:
1754-
description: The ID of the AWS account.
1755-
example: '184366314700'
1756-
type: string
17571761
ActionConnectionAttributes:
17581762
description: The definition of `ActionConnectionAttributes` object.
17591763
properties:
@@ -3093,7 +3097,7 @@ components:
30933097
x-enum-varnames:
30943098
- AUTHN_MAPPINGS
30953099
AwsAccountId:
3096-
description: The ID of an AWS account.
3100+
description: The ID of the AWS account.
30973101
example: '123456789012'
30983102
type: string
30993103
AwsCURConfig:
@@ -3300,6 +3304,100 @@ components:
33003304
$ref: '#/components/schemas/AwsCURConfig'
33013305
type: array
33023306
type: object
3307+
AwsOnDemandAttributes:
3308+
description: Attributes for the AWS on demand task.
3309+
properties:
3310+
arn:
3311+
description: The arn of the resource to scan.
3312+
example: arn:aws:ec2:us-east-1:727000456123:instance/i-0eabb50529b67a1ba
3313+
type: string
3314+
assigned_at:
3315+
description: Specifies the assignment timestamp if the task has been already
3316+
assigned to a scanner.
3317+
example: '2025-02-11T18:25:04.550564Z'
3318+
type: string
3319+
created_at:
3320+
description: The task submission timestamp.
3321+
example: '2025-02-11T18:13:24.576915Z'
3322+
type: string
3323+
status:
3324+
description: 'Indicates the status of the task.
3325+
3326+
QUEUED: the task has been submitted successfully and the resource has
3327+
not been assigned to a scanner yet.
3328+
3329+
ASSIGNED: the task has been assigned.
3330+
3331+
ABORTED: the scan has been aborted after a period of time due to technical
3332+
reasons, such as resource not found, insufficient permissions, or the
3333+
absence of a configured scanner.'
3334+
example: QUEUED
3335+
type: string
3336+
type: object
3337+
AwsOnDemandCreateAttributes:
3338+
description: Attributes for the AWS on demand task.
3339+
properties:
3340+
arn:
3341+
description: The arn of the resource to scan. Agentless supports the scan
3342+
of EC2 instances, lambda functions, AMI, ECR, RDS and S3 buckets.
3343+
example: arn:aws:ec2:us-east-1:727000456123:instance/i-0eabb50529b67a1ba
3344+
type: string
3345+
type: object
3346+
AwsOnDemandCreateData:
3347+
description: Object for a single AWS on demand task.
3348+
properties:
3349+
attributes:
3350+
$ref: '#/components/schemas/AwsOnDemandCreateAttributes'
3351+
type:
3352+
$ref: '#/components/schemas/AwsOnDemandType'
3353+
required:
3354+
- type
3355+
- attributes
3356+
type: object
3357+
AwsOnDemandCreateRequest:
3358+
description: Request object that includes the on demand task to submit.
3359+
properties:
3360+
data:
3361+
$ref: '#/components/schemas/AwsOnDemandCreateData'
3362+
required:
3363+
- data
3364+
type: object
3365+
AwsOnDemandData:
3366+
description: Single AWS on demand task.
3367+
properties:
3368+
attributes:
3369+
$ref: '#/components/schemas/AwsOnDemandAttributes'
3370+
id:
3371+
description: The UUID of the task.
3372+
example: 6d09294c-9ad9-42fd-a759-a0c1599b4828
3373+
type: string
3374+
type:
3375+
$ref: '#/components/schemas/AwsOnDemandType'
3376+
type: object
3377+
AwsOnDemandListResponse:
3378+
description: Response object that includes a list of AWS on demand tasks.
3379+
properties:
3380+
data:
3381+
description: A list of on demand tasks.
3382+
items:
3383+
$ref: '#/components/schemas/AwsOnDemandData'
3384+
type: array
3385+
type: object
3386+
AwsOnDemandResponse:
3387+
description: Response object that includes an AWS on demand task.
3388+
properties:
3389+
data:
3390+
$ref: '#/components/schemas/AwsOnDemandData'
3391+
type: object
3392+
AwsOnDemandType:
3393+
default: aws_resource
3394+
description: The type of the on demand task. The value should always be `aws_resource`.
3395+
enum:
3396+
- aws_resource
3397+
example: aws_resource
3398+
type: string
3399+
x-enum-varnames:
3400+
- AWS_RESOURCE
33033401
AwsScanOptionsAttributes:
33043402
description: Attributes for the AWS scan options.
33053403
properties:
@@ -3321,19 +3419,40 @@ components:
33213419
example: true
33223420
type: boolean
33233421
type: object
3422+
AwsScanOptionsCreateAttributes:
3423+
description: Attributes for the AWS scan options to create.
3424+
properties:
3425+
lambda:
3426+
description: Indicates if scanning of Lambda functions is enabled.
3427+
example: true
3428+
type: boolean
3429+
sensitive_data:
3430+
description: Indicates if scanning for sensitive data is enabled.
3431+
example: false
3432+
type: boolean
3433+
vuln_containers_os:
3434+
description: Indicates if scanning for vulnerabilities in containers is
3435+
enabled.
3436+
example: true
3437+
type: boolean
3438+
vuln_host_os:
3439+
description: Indicates if scanning for vulnerabilities in hosts is enabled.
3440+
example: true
3441+
type: boolean
3442+
type: object
33243443
AwsScanOptionsCreateData:
33253444
description: Object for the scan options of a single AWS account.
33263445
properties:
33273446
attributes:
3328-
$ref: '#/components/schemas/AwsScanOptionsAttributes'
3447+
$ref: '#/components/schemas/AwsScanOptionsCreateAttributes'
33293448
id:
33303449
$ref: '#/components/schemas/AwsAccountId'
33313450
type:
33323451
$ref: '#/components/schemas/AwsScanOptionsType'
33333452
required:
33343453
- id
3335-
- attributes
33363454
- type
3455+
- attributes
33373456
type: object
33383457
AwsScanOptionsCreateRequest:
33393458
description: Request object that includes the scan options to create.
@@ -3406,12 +3525,13 @@ components:
34063525
attributes:
34073526
$ref: '#/components/schemas/AwsScanOptionsUpdateAttributes'
34083527
id:
3409-
$ref: '#/components/schemas/AccountId'
3528+
$ref: '#/components/schemas/AwsAccountId'
34103529
type:
34113530
$ref: '#/components/schemas/AwsScanOptionsType'
34123531
required:
3413-
- attributes
3532+
- id
34143533
- type
3534+
- attributes
34153535
type: object
34163536
AwsScanOptionsUpdateRequest:
34173537
description: Request object that includes the scan options to update.
@@ -33059,6 +33179,87 @@ paths:
3305933179
tags:
3306033180
- Agentless Scanning
3306133181
x-codegen-request-body-name: body
33182+
/api/v2/agentless_scanning/ondemand/aws:
33183+
get:
33184+
description: Fetches the most recent 1000 AWS on demand tasks.
33185+
operationId: ListAwsOnDemandTasks
33186+
responses:
33187+
'200':
33188+
content:
33189+
application/json:
33190+
schema:
33191+
$ref: '#/components/schemas/AwsOnDemandListResponse'
33192+
description: OK
33193+
'403':
33194+
$ref: '#/components/responses/NotAuthorizedResponse'
33195+
'429':
33196+
$ref: '#/components/responses/TooManyRequestsResponse'
33197+
summary: Get AWS On Demand tasks
33198+
tags:
33199+
- Agentless Scanning
33200+
x-permission:
33201+
operator: OR
33202+
permissions:
33203+
- security_monitoring_findings_read
33204+
post:
33205+
description: Trigger the scan of an AWS resource with a high priority.
33206+
operationId: CreateAwsOnDemandTask
33207+
requestBody:
33208+
content:
33209+
application/json:
33210+
schema:
33211+
$ref: '#/components/schemas/AwsOnDemandCreateRequest'
33212+
description: The definition of the on demand task.
33213+
required: true
33214+
responses:
33215+
'201':
33216+
content:
33217+
application/json:
33218+
schema:
33219+
$ref: '#/components/schemas/AwsOnDemandResponse'
33220+
description: AWS on demand task created successfully.
33221+
'400':
33222+
$ref: '#/components/responses/BadRequestResponse'
33223+
'403':
33224+
$ref: '#/components/responses/NotAuthorizedResponse'
33225+
'429':
33226+
$ref: '#/components/responses/TooManyRequestsResponse'
33227+
summary: Post an AWS on demand task
33228+
tags:
33229+
- Agentless Scanning
33230+
x-codegen-request-body-name: body
33231+
x-permission:
33232+
operator: OR
33233+
permissions:
33234+
- security_monitoring_findings_write
33235+
/api/v2/agentless_scanning/ondemand/aws/{task_id}:
33236+
get:
33237+
description: Fetch the data of a specific on demand task.
33238+
operationId: RetrieveAwsOnDemandTask
33239+
parameters:
33240+
- $ref: '#/components/parameters/OnDemandTaskId'
33241+
responses:
33242+
'200':
33243+
content:
33244+
application/json:
33245+
schema:
33246+
$ref: '#/components/schemas/AwsOnDemandResponse'
33247+
description: OK.
33248+
'400':
33249+
$ref: '#/components/responses/BadRequestResponse'
33250+
'403':
33251+
$ref: '#/components/responses/NotAuthorizedResponse'
33252+
'404':
33253+
$ref: '#/components/responses/NotFoundResponse'
33254+
'429':
33255+
$ref: '#/components/responses/TooManyRequestsResponse'
33256+
summary: Get AWS On Demand task by id
33257+
tags:
33258+
- Agentless Scanning
33259+
x-permission:
33260+
operator: OR
33261+
permissions:
33262+
- security_monitoring_findings_read
3306233263
/api/v2/api_keys:
3306333264
get:
3306433265
description: List all API keys available for your account.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Post an AWS on demand task returns "AWS on demand task created successfully." response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.AgentlessScanningApi;
6+
import com.datadog.api.client.v2.model.AwsOnDemandCreateAttributes;
7+
import com.datadog.api.client.v2.model.AwsOnDemandCreateData;
8+
import com.datadog.api.client.v2.model.AwsOnDemandCreateRequest;
9+
import com.datadog.api.client.v2.model.AwsOnDemandResponse;
10+
import com.datadog.api.client.v2.model.AwsOnDemandType;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
AgentlessScanningApi apiInstance = new AgentlessScanningApi(defaultClient);
16+
17+
AwsOnDemandCreateRequest body =
18+
new AwsOnDemandCreateRequest()
19+
.data(
20+
new AwsOnDemandCreateData()
21+
.attributes(
22+
new AwsOnDemandCreateAttributes()
23+
.arn(
24+
"arn:aws:lambda:eu-west-3:376334461865:function:This-Is-An-Api-Spec-Test"))
25+
.type(AwsOnDemandType.AWS_RESOURCE));
26+
27+
try {
28+
AwsOnDemandResponse result = apiInstance.createAwsOnDemandTask(body);
29+
System.out.println(result);
30+
} catch (ApiException e) {
31+
System.err.println("Exception when calling AgentlessScanningApi#createAwsOnDemandTask");
32+
System.err.println("Status code: " + e.getCode());
33+
System.err.println("Reason: " + e.getResponseBody());
34+
System.err.println("Response headers: " + e.getResponseHeaders());
35+
e.printStackTrace();
36+
}
37+
}
38+
}

‎examples/v2/agentless-scanning/CreateAwsScanOptions.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.datadog.api.client.ApiClient;
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.v2.api.AgentlessScanningApi;
6-
import com.datadog.api.client.v2.model.AwsScanOptionsAttributes;
6+
import com.datadog.api.client.v2.model.AwsScanOptionsCreateAttributes;
77
import com.datadog.api.client.v2.model.AwsScanOptionsCreateData;
88
import com.datadog.api.client.v2.model.AwsScanOptionsCreateRequest;
99
import com.datadog.api.client.v2.model.AwsScanOptionsResponse;
@@ -21,7 +21,7 @@ public static void main(String[] args) {
2121
.id("000000000003")
2222
.type(AwsScanOptionsType.AWS_SCAN_OPTIONS)
2323
.attributes(
24-
new AwsScanOptionsAttributes()
24+
new AwsScanOptionsCreateAttributes()
2525
.lambda(true)
2626
.sensitiveData(false)
2727
.vulnContainersOs(true)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Get AWS On Demand tasks returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.AgentlessScanningApi;
6+
import com.datadog.api.client.v2.model.AwsOnDemandListResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
AgentlessScanningApi apiInstance = new AgentlessScanningApi(defaultClient);
12+
13+
try {
14+
AwsOnDemandListResponse result = apiInstance.listAwsOnDemandTasks();
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling AgentlessScanningApi#listAwsOnDemandTasks");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)