diff --git a/.apigentools-info b/.apigentools-info index 5b108c95f2f..dd9f648f459 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-16 18:27:49.012621", - "spec_repo_commit": "a179b579" + "regenerated": "2024-12-16 19:15:38.418914", + "spec_repo_commit": "162aece5" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-16 18:27:49.028559", - "spec_repo_commit": "a179b579" + "regenerated": "2024-12-16 19:15:38.433437", + "spec_repo_commit": "162aece5" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3cfa378a53b..5d4184e4f2e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4339,6 +4339,34 @@ components: from the other indexes type: string type: object + CSMAgentsMetadata: + description: Metadata related to the paginated response. + properties: + page_index: + description: The index of the current page in the paginated results. + example: 0 + format: int64 + type: integer + page_size: + description: The number of items per page in the paginated results. + example: 10 + format: int64 + type: integer + total_filtered: + description: Total number of items that match the filter criteria. + example: 128697 + format: int64 + type: integer + type: object + CSMAgentsType: + default: datadog_agent + description: The type of the resource. The value should always be `datadog_agent`. + enum: + - datadog_agent + example: datadog_agent + type: string + x-enum-varnames: + - DATADOG_AGENT CalculatedField: description: Calculated field. properties: @@ -6630,6 +6658,96 @@ components: nullable: true type: string type: object + CsmAgentData: + description: Single Agent Data. + properties: + attributes: + $ref: '#/components/schemas/CsmAgentsAttributes' + id: + description: The ID of the Agent. + example: fffffc5505f6a006fdf7cf5aae053653 + type: string + type: + $ref: '#/components/schemas/CSMAgentsType' + type: object + CsmAgentsAttributes: + description: A CSM Agent returned by the API. + properties: + agent_version: + description: Version of the Datadog Agent. + type: string + aws_fargate: + description: AWS Fargate details. + type: string + cluster_name: + description: List of cluster names associated with the Agent. + items: + type: string + type: array + datadog_agent: + description: Unique identifier for the Datadog Agent. + type: string + ecs_fargate_task_arn: + description: ARN of the ECS Fargate task. + type: string + envs: + description: List of environments associated with the Agent. + items: + type: string + nullable: true + type: array + host_id: + description: ID of the host. + format: int64 + type: integer + hostname: + description: Name of the host. + type: string + install_method_installer_version: + description: Version of the installer used for installing the Datadog Agent. + type: string + install_method_tool: + description: Tool used for installing the Datadog Agent. + type: string + is_csm_vm_containers_enabled: + description: Indicates if CSM VM Containers is enabled. + nullable: true + type: boolean + is_csm_vm_hosts_enabled: + description: Indicates if CSM VM Hosts is enabled. + nullable: true + type: boolean + is_cspm_enabled: + description: Indicates if CSPM is enabled. + nullable: true + type: boolean + is_cws_enabled: + description: Indicates if CWS is enabled. + nullable: true + type: boolean + is_cws_remote_configuration_enabled: + description: Indicates if CWS Remote Configuration is enabled. + nullable: true + type: boolean + is_remote_configuration_enabled: + description: Indicates if Remote Configuration is enabled. + nullable: true + type: boolean + os: + description: Operating system of the host. + type: string + type: object + CsmAgentsResponse: + description: Response object that includes a list of CSM Agents. + properties: + data: + description: A list of Agents. + items: + $ref: '#/components/schemas/CsmAgentData' + type: array + meta: + $ref: '#/components/schemas/CSMAgentsMetadata' + type: object CustomCostGetResponseMeta: description: Meta for the response from the Get Custom Costs endpoints. properties: @@ -17704,6 +17822,16 @@ components: required: - data type: object + OrderDirection: + description: The sort direction for results. + enum: + - asc + - desc + example: asc + type: string + x-enum-varnames: + - ASC + - DESC OrgConfigGetResponse: description: A response with a single Org Config. properties: @@ -30922,6 +31050,113 @@ paths: x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/csm/onboarding/agents: + get: + description: Get the list of all CSM Agents running on your hosts and containers. + operationId: ListAllCSMAgents + parameters: + - description: The page index for pagination (zero-based). + in: query + name: page + required: false + schema: + example: 2 + format: int32 + maximum: 1000000 + minimum: 0 + type: integer + - description: The number of items to include in a single page. + in: query + name: size + required: false + schema: + example: 12 + format: int32 + maximum: 100 + minimum: 0 + type: integer + - description: A search query string to filter results (for example, `hostname:COMP-T2H4J27423`). + in: query + name: query + required: false + schema: + example: hostname:COMP-T2H4J27423 + type: string + - description: The sort direction for results. Use `asc` for ascending or `desc` + for descending. + in: query + name: order_direction + required: false + schema: + $ref: '#/components/schemas/OrderDirection' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CsmAgentsResponse' + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all CSM Agents + tags: + - CSM Agents + /api/v2/csm/onboarding/serverless/agents: + get: + description: Get the list of all CSM Serverless Agents running on your hosts + and containers. + operationId: ListAllCSMServerlessAgents + parameters: + - description: The page index for pagination (zero-based). + in: query + name: page + required: false + schema: + example: 2 + format: int32 + maximum: 1000000 + minimum: 0 + type: integer + - description: The number of items to include in a single page. + in: query + name: size + required: false + schema: + example: 12 + format: int32 + maximum: 100 + minimum: 0 + type: integer + - description: A search query string to filter results (for example, `hostname:COMP-T2H4J27423`). + in: query + name: query + required: false + schema: + example: hostname:COMP-T2H4J27423 + type: string + - description: The sort direction for results. Use `asc` for ascending or `desc` + for descending. + in: query + name: order_direction + required: false + schema: + $ref: '#/components/schemas/OrderDirection' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CsmAgentsResponse' + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all CSM Serverless Agents + tags: + - CSM Agents /api/v2/current_user/application_keys: get: description: List all application keys available for current user @@ -44624,6 +44859,15 @@ tags: [Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for more information. name: CI Visibility Tests +- description: 'Datadog Cloud Security Management (CSM) delivers real-time threat + detection + + and continuous configuration audits across your entire cloud infrastructure, + + all in a unified view for seamless collaboration and faster remediation. + + Go to https://docs.datadoghq.com/security/cloud_security_management to learn more' + name: CSM Agents - description: Cloud Security Management Threats (CSM Threats) monitors file, network, and process activity across your environment to detect real-time threats to your infrastructure. See [Cloud Security Management Threats](https://docs.datadoghq.com/security/threats/) diff --git a/examples/v2/csm-agents/ListAllCSMAgents.java b/examples/v2/csm-agents/ListAllCSMAgents.java new file mode 100644 index 00000000000..b25ff8ecc52 --- /dev/null +++ b/examples/v2/csm-agents/ListAllCSMAgents.java @@ -0,0 +1,24 @@ +// Get all CSM Agents returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CsmAgentsApi; +import com.datadog.api.client.v2.model.CsmAgentsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CsmAgentsApi apiInstance = new CsmAgentsApi(defaultClient); + + try { + CsmAgentsResponse result = apiInstance.listAllCSMAgents(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CsmAgentsApi#listAllCSMAgents"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/csm-agents/ListAllCSMServerlessAgents.java b/examples/v2/csm-agents/ListAllCSMServerlessAgents.java new file mode 100644 index 00000000000..1894d69ccc7 --- /dev/null +++ b/examples/v2/csm-agents/ListAllCSMServerlessAgents.java @@ -0,0 +1,24 @@ +// Get all CSM Serverless Agents returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CsmAgentsApi; +import com.datadog.api.client.v2.model.CsmAgentsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CsmAgentsApi apiInstance = new CsmAgentsApi(defaultClient); + + try { + CsmAgentsResponse result = apiInstance.listAllCSMServerlessAgents(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CsmAgentsApi#listAllCSMServerlessAgents"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/CsmAgentsApi.java b/src/main/java/com/datadog/api/client/v2/api/CsmAgentsApi.java new file mode 100644 index 00000000000..5d5a755e695 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/CsmAgentsApi.java @@ -0,0 +1,488 @@ +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.CsmAgentsResponse; +import com.datadog.api.client.v2.model.OrderDirection; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +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 CsmAgentsApi { + private ApiClient apiClient; + + public CsmAgentsApi() { + this(ApiClient.getDefaultApiClient()); + } + + public CsmAgentsApi(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; + } + + /** Manage optional parameters to listAllCSMAgents. */ + public static class ListAllCSMAgentsOptionalParameters { + private Integer page; + private Integer size; + private String query; + private OrderDirection orderDirection; + + /** + * Set page. + * + * @param page The page index for pagination (zero-based). (optional) + * @return ListAllCSMAgentsOptionalParameters + */ + public ListAllCSMAgentsOptionalParameters page(Integer page) { + this.page = page; + return this; + } + + /** + * Set size. + * + * @param size The number of items to include in a single page. (optional) + * @return ListAllCSMAgentsOptionalParameters + */ + public ListAllCSMAgentsOptionalParameters size(Integer size) { + this.size = size; + return this; + } + + /** + * Set query. + * + * @param query A search query string to filter results (for example, + * hostname:COMP-T2H4J27423). (optional) + * @return ListAllCSMAgentsOptionalParameters + */ + public ListAllCSMAgentsOptionalParameters query(String query) { + this.query = query; + return this; + } + + /** + * Set orderDirection. + * + * @param orderDirection The sort direction for results. Use asc for ascending or + * desc for descending. (optional) + * @return ListAllCSMAgentsOptionalParameters + */ + public ListAllCSMAgentsOptionalParameters orderDirection(OrderDirection orderDirection) { + this.orderDirection = orderDirection; + return this; + } + } + + /** + * Get all CSM Agents. + * + *

See {@link #listAllCSMAgentsWithHttpInfo}. + * + * @return CsmAgentsResponse + * @throws ApiException if fails to make API call + */ + public CsmAgentsResponse listAllCSMAgents() throws ApiException { + return listAllCSMAgentsWithHttpInfo(new ListAllCSMAgentsOptionalParameters()).getData(); + } + + /** + * Get all CSM Agents. + * + *

See {@link #listAllCSMAgentsWithHttpInfoAsync}. + * + * @return CompletableFuture<CsmAgentsResponse> + */ + public CompletableFuture listAllCSMAgentsAsync() { + return listAllCSMAgentsWithHttpInfoAsync(new ListAllCSMAgentsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all CSM Agents. + * + *

See {@link #listAllCSMAgentsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CsmAgentsResponse + * @throws ApiException if fails to make API call + */ + public CsmAgentsResponse listAllCSMAgents(ListAllCSMAgentsOptionalParameters parameters) + throws ApiException { + return listAllCSMAgentsWithHttpInfo(parameters).getData(); + } + + /** + * Get all CSM Agents. + * + *

See {@link #listAllCSMAgentsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CsmAgentsResponse> + */ + public CompletableFuture listAllCSMAgentsAsync( + ListAllCSMAgentsOptionalParameters parameters) { + return listAllCSMAgentsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of all CSM Agents running on your hosts and containers. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<CsmAgentsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse listAllCSMAgentsWithHttpInfo( + ListAllCSMAgentsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Integer page = parameters.page; + Integer size = parameters.size; + String query = parameters.query; + OrderDirection orderDirection = parameters.orderDirection; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/agents"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "order_direction", orderDirection)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CsmAgentsApi.listAllCSMAgents", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all CSM Agents. + * + *

See {@link #listAllCSMAgentsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CsmAgentsResponse>> + */ + public CompletableFuture> listAllCSMAgentsWithHttpInfoAsync( + ListAllCSMAgentsOptionalParameters parameters) { + Object localVarPostBody = null; + Integer page = parameters.page; + Integer size = parameters.size; + String query = parameters.query; + OrderDirection orderDirection = parameters.orderDirection; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/agents"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "order_direction", orderDirection)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CsmAgentsApi.listAllCSMAgents", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listAllCSMServerlessAgents. */ + public static class ListAllCSMServerlessAgentsOptionalParameters { + private Integer page; + private Integer size; + private String query; + private OrderDirection orderDirection; + + /** + * Set page. + * + * @param page The page index for pagination (zero-based). (optional) + * @return ListAllCSMServerlessAgentsOptionalParameters + */ + public ListAllCSMServerlessAgentsOptionalParameters page(Integer page) { + this.page = page; + return this; + } + + /** + * Set size. + * + * @param size The number of items to include in a single page. (optional) + * @return ListAllCSMServerlessAgentsOptionalParameters + */ + public ListAllCSMServerlessAgentsOptionalParameters size(Integer size) { + this.size = size; + return this; + } + + /** + * Set query. + * + * @param query A search query string to filter results (for example, + * hostname:COMP-T2H4J27423). (optional) + * @return ListAllCSMServerlessAgentsOptionalParameters + */ + public ListAllCSMServerlessAgentsOptionalParameters query(String query) { + this.query = query; + return this; + } + + /** + * Set orderDirection. + * + * @param orderDirection The sort direction for results. Use asc for ascending or + * desc for descending. (optional) + * @return ListAllCSMServerlessAgentsOptionalParameters + */ + public ListAllCSMServerlessAgentsOptionalParameters orderDirection( + OrderDirection orderDirection) { + this.orderDirection = orderDirection; + return this; + } + } + + /** + * Get all CSM Serverless Agents. + * + *

See {@link #listAllCSMServerlessAgentsWithHttpInfo}. + * + * @return CsmAgentsResponse + * @throws ApiException if fails to make API call + */ + public CsmAgentsResponse listAllCSMServerlessAgents() throws ApiException { + return listAllCSMServerlessAgentsWithHttpInfo( + new ListAllCSMServerlessAgentsOptionalParameters()) + .getData(); + } + + /** + * Get all CSM Serverless Agents. + * + *

See {@link #listAllCSMServerlessAgentsWithHttpInfoAsync}. + * + * @return CompletableFuture<CsmAgentsResponse> + */ + public CompletableFuture listAllCSMServerlessAgentsAsync() { + return listAllCSMServerlessAgentsWithHttpInfoAsync( + new ListAllCSMServerlessAgentsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all CSM Serverless Agents. + * + *

See {@link #listAllCSMServerlessAgentsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CsmAgentsResponse + * @throws ApiException if fails to make API call + */ + public CsmAgentsResponse listAllCSMServerlessAgents( + ListAllCSMServerlessAgentsOptionalParameters parameters) throws ApiException { + return listAllCSMServerlessAgentsWithHttpInfo(parameters).getData(); + } + + /** + * Get all CSM Serverless Agents. + * + *

See {@link #listAllCSMServerlessAgentsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CsmAgentsResponse> + */ + public CompletableFuture listAllCSMServerlessAgentsAsync( + ListAllCSMServerlessAgentsOptionalParameters parameters) { + return listAllCSMServerlessAgentsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of all CSM Serverless Agents running on your hosts and containers. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<CsmAgentsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse listAllCSMServerlessAgentsWithHttpInfo( + ListAllCSMServerlessAgentsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Integer page = parameters.page; + Integer size = parameters.size; + String query = parameters.query; + OrderDirection orderDirection = parameters.orderDirection; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/serverless/agents"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "order_direction", orderDirection)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CsmAgentsApi.listAllCSMServerlessAgents", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all CSM Serverless Agents. + * + *

See {@link #listAllCSMServerlessAgentsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CsmAgentsResponse>> + */ + public CompletableFuture> + listAllCSMServerlessAgentsWithHttpInfoAsync( + ListAllCSMServerlessAgentsOptionalParameters parameters) { + Object localVarPostBody = null; + Integer page = parameters.page; + Integer size = parameters.size; + String query = parameters.query; + OrderDirection orderDirection = parameters.orderDirection; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/serverless/agents"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "order_direction", orderDirection)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CsmAgentsApi.listAllCSMServerlessAgents", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CSMAgentsMetadata.java b/src/main/java/com/datadog/api/client/v2/model/CSMAgentsMetadata.java new file mode 100644 index 00000000000..200e9aec45c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CSMAgentsMetadata.java @@ -0,0 +1,191 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata related to the paginated response. */ +@JsonPropertyOrder({ + CSMAgentsMetadata.JSON_PROPERTY_PAGE_INDEX, + CSMAgentsMetadata.JSON_PROPERTY_PAGE_SIZE, + CSMAgentsMetadata.JSON_PROPERTY_TOTAL_FILTERED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CSMAgentsMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE_INDEX = "page_index"; + private Long pageIndex; + + public static final String JSON_PROPERTY_PAGE_SIZE = "page_size"; + private Long pageSize; + + public static final String JSON_PROPERTY_TOTAL_FILTERED = "total_filtered"; + private Long totalFiltered; + + public CSMAgentsMetadata pageIndex(Long pageIndex) { + this.pageIndex = pageIndex; + return this; + } + + /** + * The index of the current page in the paginated results. + * + * @return pageIndex + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Long pageIndex) { + this.pageIndex = pageIndex; + } + + public CSMAgentsMetadata pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The number of items per page in the paginated results. + * + * @return pageSize + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPageSize() { + return pageSize; + } + + public void setPageSize(Long pageSize) { + this.pageSize = pageSize; + } + + public CSMAgentsMetadata totalFiltered(Long totalFiltered) { + this.totalFiltered = totalFiltered; + return this; + } + + /** + * Total number of items that match the filter criteria. + * + * @return totalFiltered + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_FILTERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalFiltered() { + return totalFiltered; + } + + public void setTotalFiltered(Long totalFiltered) { + this.totalFiltered = totalFiltered; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CSMAgentsMetadata + */ + @JsonAnySetter + public CSMAgentsMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CSMAgentsMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CSMAgentsMetadata csmAgentsMetadata = (CSMAgentsMetadata) o; + return Objects.equals(this.pageIndex, csmAgentsMetadata.pageIndex) + && Objects.equals(this.pageSize, csmAgentsMetadata.pageSize) + && Objects.equals(this.totalFiltered, csmAgentsMetadata.totalFiltered) + && Objects.equals(this.additionalProperties, csmAgentsMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pageIndex, pageSize, totalFiltered, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CSMAgentsMetadata {\n"); + sb.append(" pageIndex: ").append(toIndentedString(pageIndex)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" totalFiltered: ").append(toIndentedString(totalFiltered)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CSMAgentsType.java b/src/main/java/com/datadog/api/client/v2/model/CSMAgentsType.java new file mode 100644 index 00000000000..b359676b938 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CSMAgentsType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of the resource. The value should always be datadog_agent. */ +@JsonSerialize(using = CSMAgentsType.CSMAgentsTypeSerializer.class) +public class CSMAgentsType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("datadog_agent")); + + public static final CSMAgentsType DATADOG_AGENT = new CSMAgentsType("datadog_agent"); + + CSMAgentsType(String value) { + super(value, allowedValues); + } + + public static class CSMAgentsTypeSerializer extends StdSerializer { + public CSMAgentsTypeSerializer(Class t) { + super(t); + } + + public CSMAgentsTypeSerializer() { + this(null); + } + + @Override + public void serialize(CSMAgentsType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CSMAgentsType fromValue(String value) { + return new CSMAgentsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CsmAgentData.java b/src/main/java/com/datadog/api/client/v2/model/CsmAgentData.java new file mode 100644 index 00000000000..cb0830e6bd1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmAgentData.java @@ -0,0 +1,196 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Single Agent Data. */ +@JsonPropertyOrder({ + CsmAgentData.JSON_PROPERTY_ATTRIBUTES, + CsmAgentData.JSON_PROPERTY_ID, + CsmAgentData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmAgentData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CsmAgentsAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CSMAgentsType type = CSMAgentsType.DATADOG_AGENT; + + public CsmAgentData attributes(CsmAgentsAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * A CSM Agent returned by the API. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmAgentsAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CsmAgentsAttributes attributes) { + this.attributes = attributes; + } + + public CsmAgentData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the Agent. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CsmAgentData type(CSMAgentsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be datadog_agent. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CSMAgentsType getType() { + return type; + } + + public void setType(CSMAgentsType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CsmAgentData + */ + @JsonAnySetter + public CsmAgentData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CsmAgentData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmAgentData csmAgentData = (CsmAgentData) o; + return Objects.equals(this.attributes, csmAgentData.attributes) + && Objects.equals(this.id, csmAgentData.id) + && Objects.equals(this.type, csmAgentData.type) + && Objects.equals(this.additionalProperties, csmAgentData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmAgentData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CsmAgentsAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CsmAgentsAttributes.java new file mode 100644 index 00000000000..74b63c1fb2e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmAgentsAttributes.java @@ -0,0 +1,705 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** A CSM Agent returned by the API. */ +@JsonPropertyOrder({ + CsmAgentsAttributes.JSON_PROPERTY_AGENT_VERSION, + CsmAgentsAttributes.JSON_PROPERTY_AWS_FARGATE, + CsmAgentsAttributes.JSON_PROPERTY_CLUSTER_NAME, + CsmAgentsAttributes.JSON_PROPERTY_DATADOG_AGENT, + CsmAgentsAttributes.JSON_PROPERTY_ECS_FARGATE_TASK_ARN, + CsmAgentsAttributes.JSON_PROPERTY_ENVS, + CsmAgentsAttributes.JSON_PROPERTY_HOST_ID, + CsmAgentsAttributes.JSON_PROPERTY_HOSTNAME, + CsmAgentsAttributes.JSON_PROPERTY_INSTALL_METHOD_INSTALLER_VERSION, + CsmAgentsAttributes.JSON_PROPERTY_INSTALL_METHOD_TOOL, + CsmAgentsAttributes.JSON_PROPERTY_IS_CSM_VM_CONTAINERS_ENABLED, + CsmAgentsAttributes.JSON_PROPERTY_IS_CSM_VM_HOSTS_ENABLED, + CsmAgentsAttributes.JSON_PROPERTY_IS_CSPM_ENABLED, + CsmAgentsAttributes.JSON_PROPERTY_IS_CWS_ENABLED, + CsmAgentsAttributes.JSON_PROPERTY_IS_CWS_REMOTE_CONFIGURATION_ENABLED, + CsmAgentsAttributes.JSON_PROPERTY_IS_REMOTE_CONFIGURATION_ENABLED, + CsmAgentsAttributes.JSON_PROPERTY_OS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmAgentsAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGENT_VERSION = "agent_version"; + private String agentVersion; + + public static final String JSON_PROPERTY_AWS_FARGATE = "aws_fargate"; + private String awsFargate; + + public static final String JSON_PROPERTY_CLUSTER_NAME = "cluster_name"; + private List clusterName = null; + + public static final String JSON_PROPERTY_DATADOG_AGENT = "datadog_agent"; + private String datadogAgent; + + public static final String JSON_PROPERTY_ECS_FARGATE_TASK_ARN = "ecs_fargate_task_arn"; + private String ecsFargateTaskArn; + + public static final String JSON_PROPERTY_ENVS = "envs"; + private JsonNullable> envs = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_HOST_ID = "host_id"; + private Long hostId; + + public static final String JSON_PROPERTY_HOSTNAME = "hostname"; + private String hostname; + + public static final String JSON_PROPERTY_INSTALL_METHOD_INSTALLER_VERSION = + "install_method_installer_version"; + private String installMethodInstallerVersion; + + public static final String JSON_PROPERTY_INSTALL_METHOD_TOOL = "install_method_tool"; + private String installMethodTool; + + public static final String JSON_PROPERTY_IS_CSM_VM_CONTAINERS_ENABLED = + "is_csm_vm_containers_enabled"; + private JsonNullable isCsmVmContainersEnabled = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_CSM_VM_HOSTS_ENABLED = "is_csm_vm_hosts_enabled"; + private JsonNullable isCsmVmHostsEnabled = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_CSPM_ENABLED = "is_cspm_enabled"; + private JsonNullable isCspmEnabled = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_CWS_ENABLED = "is_cws_enabled"; + private JsonNullable isCwsEnabled = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_CWS_REMOTE_CONFIGURATION_ENABLED = + "is_cws_remote_configuration_enabled"; + private JsonNullable isCwsRemoteConfigurationEnabled = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_REMOTE_CONFIGURATION_ENABLED = + "is_remote_configuration_enabled"; + private JsonNullable isRemoteConfigurationEnabled = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_OS = "os"; + private String os; + + public CsmAgentsAttributes agentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Version of the Datadog Agent. + * + * @return agentVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGENT_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAgentVersion() { + return agentVersion; + } + + public void setAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + } + + public CsmAgentsAttributes awsFargate(String awsFargate) { + this.awsFargate = awsFargate; + return this; + } + + /** + * AWS Fargate details. + * + * @return awsFargate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_FARGATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAwsFargate() { + return awsFargate; + } + + public void setAwsFargate(String awsFargate) { + this.awsFargate = awsFargate; + } + + public CsmAgentsAttributes clusterName(List clusterName) { + this.clusterName = clusterName; + return this; + } + + public CsmAgentsAttributes addClusterNameItem(String clusterNameItem) { + if (this.clusterName == null) { + this.clusterName = new ArrayList<>(); + } + this.clusterName.add(clusterNameItem); + return this; + } + + /** + * List of cluster names associated with the Agent. + * + * @return clusterName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLUSTER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getClusterName() { + return clusterName; + } + + public void setClusterName(List clusterName) { + this.clusterName = clusterName; + } + + public CsmAgentsAttributes datadogAgent(String datadogAgent) { + this.datadogAgent = datadogAgent; + return this; + } + + /** + * Unique identifier for the Datadog Agent. + * + * @return datadogAgent + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATADOG_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDatadogAgent() { + return datadogAgent; + } + + public void setDatadogAgent(String datadogAgent) { + this.datadogAgent = datadogAgent; + } + + public CsmAgentsAttributes ecsFargateTaskArn(String ecsFargateTaskArn) { + this.ecsFargateTaskArn = ecsFargateTaskArn; + return this; + } + + /** + * ARN of the ECS Fargate task. + * + * @return ecsFargateTaskArn + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ECS_FARGATE_TASK_ARN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEcsFargateTaskArn() { + return ecsFargateTaskArn; + } + + public void setEcsFargateTaskArn(String ecsFargateTaskArn) { + this.ecsFargateTaskArn = ecsFargateTaskArn; + } + + public CsmAgentsAttributes envs(List envs) { + this.envs = JsonNullable.>of(envs); + return this; + } + + public CsmAgentsAttributes addEnvsItem(String envsItem) { + if (this.envs == null || !this.envs.isPresent()) { + this.envs = JsonNullable.>of(new ArrayList<>()); + } + try { + this.envs.get().add(envsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * List of environments associated with the Agent. + * + * @return envs + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getEnvs() { + return envs.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ENVS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getEnvs_JsonNullable() { + return envs; + } + + @JsonProperty(JSON_PROPERTY_ENVS) + public void setEnvs_JsonNullable(JsonNullable> envs) { + this.envs = envs; + } + + public void setEnvs(List envs) { + this.envs = JsonNullable.>of(envs); + } + + public CsmAgentsAttributes hostId(Long hostId) { + this.hostId = hostId; + return this; + } + + /** + * ID of the host. + * + * @return hostId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getHostId() { + return hostId; + } + + public void setHostId(Long hostId) { + this.hostId = hostId; + } + + public CsmAgentsAttributes hostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Name of the host. + * + * @return hostname + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOSTNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHostname() { + return hostname; + } + + public void setHostname(String hostname) { + this.hostname = hostname; + } + + public CsmAgentsAttributes installMethodInstallerVersion(String installMethodInstallerVersion) { + this.installMethodInstallerVersion = installMethodInstallerVersion; + return this; + } + + /** + * Version of the installer used for installing the Datadog Agent. + * + * @return installMethodInstallerVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTALL_METHOD_INSTALLER_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstallMethodInstallerVersion() { + return installMethodInstallerVersion; + } + + public void setInstallMethodInstallerVersion(String installMethodInstallerVersion) { + this.installMethodInstallerVersion = installMethodInstallerVersion; + } + + public CsmAgentsAttributes installMethodTool(String installMethodTool) { + this.installMethodTool = installMethodTool; + return this; + } + + /** + * Tool used for installing the Datadog Agent. + * + * @return installMethodTool + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTALL_METHOD_TOOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstallMethodTool() { + return installMethodTool; + } + + public void setInstallMethodTool(String installMethodTool) { + this.installMethodTool = installMethodTool; + } + + public CsmAgentsAttributes isCsmVmContainersEnabled(Boolean isCsmVmContainersEnabled) { + this.isCsmVmContainersEnabled = JsonNullable.of(isCsmVmContainersEnabled); + return this; + } + + /** + * Indicates if CSM VM Containers is enabled. + * + * @return isCsmVmContainersEnabled + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsCsmVmContainersEnabled() { + return isCsmVmContainersEnabled.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_CSM_VM_CONTAINERS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsCsmVmContainersEnabled_JsonNullable() { + return isCsmVmContainersEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_CSM_VM_CONTAINERS_ENABLED) + public void setIsCsmVmContainersEnabled_JsonNullable( + JsonNullable isCsmVmContainersEnabled) { + this.isCsmVmContainersEnabled = isCsmVmContainersEnabled; + } + + public void setIsCsmVmContainersEnabled(Boolean isCsmVmContainersEnabled) { + this.isCsmVmContainersEnabled = JsonNullable.of(isCsmVmContainersEnabled); + } + + public CsmAgentsAttributes isCsmVmHostsEnabled(Boolean isCsmVmHostsEnabled) { + this.isCsmVmHostsEnabled = JsonNullable.of(isCsmVmHostsEnabled); + return this; + } + + /** + * Indicates if CSM VM Hosts is enabled. + * + * @return isCsmVmHostsEnabled + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsCsmVmHostsEnabled() { + return isCsmVmHostsEnabled.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_CSM_VM_HOSTS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsCsmVmHostsEnabled_JsonNullable() { + return isCsmVmHostsEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_CSM_VM_HOSTS_ENABLED) + public void setIsCsmVmHostsEnabled_JsonNullable(JsonNullable isCsmVmHostsEnabled) { + this.isCsmVmHostsEnabled = isCsmVmHostsEnabled; + } + + public void setIsCsmVmHostsEnabled(Boolean isCsmVmHostsEnabled) { + this.isCsmVmHostsEnabled = JsonNullable.of(isCsmVmHostsEnabled); + } + + public CsmAgentsAttributes isCspmEnabled(Boolean isCspmEnabled) { + this.isCspmEnabled = JsonNullable.of(isCspmEnabled); + return this; + } + + /** + * Indicates if CSPM is enabled. + * + * @return isCspmEnabled + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsCspmEnabled() { + return isCspmEnabled.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_CSPM_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsCspmEnabled_JsonNullable() { + return isCspmEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_CSPM_ENABLED) + public void setIsCspmEnabled_JsonNullable(JsonNullable isCspmEnabled) { + this.isCspmEnabled = isCspmEnabled; + } + + public void setIsCspmEnabled(Boolean isCspmEnabled) { + this.isCspmEnabled = JsonNullable.of(isCspmEnabled); + } + + public CsmAgentsAttributes isCwsEnabled(Boolean isCwsEnabled) { + this.isCwsEnabled = JsonNullable.of(isCwsEnabled); + return this; + } + + /** + * Indicates if CWS is enabled. + * + * @return isCwsEnabled + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsCwsEnabled() { + return isCwsEnabled.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_CWS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsCwsEnabled_JsonNullable() { + return isCwsEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_CWS_ENABLED) + public void setIsCwsEnabled_JsonNullable(JsonNullable isCwsEnabled) { + this.isCwsEnabled = isCwsEnabled; + } + + public void setIsCwsEnabled(Boolean isCwsEnabled) { + this.isCwsEnabled = JsonNullable.of(isCwsEnabled); + } + + public CsmAgentsAttributes isCwsRemoteConfigurationEnabled( + Boolean isCwsRemoteConfigurationEnabled) { + this.isCwsRemoteConfigurationEnabled = + JsonNullable.of(isCwsRemoteConfigurationEnabled); + return this; + } + + /** + * Indicates if CWS Remote Configuration is enabled. + * + * @return isCwsRemoteConfigurationEnabled + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsCwsRemoteConfigurationEnabled() { + return isCwsRemoteConfigurationEnabled.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_CWS_REMOTE_CONFIGURATION_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsCwsRemoteConfigurationEnabled_JsonNullable() { + return isCwsRemoteConfigurationEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_CWS_REMOTE_CONFIGURATION_ENABLED) + public void setIsCwsRemoteConfigurationEnabled_JsonNullable( + JsonNullable isCwsRemoteConfigurationEnabled) { + this.isCwsRemoteConfigurationEnabled = isCwsRemoteConfigurationEnabled; + } + + public void setIsCwsRemoteConfigurationEnabled(Boolean isCwsRemoteConfigurationEnabled) { + this.isCwsRemoteConfigurationEnabled = + JsonNullable.of(isCwsRemoteConfigurationEnabled); + } + + public CsmAgentsAttributes isRemoteConfigurationEnabled(Boolean isRemoteConfigurationEnabled) { + this.isRemoteConfigurationEnabled = JsonNullable.of(isRemoteConfigurationEnabled); + return this; + } + + /** + * Indicates if Remote Configuration is enabled. + * + * @return isRemoteConfigurationEnabled + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsRemoteConfigurationEnabled() { + return isRemoteConfigurationEnabled.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_REMOTE_CONFIGURATION_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsRemoteConfigurationEnabled_JsonNullable() { + return isRemoteConfigurationEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_REMOTE_CONFIGURATION_ENABLED) + public void setIsRemoteConfigurationEnabled_JsonNullable( + JsonNullable isRemoteConfigurationEnabled) { + this.isRemoteConfigurationEnabled = isRemoteConfigurationEnabled; + } + + public void setIsRemoteConfigurationEnabled(Boolean isRemoteConfigurationEnabled) { + this.isRemoteConfigurationEnabled = JsonNullable.of(isRemoteConfigurationEnabled); + } + + public CsmAgentsAttributes os(String os) { + this.os = os; + return this; + } + + /** + * Operating system of the host. + * + * @return os + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOs() { + return os; + } + + public void setOs(String os) { + this.os = os; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CsmAgentsAttributes + */ + @JsonAnySetter + public CsmAgentsAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CsmAgentsAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmAgentsAttributes csmAgentsAttributes = (CsmAgentsAttributes) o; + return Objects.equals(this.agentVersion, csmAgentsAttributes.agentVersion) + && Objects.equals(this.awsFargate, csmAgentsAttributes.awsFargate) + && Objects.equals(this.clusterName, csmAgentsAttributes.clusterName) + && Objects.equals(this.datadogAgent, csmAgentsAttributes.datadogAgent) + && Objects.equals(this.ecsFargateTaskArn, csmAgentsAttributes.ecsFargateTaskArn) + && Objects.equals(this.envs, csmAgentsAttributes.envs) + && Objects.equals(this.hostId, csmAgentsAttributes.hostId) + && Objects.equals(this.hostname, csmAgentsAttributes.hostname) + && Objects.equals( + this.installMethodInstallerVersion, csmAgentsAttributes.installMethodInstallerVersion) + && Objects.equals(this.installMethodTool, csmAgentsAttributes.installMethodTool) + && Objects.equals( + this.isCsmVmContainersEnabled, csmAgentsAttributes.isCsmVmContainersEnabled) + && Objects.equals(this.isCsmVmHostsEnabled, csmAgentsAttributes.isCsmVmHostsEnabled) + && Objects.equals(this.isCspmEnabled, csmAgentsAttributes.isCspmEnabled) + && Objects.equals(this.isCwsEnabled, csmAgentsAttributes.isCwsEnabled) + && Objects.equals( + this.isCwsRemoteConfigurationEnabled, + csmAgentsAttributes.isCwsRemoteConfigurationEnabled) + && Objects.equals( + this.isRemoteConfigurationEnabled, csmAgentsAttributes.isRemoteConfigurationEnabled) + && Objects.equals(this.os, csmAgentsAttributes.os) + && Objects.equals(this.additionalProperties, csmAgentsAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + agentVersion, + awsFargate, + clusterName, + datadogAgent, + ecsFargateTaskArn, + envs, + hostId, + hostname, + installMethodInstallerVersion, + installMethodTool, + isCsmVmContainersEnabled, + isCsmVmHostsEnabled, + isCspmEnabled, + isCwsEnabled, + isCwsRemoteConfigurationEnabled, + isRemoteConfigurationEnabled, + os, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmAgentsAttributes {\n"); + sb.append(" agentVersion: ").append(toIndentedString(agentVersion)).append("\n"); + sb.append(" awsFargate: ").append(toIndentedString(awsFargate)).append("\n"); + sb.append(" clusterName: ").append(toIndentedString(clusterName)).append("\n"); + sb.append(" datadogAgent: ").append(toIndentedString(datadogAgent)).append("\n"); + sb.append(" ecsFargateTaskArn: ").append(toIndentedString(ecsFargateTaskArn)).append("\n"); + sb.append(" envs: ").append(toIndentedString(envs)).append("\n"); + sb.append(" hostId: ").append(toIndentedString(hostId)).append("\n"); + sb.append(" hostname: ").append(toIndentedString(hostname)).append("\n"); + sb.append(" installMethodInstallerVersion: ") + .append(toIndentedString(installMethodInstallerVersion)) + .append("\n"); + sb.append(" installMethodTool: ").append(toIndentedString(installMethodTool)).append("\n"); + sb.append(" isCsmVmContainersEnabled: ") + .append(toIndentedString(isCsmVmContainersEnabled)) + .append("\n"); + sb.append(" isCsmVmHostsEnabled: ") + .append(toIndentedString(isCsmVmHostsEnabled)) + .append("\n"); + sb.append(" isCspmEnabled: ").append(toIndentedString(isCspmEnabled)).append("\n"); + sb.append(" isCwsEnabled: ").append(toIndentedString(isCwsEnabled)).append("\n"); + sb.append(" isCwsRemoteConfigurationEnabled: ") + .append(toIndentedString(isCwsRemoteConfigurationEnabled)) + .append("\n"); + sb.append(" isRemoteConfigurationEnabled: ") + .append(toIndentedString(isRemoteConfigurationEnabled)) + .append("\n"); + sb.append(" os: ").append(toIndentedString(os)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CsmAgentsResponse.java b/src/main/java/com/datadog/api/client/v2/model/CsmAgentsResponse.java new file mode 100644 index 00000000000..ea11ad485f0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmAgentsResponse.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response object that includes a list of CSM Agents. */ +@JsonPropertyOrder({CsmAgentsResponse.JSON_PROPERTY_DATA, CsmAgentsResponse.JSON_PROPERTY_META}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmAgentsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_META = "meta"; + private CSMAgentsMetadata meta; + + public CsmAgentsResponse data(List data) { + this.data = data; + for (CsmAgentData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CsmAgentsResponse addDataItem(CsmAgentData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of Agents. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public CsmAgentsResponse meta(CSMAgentsMetadata meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata related to the paginated response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CSMAgentsMetadata getMeta() { + return meta; + } + + public void setMeta(CSMAgentsMetadata meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CsmAgentsResponse + */ + @JsonAnySetter + public CsmAgentsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CsmAgentsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmAgentsResponse csmAgentsResponse = (CsmAgentsResponse) o; + return Objects.equals(this.data, csmAgentsResponse.data) + && Objects.equals(this.meta, csmAgentsResponse.meta) + && Objects.equals(this.additionalProperties, csmAgentsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmAgentsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OrderDirection.java b/src/main/java/com/datadog/api/client/v2/model/OrderDirection.java new file mode 100644 index 00000000000..9da47c80dee --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrderDirection.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The sort direction for results. */ +@JsonSerialize(using = OrderDirection.OrderDirectionSerializer.class) +public class OrderDirection extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("asc", "desc")); + + public static final OrderDirection ASC = new OrderDirection("asc"); + public static final OrderDirection DESC = new OrderDirection("desc"); + + OrderDirection(String value) { + super(value, allowedValues); + } + + public static class OrderDirectionSerializer extends StdSerializer { + public OrderDirectionSerializer(Class t) { + super(t); + } + + public OrderDirectionSerializer() { + this(null); + } + + @Override + public void serialize(OrderDirection value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OrderDirection fromValue(String value) { + return new OrderDirection(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Get_all_CSM_Agents_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_CSM_Agents_returns_OK_response.freeze new file mode 100644 index 00000000000..78ae32061e4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_CSM_Agents_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-13T17:22:57.344Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_CSM_Agents_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_CSM_Agents_returns_OK_response.json new file mode 100644 index 00000000000..218a7d0f0fa --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_CSM_Agents_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/csm/onboarding/agents", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"f3087801a44eba3c2ea706e873aee9e4\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.59.1\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":[\"pcf-vane-3512666\"],\"host_id\":29630727754,\"hostname\":\"datadog-cluster-agent-0-af63a3e6-4a25-4def-83a4-8754d185b3ef\",\"install_method_installer_version\":\"\",\"install_method_tool\":\"undefined\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}},{\"id\":\"d66d3bc7b9d4273183431b501ef33d86\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.59.1\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":[\"pcf-vane-3512666\"],\"host_id\":29623236313,\"hostname\":\"database-0-e7b70a7b-4199-4920-a8e3-62f221819522\",\"install_method_installer_version\":\"\",\"install_method_tool\":\"undefined\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}},{\"id\":\"c8eca433902d29dd748f93e413eb2a9d\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.59.1\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":[\"pcf-farm-3522782\"],\"host_id\":29722803807,\"hostname\":\"router-0-1bf8fdd0-bbc2-4cf3-8c7c-c1605bafa9bd\",\"install_method_installer_version\":\"\",\"install_method_tool\":\"undefined\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}},{\"id\":\"c6009fcea425da0722eeefd58d95ae6e\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.59.1\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":[\"pcf-vane-3512666\"],\"host_id\":29623808723,\"hostname\":\"compute-0-abf8a42e-5338-44e5-8048-658415893f3c\",\"install_method_installer_version\":\"\",\"install_method_tool\":\"undefined\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}},{\"id\":\"b5684ca6ace0e5eb757124a1bce8ad13\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.59.1\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":[\"pcf-nook-3513764\"],\"host_id\":29671027855,\"hostname\":\"database-0-805a7570-d3cf-4acc-97d8-c40ac88df896\",\"install_method_installer_version\":\"\",\"install_method_tool\":\"undefined\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}},{\"id\":\"b2432c7f30596064f765d9f2b400299e\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.59.1\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":[\"pcf-vane-3512666\"],\"host_id\":29623289233,\"hostname\":\"blobstore-0-2d6429ae-61a4-4d6d-a1be-1e6c20711d62\",\"install_method_installer_version\":\"\",\"install_method_tool\":\"undefined\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}},{\"id\":\"b18cbc65f97d10e2db319de9664e8136\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.59.1\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":[\"pcf-vane-3512666\"],\"host_id\":29623905136,\"hostname\":\"router-0-f84247ea-89db-459f-8db9-e19faaf118b9\",\"install_method_installer_version\":\"\",\"install_method_tool\":\"undefined\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}},{\"id\":\"a99fccb5f6f726754282ea7ff84269c3\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.62.0-devel+git.319.c819811\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":null,\"host_id\":15240413136,\"hostname\":\"comp-xctp773fw9\",\"install_method_installer_version\":\"docker\",\"install_method_tool\":\"docker\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}},{\"id\":\"a57d21e013a51ea0a3881ad7d4f1d7d1\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.59.1\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":[\"pcf-vane-3512666\"],\"host_id\":29630585934,\"hostname\":\"datadog-firehose-nozzle-0-d3f355d3-2839-441d-884b-9e7ee6c248a6\",\"install_method_installer_version\":\"\",\"install_method_tool\":\"undefined\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}},{\"id\":\"a43d2a3241ca97359058507a36800089\",\"type\":\"datadog_agent\",\"attributes\":{\"agent_version\":\"7.59.1\",\"aws_fargate\":\"\",\"cluster_name\":[\"\"],\"ecs_fargate_task_arn\":\"\",\"envs\":[\"pcf-nook-3513764\"],\"host_id\":29700921282,\"hostname\":\"datadog-firehose-nozzle-0-451fe766-caa2-4fb7-9198-076d2e1ef872\",\"install_method_installer_version\":\"\",\"install_method_tool\":\"undefined\",\"is_csm_vm_containers_enabled\":false,\"is_csm_vm_hosts_enabled\":false,\"is_cspm_enabled\":false,\"is_cws_enabled\":false,\"is_cws_remote_configuration_enabled\":true,\"is_remote_configuration_enabled\":true,\"os\":\"GNU/Linux\"}}],\"meta\":{\"total_filtered\":24,\"page_index\":0,\"page_size\":10}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cf844fd9-0c62-5183-3647-3aebfc1fbf5e" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_CSM_Serverless_Agents_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_CSM_Serverless_Agents_returns_OK_response.freeze new file mode 100644 index 00000000000..3be55cc6c68 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_CSM_Serverless_Agents_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-13T17:22:57.772Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_CSM_Serverless_Agents_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_CSM_Serverless_Agents_returns_OK_response.json new file mode 100644 index 00000000000..6d551ac5aec --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_CSM_Serverless_Agents_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/csm/onboarding/serverless/agents", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[],\"meta\":{\"total_filtered\":0,\"page_index\":0,\"page_size\":10}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a750672a-4df5-eaa9-4ba3-17512adae50d" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/container_images.feature b/src/test/resources/com/datadog/api/client/v2/api/container_images.feature index 8e9162526cf..ad6e1559bec 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/container_images.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/container_images.feature @@ -10,25 +10,25 @@ Feature: Container Images And an instance of "ContainerImages" API And new "ListContainerImages" request - @replay-only @team:DataDog/container-experiences + @replay-only @team:DataDog/processes Scenario: Get all Container Image groups returns "OK" response Given request contains "group_by" parameter with value "short_image" When the request is sent Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "test_name" - @generated @skip @team:DataDog/container-experiences + @generated @skip @team:DataDog/processes Scenario: Get all Container Images returns "Bad Request" response When the request is sent Then the response status is 400 Bad Request - @replay-only @team:DataDog/container-experiences + @replay-only @team:DataDog/processes Scenario: Get all Container Images returns "OK" response When the request is sent Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "test_name" - @replay-only @skip-validation @team:DataDog/container-experiences @with-pagination + @replay-only @skip-validation @team:DataDog/processes @with-pagination Scenario: Get all Container Images returns "OK" response with pagination Given request contains "page[size]" parameter with value 2 When the request with pagination is sent diff --git a/src/test/resources/com/datadog/api/client/v2/api/containers.feature b/src/test/resources/com/datadog/api/client/v2/api/containers.feature index 1e1e842371a..8149319237f 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/containers.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/containers.feature @@ -10,25 +10,25 @@ Feature: Containers And an instance of "Containers" API And new "ListContainers" request - @replay-only @team:DataDog/container-experiences + @replay-only @team:DataDog/processes Scenario: Get All Container groups returns "OK" response Given request contains "group_by" parameter with value "short_image" When the request is sent Then the response status is 200 OK And the response "data[0].attributes.count" is equal to 123 - @generated @skip @team:DataDog/container-experiences + @generated @skip @team:DataDog/processes Scenario: Get All Containers returns "Bad Request" response When the request is sent Then the response status is 400 Bad Request - @replay-only @team:DataDog/container-experiences + @replay-only @team:DataDog/processes Scenario: Get All Containers returns "OK" response When the request is sent Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "test_name" - @replay-only @skip-validation @team:DataDog/container-experiences @with-pagination + @replay-only @skip-validation @team:DataDog/processes @with-pagination Scenario: Get All Containers returns "OK" response with pagination Given request contains "page[size]" parameter with value 2 When the request with pagination is sent diff --git a/src/test/resources/com/datadog/api/client/v2/api/csm_agents.feature b/src/test/resources/com/datadog/api/client/v2/api/csm_agents.feature new file mode 100644 index 00000000000..49cde30aa90 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/csm_agents.feature @@ -0,0 +1,25 @@ +@endpoint(csm-agents) @endpoint(csm-agents-v2) +Feature: CSM Agents + Datadog Cloud Security Management (CSM) delivers real-time threat + detection and continuous configuration audits across your entire cloud + infrastructure, all in a unified view for seamless collaboration and + faster remediation. Go to + https://docs.datadoghq.com/security/cloud_security_management to learn + more + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CSMAgents" API + + @team:DataDog/k9-cloud-security-platform + Scenario: Get all CSM Agents returns "OK" response + Given new "ListAllCSMAgents" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/k9-cloud-security-platform + Scenario: Get all CSM Serverless Agents returns "OK" response + Given new "ListAllCSMServerlessAgents" request + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 9db842c40ad..8a00411a3b6 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -474,6 +474,18 @@ "type": "safe" } }, + "ListAllCSMAgents": { + "tag": "CSM Agents", + "undo": { + "type": "safe" + } + }, + "ListAllCSMServerlessAgents": { + "tag": "CSM Agents", + "undo": { + "type": "safe" + } + }, "ListCurrentUserApplicationKeys": { "tag": "Key Management", "undo": {