Skip to content

Commit 5bf3b2f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add CSM Agentless Read Endpoint (#2629)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 780a4d0 commit 5bf3b2f

File tree

12 files changed

+926
-4
lines changed

12 files changed

+926
-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": "2025-01-07 19:53:49.892944",
8-
"spec_repo_commit": "d63fa330"
7+
"regenerated": "2025-01-08 14:02:25.501612",
8+
"spec_repo_commit": "1920836f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-07 19:53:49.909013",
13-
"spec_repo_commit": "d63fa330"
12+
"regenerated": "2025-01-08 14:02:25.524422",
13+
"spec_repo_commit": "1920836f"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,6 +2732,57 @@ components:
27322732
$ref: '#/components/schemas/AwsCURConfig'
27332733
type: array
27342734
type: object
2735+
AwsScanOptionsAttributes:
2736+
description: Attributes for the AWS scan options.
2737+
properties:
2738+
lambda:
2739+
description: Indicates if scanning of Lambda functions is enabled.
2740+
example: true
2741+
type: boolean
2742+
sensitive_data:
2743+
description: Indicates if scanning for sensitive data is enabled.
2744+
example: false
2745+
type: boolean
2746+
vuln_containers_os:
2747+
description: Indicates if scanning for vulnerabilities in containers is
2748+
enabled.
2749+
example: true
2750+
type: boolean
2751+
vuln_host_os:
2752+
description: Indicates if scanning for vulnerabilities in hosts is enabled.
2753+
example: true
2754+
type: boolean
2755+
type: object
2756+
AwsScanOptionsData:
2757+
description: Single AWS Scan Options entry.
2758+
properties:
2759+
attributes:
2760+
$ref: '#/components/schemas/AwsScanOptionsAttributes'
2761+
id:
2762+
description: The ID of the AWS account.
2763+
example: '184366314700'
2764+
type: string
2765+
type:
2766+
$ref: '#/components/schemas/AwsScanOptionsType'
2767+
type: object
2768+
AwsScanOptionsResponse:
2769+
description: Response object that includes a list of AWS scan options.
2770+
properties:
2771+
data:
2772+
description: A list of AWS scan options.
2773+
items:
2774+
$ref: '#/components/schemas/AwsScanOptionsData'
2775+
type: array
2776+
type: object
2777+
AwsScanOptionsType:
2778+
default: aws_scan_options
2779+
description: The type of the resource. The value should always be `aws_scan_options`.
2780+
enum:
2781+
- aws_scan_options
2782+
example: aws_scan_options
2783+
type: string
2784+
x-enum-varnames:
2785+
- AWS_SCAN_OPTIONS
27352786
AzureUCConfig:
27362787
description: Azure config.
27372788
properties:
@@ -30222,6 +30273,24 @@ info:
3022230273
version: '1.0'
3022330274
openapi: 3.0.0
3022430275
paths:
30276+
/api/v2/agentless_scanning/accounts/aws:
30277+
get:
30278+
description: Fetches the scan options configured for AWS accounts.
30279+
operationId: ListAwsScanOptions
30280+
responses:
30281+
'200':
30282+
content:
30283+
application/json:
30284+
schema:
30285+
$ref: '#/components/schemas/AwsScanOptionsResponse'
30286+
description: OK
30287+
'403':
30288+
$ref: '#/components/responses/NotAuthorizedResponse'
30289+
'429':
30290+
$ref: '#/components/responses/TooManyRequestsResponse'
30291+
summary: Get AWS Scan Options
30292+
tags:
30293+
- Agentless Scanning
3022530294
/api/v2/api_keys:
3022630295
get:
3022730296
description: List all API keys available for your account.
@@ -48131,6 +48200,11 @@ tags:
4813148200
externalDocs:
4813248201
url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection
4813348202
name: AWS Logs Integration
48203+
- description: "Datadog Agentless Scanning provides visibility into risks and vulnerabilities\nwithin
48204+
your hosts, running containers, and serverless functions\u2014all without\nrequiring
48205+
teams to install Agents on every host or where Agents cannot be installed.\nGo
48206+
to https://www.datadoghq.com/blog/agentless-scanning/ to learn more"
48207+
name: Agentless Scanning
4813448208
- description: Datadog App Builder provides a low-code solution to rapidly develop
4813548209
and integrate secure, customized applications into your monitoring stack that
4813648210
are built to accelerate remediation at scale. These API endpoints allow you to
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Get AWS Scan Options 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.AwsScanOptionsResponse;
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+
AwsScanOptionsResponse result = apiInstance.listAwsScanOptions();
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling AgentlessScanningApi#listAwsScanOptions");
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+
}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
package com.datadog.api.client.v2.api;
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.ApiResponse;
6+
import com.datadog.api.client.Pair;
7+
import com.datadog.api.client.v2.model.AwsScanOptionsResponse;
8+
import jakarta.ws.rs.client.Invocation;
9+
import jakarta.ws.rs.core.GenericType;
10+
import java.util.ArrayList;
11+
import java.util.HashMap;
12+
import java.util.Map;
13+
import java.util.concurrent.CompletableFuture;
14+
15+
@jakarta.annotation.Generated(
16+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
17+
public class AgentlessScanningApi {
18+
private ApiClient apiClient;
19+
20+
public AgentlessScanningApi() {
21+
this(ApiClient.getDefaultApiClient());
22+
}
23+
24+
public AgentlessScanningApi(ApiClient apiClient) {
25+
this.apiClient = apiClient;
26+
}
27+
28+
/**
29+
* Get the API client.
30+
*
31+
* @return API client
32+
*/
33+
public ApiClient getApiClient() {
34+
return apiClient;
35+
}
36+
37+
/**
38+
* Set the API client.
39+
*
40+
* @param apiClient an instance of API client
41+
*/
42+
public void setApiClient(ApiClient apiClient) {
43+
this.apiClient = apiClient;
44+
}
45+
46+
/**
47+
* Get AWS Scan Options.
48+
*
49+
* <p>See {@link #listAwsScanOptionsWithHttpInfo}.
50+
*
51+
* @return AwsScanOptionsResponse
52+
* @throws ApiException if fails to make API call
53+
*/
54+
public AwsScanOptionsResponse listAwsScanOptions() throws ApiException {
55+
return listAwsScanOptionsWithHttpInfo().getData();
56+
}
57+
58+
/**
59+
* Get AWS Scan Options.
60+
*
61+
* <p>See {@link #listAwsScanOptionsWithHttpInfoAsync}.
62+
*
63+
* @return CompletableFuture&lt;AwsScanOptionsResponse&gt;
64+
*/
65+
public CompletableFuture<AwsScanOptionsResponse> listAwsScanOptionsAsync() {
66+
return listAwsScanOptionsWithHttpInfoAsync()
67+
.thenApply(
68+
response -> {
69+
return response.getData();
70+
});
71+
}
72+
73+
/**
74+
* Fetches the scan options configured for AWS accounts.
75+
*
76+
* @return ApiResponse&lt;AwsScanOptionsResponse&gt;
77+
* @throws ApiException if fails to make API call
78+
* @http.response.details
79+
* <table border="1">
80+
* <caption>Response details</caption>
81+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
82+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
83+
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
84+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
85+
* </table>
86+
*/
87+
public ApiResponse<AwsScanOptionsResponse> listAwsScanOptionsWithHttpInfo() throws ApiException {
88+
Object localVarPostBody = null;
89+
// create path and map variables
90+
String localVarPath = "/api/v2/agentless_scanning/accounts/aws";
91+
92+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
93+
94+
Invocation.Builder builder =
95+
apiClient.createBuilder(
96+
"v2.AgentlessScanningApi.listAwsScanOptions",
97+
localVarPath,
98+
new ArrayList<Pair>(),
99+
localVarHeaderParams,
100+
new HashMap<String, String>(),
101+
new String[] {"application/json"},
102+
new String[] {"apiKeyAuth", "appKeyAuth"});
103+
return apiClient.invokeAPI(
104+
"GET",
105+
builder,
106+
localVarHeaderParams,
107+
new String[] {},
108+
localVarPostBody,
109+
new HashMap<String, Object>(),
110+
false,
111+
new GenericType<AwsScanOptionsResponse>() {});
112+
}
113+
114+
/**
115+
* Get AWS Scan Options.
116+
*
117+
* <p>See {@link #listAwsScanOptionsWithHttpInfo}.
118+
*
119+
* @return CompletableFuture&lt;ApiResponse&lt;AwsScanOptionsResponse&gt;&gt;
120+
*/
121+
public CompletableFuture<ApiResponse<AwsScanOptionsResponse>>
122+
listAwsScanOptionsWithHttpInfoAsync() {
123+
Object localVarPostBody = null;
124+
// create path and map variables
125+
String localVarPath = "/api/v2/agentless_scanning/accounts/aws";
126+
127+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
128+
129+
Invocation.Builder builder;
130+
try {
131+
builder =
132+
apiClient.createBuilder(
133+
"v2.AgentlessScanningApi.listAwsScanOptions",
134+
localVarPath,
135+
new ArrayList<Pair>(),
136+
localVarHeaderParams,
137+
new HashMap<String, String>(),
138+
new String[] {"application/json"},
139+
new String[] {"apiKeyAuth", "appKeyAuth"});
140+
} catch (ApiException ex) {
141+
CompletableFuture<ApiResponse<AwsScanOptionsResponse>> result = new CompletableFuture<>();
142+
result.completeExceptionally(ex);
143+
return result;
144+
}
145+
return apiClient.invokeAPIAsync(
146+
"GET",
147+
builder,
148+
localVarHeaderParams,
149+
new String[] {},
150+
localVarPostBody,
151+
new HashMap<String, Object>(),
152+
false,
153+
new GenericType<AwsScanOptionsResponse>() {});
154+
}
155+
}

0 commit comments

Comments
 (0)