Skip to content

Commit 027f501

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 092c127 of spec repo (#3086)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent d224060 commit 027f501

File tree

106 files changed

+451
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+451
-115
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46152,7 +46152,7 @@ paths:
4615246152
$ref: '#/components/responses/NotAuthorizedResponse'
4615346153
'429':
4615446154
$ref: '#/components/responses/TooManyRequestsResponse'
46155-
summary: Get AWS Scan Options
46155+
summary: List AWS Scan Options
4615646156
tags:
4615746157
- Agentless Scanning
4615846158
post:
@@ -46204,6 +46204,29 @@ paths:
4620446204
summary: Delete AWS Scan Options
4620546205
tags:
4620646206
- Agentless Scanning
46207+
get:
46208+
description: Fetches the Agentless scan options for an activated account.
46209+
operationId: GetAwsScanOptions
46210+
parameters:
46211+
- $ref: '#/components/parameters/AwsAccountId'
46212+
responses:
46213+
'200':
46214+
content:
46215+
application/json:
46216+
schema:
46217+
$ref: '#/components/schemas/AwsScanOptionsResponse'
46218+
description: OK
46219+
'400':
46220+
$ref: '#/components/responses/BadRequestResponse'
46221+
'403':
46222+
$ref: '#/components/responses/NotAuthorizedResponse'
46223+
'404':
46224+
$ref: '#/components/responses/NotFoundResponse'
46225+
'429':
46226+
$ref: '#/components/responses/TooManyRequestsResponse'
46227+
summary: Get AWS scan options
46228+
tags:
46229+
- Agentless Scanning
4620746230
patch:
4620846231
description: Update the Agentless scan options for an activated account.
4620946232
operationId: UpdateAwsScanOptions
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
// there is a valid "aws_scan_options" in the system
14+
String AWS_SCAN_OPTIONS_ID = System.getenv("AWS_SCAN_OPTIONS_ID");
15+
16+
try {
17+
AwsScanOptionsResponse result = apiInstance.getAwsScanOptions(AWS_SCAN_OPTIONS_ID);
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling AgentlessScanningApi#getAwsScanOptions");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}

examples/v2/agentless-scanning/ListAwsScanOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Get AWS Scan Options returns "OK" response
1+
// List AWS Scan Options returns "OK" response
22

33
import com.datadog.api.client.ApiClient;
44
import com.datadog.api.client.ApiException;

src/main/java/com/datadog/api/client/v2/api/AgentlessScanningApi.java

Lines changed: 139 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,142 @@ public CompletableFuture<ApiResponse<AwsOnDemandResponse>> getAwsOnDemandTaskWit
587587
new GenericType<AwsOnDemandResponse>() {});
588588
}
589589

590+
/**
591+
* Get AWS scan options.
592+
*
593+
* <p>See {@link #getAwsScanOptionsWithHttpInfo}.
594+
*
595+
* @param accountId The ID of an AWS account. (required)
596+
* @return AwsScanOptionsResponse
597+
* @throws ApiException if fails to make API call
598+
*/
599+
public AwsScanOptionsResponse getAwsScanOptions(String accountId) throws ApiException {
600+
return getAwsScanOptionsWithHttpInfo(accountId).getData();
601+
}
602+
603+
/**
604+
* Get AWS scan options.
605+
*
606+
* <p>See {@link #getAwsScanOptionsWithHttpInfoAsync}.
607+
*
608+
* @param accountId The ID of an AWS account. (required)
609+
* @return CompletableFuture&lt;AwsScanOptionsResponse&gt;
610+
*/
611+
public CompletableFuture<AwsScanOptionsResponse> getAwsScanOptionsAsync(String accountId) {
612+
return getAwsScanOptionsWithHttpInfoAsync(accountId)
613+
.thenApply(
614+
response -> {
615+
return response.getData();
616+
});
617+
}
618+
619+
/**
620+
* Fetches the Agentless scan options for an activated account.
621+
*
622+
* @param accountId The ID of an AWS account. (required)
623+
* @return ApiResponse&lt;AwsScanOptionsResponse&gt;
624+
* @throws ApiException if fails to make API call
625+
* @http.response.details
626+
* <table border="1">
627+
* <caption>Response details</caption>
628+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
629+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
630+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
631+
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
632+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
633+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
634+
* </table>
635+
*/
636+
public ApiResponse<AwsScanOptionsResponse> getAwsScanOptionsWithHttpInfo(String accountId)
637+
throws ApiException {
638+
Object localVarPostBody = null;
639+
640+
// verify the required parameter 'accountId' is set
641+
if (accountId == null) {
642+
throw new ApiException(
643+
400, "Missing the required parameter 'accountId' when calling getAwsScanOptions");
644+
}
645+
// create path and map variables
646+
String localVarPath =
647+
"/api/v2/agentless_scanning/accounts/aws/{account_id}"
648+
.replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
649+
650+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
651+
652+
Invocation.Builder builder =
653+
apiClient.createBuilder(
654+
"v2.AgentlessScanningApi.getAwsScanOptions",
655+
localVarPath,
656+
new ArrayList<Pair>(),
657+
localVarHeaderParams,
658+
new HashMap<String, String>(),
659+
new String[] {"application/json"},
660+
new String[] {"apiKeyAuth", "appKeyAuth"});
661+
return apiClient.invokeAPI(
662+
"GET",
663+
builder,
664+
localVarHeaderParams,
665+
new String[] {},
666+
localVarPostBody,
667+
new HashMap<String, Object>(),
668+
false,
669+
new GenericType<AwsScanOptionsResponse>() {});
670+
}
671+
672+
/**
673+
* Get AWS scan options.
674+
*
675+
* <p>See {@link #getAwsScanOptionsWithHttpInfo}.
676+
*
677+
* @param accountId The ID of an AWS account. (required)
678+
* @return CompletableFuture&lt;ApiResponse&lt;AwsScanOptionsResponse&gt;&gt;
679+
*/
680+
public CompletableFuture<ApiResponse<AwsScanOptionsResponse>> getAwsScanOptionsWithHttpInfoAsync(
681+
String accountId) {
682+
Object localVarPostBody = null;
683+
684+
// verify the required parameter 'accountId' is set
685+
if (accountId == null) {
686+
CompletableFuture<ApiResponse<AwsScanOptionsResponse>> result = new CompletableFuture<>();
687+
result.completeExceptionally(
688+
new ApiException(
689+
400, "Missing the required parameter 'accountId' when calling getAwsScanOptions"));
690+
return result;
691+
}
692+
// create path and map variables
693+
String localVarPath =
694+
"/api/v2/agentless_scanning/accounts/aws/{account_id}"
695+
.replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
696+
697+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
698+
699+
Invocation.Builder builder;
700+
try {
701+
builder =
702+
apiClient.createBuilder(
703+
"v2.AgentlessScanningApi.getAwsScanOptions",
704+
localVarPath,
705+
new ArrayList<Pair>(),
706+
localVarHeaderParams,
707+
new HashMap<String, String>(),
708+
new String[] {"application/json"},
709+
new String[] {"apiKeyAuth", "appKeyAuth"});
710+
} catch (ApiException ex) {
711+
CompletableFuture<ApiResponse<AwsScanOptionsResponse>> result = new CompletableFuture<>();
712+
result.completeExceptionally(ex);
713+
return result;
714+
}
715+
return apiClient.invokeAPIAsync(
716+
"GET",
717+
builder,
718+
localVarHeaderParams,
719+
new String[] {},
720+
localVarPostBody,
721+
new HashMap<String, Object>(),
722+
false,
723+
new GenericType<AwsScanOptionsResponse>() {});
724+
}
725+
590726
/**
591727
* Get AWS On Demand tasks.
592728
*
@@ -699,7 +835,7 @@ public ApiResponse<AwsOnDemandListResponse> listAwsOnDemandTasksWithHttpInfo()
699835
}
700836

701837
/**
702-
* Get AWS Scan Options.
838+
* List AWS Scan Options.
703839
*
704840
* <p>See {@link #listAwsScanOptionsWithHttpInfo}.
705841
*
@@ -711,7 +847,7 @@ public AwsScanOptionsListResponse listAwsScanOptions() throws ApiException {
711847
}
712848

713849
/**
714-
* Get AWS Scan Options.
850+
* List AWS Scan Options.
715851
*
716852
* <p>See {@link #listAwsScanOptionsWithHttpInfoAsync}.
717853
*
@@ -768,7 +904,7 @@ public ApiResponse<AwsScanOptionsListResponse> listAwsScanOptionsWithHttpInfo()
768904
}
769905

770906
/**
771-
* Get AWS Scan Options.
907+
* List AWS Scan Options.
772908
*
773909
* <p>See {@link #listAwsScanOptionsWithHttpInfo}.
774910
*

src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
"timeToLive": {
2929
"unlimited": true
3030
},
31-
"id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d"
31+
"id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e"
3232
}
3333
]

src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
"timeToLive": {
2929
"unlimited": true
3030
},
31-
"id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e"
31+
"id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d"
3232
}
3333
]

src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eec"
30+
"id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eeb"
3131
},
3232
{
3333
"httpRequest": {

src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_No_Content_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eee"
30+
"id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eec"
3131
},
3232
{
3333
"httpRequest": {

src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eed"
30+
"id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eee"
3131
},
3232
{
3333
"httpRequest": {
@@ -53,7 +53,7 @@
5353
"timeToLive": {
5454
"unlimited": true
5555
},
56-
"id": "ab2123e3-6fb5-0f90-fe98-365e086c9c6f"
56+
"id": "ab2123e3-6fb5-0f90-fe98-365e086c9c6e"
5757
},
5858
{
5959
"httpRequest": {

src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
"timeToLive": {
2424
"unlimited": true
2525
},
26-
"id": "d0ec7736-ef6c-d071-3390-4a5c3a301d11"
26+
"id": "d0ec7736-ef6c-d071-3390-4a5c3a301d0f"
2727
}
2828
]

0 commit comments

Comments
 (0)