Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,65 @@ components:
required:
- role_name
type: object
AWSCloudAuthPersonaMappingAttributesResponse:
description: Attributes for AWS cloud authentication persona mapping response
properties:
account_identifier:
description: Datadog account identifier (email or handle) mapped to the
AWS principal
example: test@test.com
type: string
account_uuid:
description: Datadog account UUID
example: 12bbdc5c-5966-47e0-8733-285f9e44bcf4
type: string
arn_pattern:
description: AWS IAM ARN pattern to match for authentication
example: arn:aws:iam::123456789012:user/testuser
type: string
required:
- arn_pattern
- account_identifier
- account_uuid
type: object
AWSCloudAuthPersonaMappingDataResponse:
description: Data for AWS cloud authentication persona mapping response
properties:
attributes:
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingAttributesResponse'
id:
description: Unique identifier for the persona mapping
example: c5c758c6-18c2-4484-ae3f-46b84128404a
type: string
type:
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingType'
required:
- id
- type
- attributes
type: object
AWSCloudAuthPersonaMappingType:
description: Type identifier for AWS cloud authentication persona mapping
enum:
- aws_cloud_auth_config
example: aws_cloud_auth_config
type: string
x-enum-varnames:
- AWS_CLOUD_AUTH_CONFIG
AWSCloudAuthPersonaMappingsData:
description: List of AWS cloud authentication persona mappings
items:
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingDataResponse'
type: array
AWSCloudAuthPersonaMappingsResponse:
description: Response containing a list of AWS cloud authentication persona
mappings
properties:
data:
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingsData'
required:
- data
type: object
AWSCredentials:
description: The definition of `AWSCredentials` object.
oneOf:
Expand Down Expand Up @@ -69385,6 +69444,39 @@ paths:
permissions:
- ci_visibility_read
- test_optimization_read
/api/v2/cloud_auth/aws/persona_mapping:
get:
description: List all AWS cloud authentication persona mappings. This endpoint
retrieves all configured persona mappings that associate AWS IAM principals
with Datadog users.
operationId: ListAWSCloudAuthPersonaMappings
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingsResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: List AWS cloud authentication persona mappings
tags:
- Cloud Authentication
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/cloud_security_management/custom_frameworks:
post:
description: Create a custom framework.
Expand Down Expand Up @@ -96576,6 +96668,9 @@ tags:
Management page](https://docs.datadoghq.com/service_management/case_management/)
for more information.
name: Case Management Type
- description: Configure AWS cloud authentication mappings for persona and intake
authentication through the Datadog API.
name: Cloud Authentication
- description: The Cloud Cost Management API allows you to set up, edit, and delete
Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query
your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// List AWS cloud authentication persona mappings returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudAuthenticationApi;
import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listAWSCloudAuthPersonaMappings", true);
CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient);

try {
AWSCloudAuthPersonaMappingsResponse result = apiInstance.listAWSCloudAuthPersonaMappings();
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling CloudAuthenticationApi#listAWSCloudAuthPersonaMappings");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
1 change: 1 addition & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ public class ApiClient {
put("v2.getOpenAPI", false);
put("v2.listAPIs", false);
put("v2.updateOpenAPI", false);
put("v2.listAWSCloudAuthPersonaMappings", false);
put("v2.attachJiraIssue", false);
put("v2.cancelThreatHuntingJob", false);
put("v2.convertJobResultToSignal", false);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
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.AWSCloudAuthPersonaMappingsResponse;
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 CloudAuthenticationApi {
private ApiClient apiClient;

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

public CloudAuthenticationApi(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;
}

/**
* List AWS cloud authentication persona mappings.
*
* <p>See {@link #listAWSCloudAuthPersonaMappingsWithHttpInfo}.
*
* @return AWSCloudAuthPersonaMappingsResponse
* @throws ApiException if fails to make API call
*/
public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() throws ApiException {
return listAWSCloudAuthPersonaMappingsWithHttpInfo().getData();
}

/**
* List AWS cloud authentication persona mappings.
*
* <p>See {@link #listAWSCloudAuthPersonaMappingsWithHttpInfoAsync}.
*
* @return CompletableFuture&lt;AWSCloudAuthPersonaMappingsResponse&gt;
*/
public CompletableFuture<AWSCloudAuthPersonaMappingsResponse>
listAWSCloudAuthPersonaMappingsAsync() {
return listAWSCloudAuthPersonaMappingsWithHttpInfoAsync()
.thenApply(
response -> {
return response.getData();
});
}

/**
* List all AWS cloud authentication persona mappings. This endpoint retrieves all configured
* persona mappings that associate AWS IAM principals with Datadog users.
*
* @return ApiResponse&lt;AWSCloudAuthPersonaMappingsResponse&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> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<AWSCloudAuthPersonaMappingsResponse>
listAWSCloudAuthPersonaMappingsWithHttpInfo() throws ApiException {
// Check if unstable operation is enabled
String operationId = "listAWSCloudAuthPersonaMappings";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/cloud_auth/aws/persona_mapping";

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

Invocation.Builder builder =
apiClient.createBuilder(
"v2.CloudAuthenticationApi.listAWSCloudAuthPersonaMappings",
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<AWSCloudAuthPersonaMappingsResponse>() {});
}

/**
* List AWS cloud authentication persona mappings.
*
* <p>See {@link #listAWSCloudAuthPersonaMappingsWithHttpInfo}.
*
* @return CompletableFuture&lt;ApiResponse&lt;AWSCloudAuthPersonaMappingsResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<AWSCloudAuthPersonaMappingsResponse>>
listAWSCloudAuthPersonaMappingsWithHttpInfoAsync() {
// Check if unstable operation is enabled
String operationId = "listAWSCloudAuthPersonaMappings";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<AWSCloudAuthPersonaMappingsResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/cloud_auth/aws/persona_mapping";

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

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