Skip to content

Commit

Permalink
Add CSM Agentless Read Endpoint (#2629)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jan 8, 2025
1 parent 780a4d0 commit 5bf3b2f
Show file tree
Hide file tree
Showing 12 changed files with 926 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-07 19:53:49.892944",
"spec_repo_commit": "d63fa330"
"regenerated": "2025-01-08 14:02:25.501612",
"spec_repo_commit": "1920836f"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-07 19:53:49.909013",
"spec_repo_commit": "d63fa330"
"regenerated": "2025-01-08 14:02:25.524422",
"spec_repo_commit": "1920836f"
}
}
}
74 changes: 74 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2732,6 +2732,57 @@ components:
$ref: '#/components/schemas/AwsCURConfig'
type: array
type: object
AwsScanOptionsAttributes:
description: Attributes for the AWS scan options.
properties:
lambda:
description: Indicates if scanning of Lambda functions is enabled.
example: true
type: boolean
sensitive_data:
description: Indicates if scanning for sensitive data is enabled.
example: false
type: boolean
vuln_containers_os:
description: Indicates if scanning for vulnerabilities in containers is
enabled.
example: true
type: boolean
vuln_host_os:
description: Indicates if scanning for vulnerabilities in hosts is enabled.
example: true
type: boolean
type: object
AwsScanOptionsData:
description: Single AWS Scan Options entry.
properties:
attributes:
$ref: '#/components/schemas/AwsScanOptionsAttributes'
id:
description: The ID of the AWS account.
example: '184366314700'
type: string
type:
$ref: '#/components/schemas/AwsScanOptionsType'
type: object
AwsScanOptionsResponse:
description: Response object that includes a list of AWS scan options.
properties:
data:
description: A list of AWS scan options.
items:
$ref: '#/components/schemas/AwsScanOptionsData'
type: array
type: object
AwsScanOptionsType:
default: aws_scan_options
description: The type of the resource. The value should always be `aws_scan_options`.
enum:
- aws_scan_options
example: aws_scan_options
type: string
x-enum-varnames:
- AWS_SCAN_OPTIONS
AzureUCConfig:
description: Azure config.
properties:
Expand Down Expand Up @@ -30222,6 +30273,24 @@ info:
version: '1.0'
openapi: 3.0.0
paths:
/api/v2/agentless_scanning/accounts/aws:
get:
description: Fetches the scan options configured for AWS accounts.
operationId: ListAwsScanOptions
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/AwsScanOptionsResponse'
description: OK
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get AWS Scan Options
tags:
- Agentless Scanning
/api/v2/api_keys:
get:
description: List all API keys available for your account.
Expand Down Expand Up @@ -48131,6 +48200,11 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection
name: AWS Logs Integration
- description: "Datadog Agentless Scanning provides visibility into risks and vulnerabilities\nwithin
your hosts, running containers, and serverless functions\u2014all without\nrequiring
teams to install Agents on every host or where Agents cannot be installed.\nGo
to https://www.datadoghq.com/blog/agentless-scanning/ to learn more"
name: Agentless Scanning
- description: Datadog App Builder provides a low-code solution to rapidly develop
and integrate secure, customized applications into your monitoring stack that
are built to accelerate remediation at scale. These API endpoints allow you to
Expand Down
24 changes: 24 additions & 0 deletions examples/v2/agentless-scanning/ListAwsScanOptions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Get AWS Scan Options returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.AgentlessScanningApi;
import com.datadog.api.client.v2.model.AwsScanOptionsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
AgentlessScanningApi apiInstance = new AgentlessScanningApi(defaultClient);

try {
AwsScanOptionsResponse result = apiInstance.listAwsScanOptions();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AgentlessScanningApi#listAwsScanOptions");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
155 changes: 155 additions & 0 deletions src/main/java/com/datadog/api/client/v2/api/AgentlessScanningApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
package com.datadog.api.client.v2.api;

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.ApiResponse;
import com.datadog.api.client.Pair;
import com.datadog.api.client.v2.model.AwsScanOptionsResponse;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.core.GenericType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class AgentlessScanningApi {
private ApiClient apiClient;

public AgentlessScanningApi() {
this(ApiClient.getDefaultApiClient());
}

public AgentlessScanningApi(ApiClient apiClient) {
this.apiClient = apiClient;
}

/**
* Get the API client.
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}

/**
* Set the API client.
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}

/**
* Get AWS Scan Options.
*
* <p>See {@link #listAwsScanOptionsWithHttpInfo}.
*
* @return AwsScanOptionsResponse
* @throws ApiException if fails to make API call
*/
public AwsScanOptionsResponse listAwsScanOptions() throws ApiException {
return listAwsScanOptionsWithHttpInfo().getData();
}

/**
* Get AWS Scan Options.
*
* <p>See {@link #listAwsScanOptionsWithHttpInfoAsync}.
*
* @return CompletableFuture&lt;AwsScanOptionsResponse&gt;
*/
public CompletableFuture<AwsScanOptionsResponse> listAwsScanOptionsAsync() {
return listAwsScanOptionsWithHttpInfoAsync()
.thenApply(
response -> {
return response.getData();
});
}

/**
* Fetches the scan options configured for AWS accounts.
*
* @return ApiResponse&lt;AwsScanOptionsResponse&gt;
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<AwsScanOptionsResponse> listAwsScanOptionsWithHttpInfo() throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/agentless_scanning/accounts/aws";

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder =
apiClient.createBuilder(
"v2.AgentlessScanningApi.listAwsScanOptions",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
return apiClient.invokeAPI(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<AwsScanOptionsResponse>() {});
}

/**
* Get AWS Scan Options.
*
* <p>See {@link #listAwsScanOptionsWithHttpInfo}.
*
* @return CompletableFuture&lt;ApiResponse&lt;AwsScanOptionsResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<AwsScanOptionsResponse>>
listAwsScanOptionsWithHttpInfoAsync() {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/agentless_scanning/accounts/aws";

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.AgentlessScanningApi.listAwsScanOptions",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<AwsScanOptionsResponse>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<AwsScanOptionsResponse>() {});
}
}
Loading

0 comments on commit 5bf3b2f

Please sign in to comment.