diff --git a/.apigentools-info b/.apigentools-info index f170baffcfc..1d0945d24a3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-03-31 17:40:02.508474", - "spec_repo_commit": "3826157e" + "regenerated": "2025-04-01 20:55:53.337536", + "spec_repo_commit": "f629f10b" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-03-31 17:40:02.523985", - "spec_repo_commit": "3826157e" + "regenerated": "2025-04-01 20:55:53.354938", + "spec_repo_commit": "f629f10b" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4aacf7eab58..d99088e0a32 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -30188,6 +30188,125 @@ components: description: Link to the Incident created on ServiceNow type: string type: object + SingleAggregatedConnectionResponseArray: + description: The definition of `SingleAggregatedConnectionResponseArray` object. + example: + data: + - attributes: + bytes_sent_by_client: 100 + bytes_sent_by_server: 200 + group_bys: + client_team: + - networks + server_service: + - hucklebuck + packets_sent_by_client: 10 + packets_sent_by_server: 20 + rtt_micro_seconds: 800 + tcp_closed_connections: 30 + tcp_established_connections: 40 + tcp_refusals: 7 + tcp_resets: 5 + tcp_retransmits: 30 + tcp_timeouts: 6 + id: client_team:networks, server_service:hucklebuck + type: aggregated_connection + properties: + data: + description: The `SingleAggregatedConnectionResponseArray` `data`. + items: + $ref: '#/components/schemas/SingleAggregatedConnectionResponseData' + type: array + type: object + SingleAggregatedConnectionResponseData: + description: The definition of `SingleAggregatedConnectionResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/SingleAggregatedConnectionResponseDataAttributes' + id: + description: The `SingleAggregatedConnectionResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/SingleAggregatedConnectionResponseDataType' + type: object + SingleAggregatedConnectionResponseDataAttributes: + description: The definition of `SingleAggregatedConnectionResponseDataAttributes` + object. + properties: + bytes_sent_by_client: + description: The total number of bytes sent by the client over the given + period. + format: int64 + type: integer + bytes_sent_by_server: + description: The total number of bytes sent by the server over the given + period. + format: int64 + type: integer + group_bys: + additionalProperties: + items: + type: string + type: array + description: The `attributes` `group_bys`. + type: object + packets_sent_by_client: + description: The total number of packets sent by the client over the given + period. + format: int64 + type: integer + packets_sent_by_server: + description: The total number of packets sent by the server over the given + period. + format: int64 + type: integer + rtt_micro_seconds: + description: Measured as TCP smoothed roundtrip time in microseconds (the + time between a TCP frame being sent and acknowledged). + format: int64 + type: integer + tcp_closed_connections: + description: The number of TCP connections in a closed state. Measured in + connections per second from the client. + format: int64 + type: integer + tcp_established_connections: + description: The number of TCP connections in an established state. Measured + in connections per second from the client. + format: int64 + type: integer + tcp_refusals: + description: The number of TCP connections that were refused by the server. + Typically this indicates an attempt to connect to an IP/port that is not + receiving connections, or a firewall/security misconfiguration. + format: int64 + type: integer + tcp_resets: + description: The number of TCP connections that were reset by the server. + format: int64 + type: integer + tcp_retransmits: + description: TCP Retransmits represent detected failures that are retransmitted + to ensure delivery. Measured in count of retransmits from the client. + format: int64 + type: integer + tcp_timeouts: + description: The number of TCP connections that timed out from the perspective + of the operating system. This can indicate general connectivity and latency + issues. + format: int64 + type: integer + type: object + SingleAggregatedConnectionResponseDataType: + default: aggregated_connection + description: 'Aggregated connection resource type. Allowed enum values: `aggregated_connection`. + + default: `aggregated_connection`' + enum: + - aggregated_connection + type: string + x-enum-varnames: + - AGGREGATED_CONNECTION SlackIntegrationMetadata: description: Incident integration metadata for the Slack integration. properties: @@ -44282,6 +44401,68 @@ paths: summary: Update the tags for a device tags: - Network Device Monitoring + /api/v2/network/connections/aggregate: + get: + description: Get aggregated connections + operationId: GetAggregatedConnections + parameters: + - description: Unix timestamp (number of seconds since epoch) of the start of + the query window. If not provided, the start of the query window is 15 minutes + before the "to" timestamp. If neither "from" nor "to" are provided, the + query window is [now - 15m, now]. + in: query + name: from + schema: + format: int64 + type: integer + - description: Unix timestamp (number of seconds since epoch) of the end of + the query window. If not provided, the end of the query window is the current + time. If neither "from" nor "to" are provided, the query window is [now + - 15m, now]. + in: query + name: to + schema: + format: int64 + type: integer + - description: Comma-separated list of fields to group connections by. + in: query + name: group_by + schema: + type: string + - description: Comma-separated list of tags to filter connections by. + in: query + name: tags + schema: + type: string + - description: The number of connections to be returned. The maximum value is + 5000. + in: query + name: limit + schema: + default: 100 + format: int32 + maximum: 5000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SingleAggregatedConnectionResponseArray' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get aggregated connections + tags: + - Cloud Network Monitoring + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/). + + type: safe' /api/v2/org_configs: get: description: Returns all Org Configs (name, description, and value). @@ -53624,6 +53805,10 @@ tags: and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/). name: Cloud Cost Management +- description: The Cloud Network Monitoring API allows you to fetch aggregated connections + and their attributes. See the [Cloud Network Monitoring page](https://docs.datadoghq.com/network_monitoring/cloud_network_monitoring/) + for more information. + name: Cloud Network Monitoring - description: Manage your Datadog Cloudflare integration directly through the Datadog API. See the [Cloudflare integration page](https://docs.datadoghq.com/integrations/cloudflare/) for more information. diff --git a/examples/v2/cloud-network-monitoring/GetAggregatedConnections.java b/examples/v2/cloud-network-monitoring/GetAggregatedConnections.java new file mode 100644 index 00000000000..91ae6e13dcc --- /dev/null +++ b/examples/v2/cloud-network-monitoring/GetAggregatedConnections.java @@ -0,0 +1,26 @@ +// Get aggregated connections returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudNetworkMonitoringApi; +import com.datadog.api.client.v2.model.SingleAggregatedConnectionResponseArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getAggregatedConnections", true); + CloudNetworkMonitoringApi apiInstance = new CloudNetworkMonitoringApi(defaultClient); + + try { + SingleAggregatedConnectionResponseArray result = apiInstance.getAggregatedConnections(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudNetworkMonitoringApi#getAggregatedConnections"); + 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/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index b1aa831fe23..3e0e7436dd7 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -408,6 +408,7 @@ public class ApiClient { put("v2.listAWSNamespaces", false); put("v2.updateAWSAccount", false); put("v2.listAWSLogsServices", false); + put("v2.getAggregatedConnections", false); put("v2.cancelHistoricalJob", false); put("v2.convertJobResultToSignal", false); put("v2.deleteHistoricalJob", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/CloudNetworkMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudNetworkMonitoringApi.java new file mode 100644 index 00000000000..c20cb4271d4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/CloudNetworkMonitoringApi.java @@ -0,0 +1,306 @@ +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.SingleAggregatedConnectionResponseArray; +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 CloudNetworkMonitoringApi { + private ApiClient apiClient; + + public CloudNetworkMonitoringApi() { + this(ApiClient.getDefaultApiClient()); + } + + public CloudNetworkMonitoringApi(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 getAggregatedConnections. */ + public static class GetAggregatedConnectionsOptionalParameters { + private Long from; + private Long to; + private String groupBy; + private String tags; + private Integer limit; + + /** + * Set from. + * + * @param from Unix timestamp (number of seconds since epoch) of the start of the query window. + * If not provided, the start of the query window is 15 minutes before the "to" timestamp. + * If neither "from" nor "to" are provided, the query window is [now - 15m, now]. (optional) + * @return GetAggregatedConnectionsOptionalParameters + */ + public GetAggregatedConnectionsOptionalParameters from(Long from) { + this.from = from; + return this; + } + + /** + * Set to. + * + * @param to Unix timestamp (number of seconds since epoch) of the end of the query window. If + * not provided, the end of the query window is the current time. If neither "from" nor "to" + * are provided, the query window is [now - 15m, now]. (optional) + * @return GetAggregatedConnectionsOptionalParameters + */ + public GetAggregatedConnectionsOptionalParameters to(Long to) { + this.to = to; + return this; + } + + /** + * Set groupBy. + * + * @param groupBy Comma-separated list of fields to group connections by. (optional) + * @return GetAggregatedConnectionsOptionalParameters + */ + public GetAggregatedConnectionsOptionalParameters groupBy(String groupBy) { + this.groupBy = groupBy; + return this; + } + + /** + * Set tags. + * + * @param tags Comma-separated list of tags to filter connections by. (optional) + * @return GetAggregatedConnectionsOptionalParameters + */ + public GetAggregatedConnectionsOptionalParameters tags(String tags) { + this.tags = tags; + return this; + } + + /** + * Set limit. + * + * @param limit The number of connections to be returned. The maximum value is 5000. (optional, + * default to 100) + * @return GetAggregatedConnectionsOptionalParameters + */ + public GetAggregatedConnectionsOptionalParameters limit(Integer limit) { + this.limit = limit; + return this; + } + } + + /** + * Get aggregated connections. + * + *

See {@link #getAggregatedConnectionsWithHttpInfo}. + * + * @return SingleAggregatedConnectionResponseArray + * @throws ApiException if fails to make API call + */ + public SingleAggregatedConnectionResponseArray getAggregatedConnections() throws ApiException { + return getAggregatedConnectionsWithHttpInfo(new GetAggregatedConnectionsOptionalParameters()) + .getData(); + } + + /** + * Get aggregated connections. + * + *

See {@link #getAggregatedConnectionsWithHttpInfoAsync}. + * + * @return CompletableFuture<SingleAggregatedConnectionResponseArray> + */ + public CompletableFuture + getAggregatedConnectionsAsync() { + return getAggregatedConnectionsWithHttpInfoAsync( + new GetAggregatedConnectionsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get aggregated connections. + * + *

See {@link #getAggregatedConnectionsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return SingleAggregatedConnectionResponseArray + * @throws ApiException if fails to make API call + */ + public SingleAggregatedConnectionResponseArray getAggregatedConnections( + GetAggregatedConnectionsOptionalParameters parameters) throws ApiException { + return getAggregatedConnectionsWithHttpInfo(parameters).getData(); + } + + /** + * Get aggregated connections. + * + *

See {@link #getAggregatedConnectionsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SingleAggregatedConnectionResponseArray> + */ + public CompletableFuture getAggregatedConnectionsAsync( + GetAggregatedConnectionsOptionalParameters parameters) { + return getAggregatedConnectionsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get aggregated connections + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<SingleAggregatedConnectionResponseArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse getAggregatedConnectionsWithHttpInfo( + GetAggregatedConnectionsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getAggregatedConnections"; + 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; + Long from = parameters.from; + Long to = parameters.to; + String groupBy = parameters.groupBy; + String tags = parameters.tags; + Integer limit = parameters.limit; + // create path and map variables + String localVarPath = "/api/v2/network/connections/aggregate"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_by", groupBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", tags)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudNetworkMonitoringApi.getAggregatedConnections", + 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 aggregated connections. + * + *

See {@link #getAggregatedConnectionsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SingleAggregatedConnectionResponseArray>> + */ + public CompletableFuture> + getAggregatedConnectionsWithHttpInfoAsync( + GetAggregatedConnectionsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getAggregatedConnections"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + Long from = parameters.from; + Long to = parameters.to; + String groupBy = parameters.groupBy; + String tags = parameters.tags; + Integer limit = parameters.limit; + // create path and map variables + String localVarPath = "/api/v2/network/connections/aggregate"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_by", groupBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", tags)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudNetworkMonitoringApi.getAggregatedConnections", + 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/SingleAggregatedConnectionResponseArray.java b/src/main/java/com/datadog/api/client/v2/model/SingleAggregatedConnectionResponseArray.java new file mode 100644 index 00000000000..55e6846b712 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SingleAggregatedConnectionResponseArray.java @@ -0,0 +1,154 @@ +/* + * 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; + +/** The definition of SingleAggregatedConnectionResponseArray object. */ +@JsonPropertyOrder({SingleAggregatedConnectionResponseArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SingleAggregatedConnectionResponseArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public SingleAggregatedConnectionResponseArray data( + List data) { + this.data = data; + for (SingleAggregatedConnectionResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SingleAggregatedConnectionResponseArray addDataItem( + SingleAggregatedConnectionResponseData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The SingleAggregatedConnectionResponseArray data. + * + * @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; + } + + /** + * 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 SingleAggregatedConnectionResponseArray + */ + @JsonAnySetter + public SingleAggregatedConnectionResponseArray 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 SingleAggregatedConnectionResponseArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SingleAggregatedConnectionResponseArray singleAggregatedConnectionResponseArray = + (SingleAggregatedConnectionResponseArray) o; + return Objects.equals(this.data, singleAggregatedConnectionResponseArray.data) + && Objects.equals( + this.additionalProperties, + singleAggregatedConnectionResponseArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SingleAggregatedConnectionResponseArray {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/SingleAggregatedConnectionResponseData.java b/src/main/java/com/datadog/api/client/v2/model/SingleAggregatedConnectionResponseData.java new file mode 100644 index 00000000000..59edd0586f5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SingleAggregatedConnectionResponseData.java @@ -0,0 +1,202 @@ +/* + * 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; + +/** The definition of SingleAggregatedConnectionResponseData object. */ +@JsonPropertyOrder({ + SingleAggregatedConnectionResponseData.JSON_PROPERTY_ATTRIBUTES, + SingleAggregatedConnectionResponseData.JSON_PROPERTY_ID, + SingleAggregatedConnectionResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SingleAggregatedConnectionResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SingleAggregatedConnectionResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SingleAggregatedConnectionResponseDataType type = + SingleAggregatedConnectionResponseDataType.AGGREGATED_CONNECTION; + + public SingleAggregatedConnectionResponseData attributes( + SingleAggregatedConnectionResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of SingleAggregatedConnectionResponseDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SingleAggregatedConnectionResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SingleAggregatedConnectionResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public SingleAggregatedConnectionResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The SingleAggregatedConnectionResponseData id. + * + * @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 SingleAggregatedConnectionResponseData type( + SingleAggregatedConnectionResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Aggregated connection resource type. Allowed enum values: aggregated_connection. + * default: aggregated_connection + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SingleAggregatedConnectionResponseDataType getType() { + return type; + } + + public void setType(SingleAggregatedConnectionResponseDataType 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 SingleAggregatedConnectionResponseData + */ + @JsonAnySetter + public SingleAggregatedConnectionResponseData 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 SingleAggregatedConnectionResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SingleAggregatedConnectionResponseData singleAggregatedConnectionResponseData = + (SingleAggregatedConnectionResponseData) o; + return Objects.equals(this.attributes, singleAggregatedConnectionResponseData.attributes) + && Objects.equals(this.id, singleAggregatedConnectionResponseData.id) + && Objects.equals(this.type, singleAggregatedConnectionResponseData.type) + && Objects.equals( + this.additionalProperties, singleAggregatedConnectionResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SingleAggregatedConnectionResponseData {\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/SingleAggregatedConnectionResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SingleAggregatedConnectionResponseDataAttributes.java new file mode 100644 index 00000000000..bfa7724641c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SingleAggregatedConnectionResponseDataAttributes.java @@ -0,0 +1,502 @@ +/* + * 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.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of SingleAggregatedConnectionResponseDataAttributes object. */ +@JsonPropertyOrder({ + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_BYTES_SENT_BY_CLIENT, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_BYTES_SENT_BY_SERVER, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_GROUP_BYS, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_PACKETS_SENT_BY_CLIENT, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_PACKETS_SENT_BY_SERVER, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_RTT_MICRO_SECONDS, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_TCP_CLOSED_CONNECTIONS, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_TCP_ESTABLISHED_CONNECTIONS, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_TCP_REFUSALS, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_TCP_RESETS, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_TCP_RETRANSMITS, + SingleAggregatedConnectionResponseDataAttributes.JSON_PROPERTY_TCP_TIMEOUTS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SingleAggregatedConnectionResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BYTES_SENT_BY_CLIENT = "bytes_sent_by_client"; + private Long bytesSentByClient; + + public static final String JSON_PROPERTY_BYTES_SENT_BY_SERVER = "bytes_sent_by_server"; + private Long bytesSentByServer; + + public static final String JSON_PROPERTY_GROUP_BYS = "group_bys"; + private Map> groupBys = null; + + public static final String JSON_PROPERTY_PACKETS_SENT_BY_CLIENT = "packets_sent_by_client"; + private Long packetsSentByClient; + + public static final String JSON_PROPERTY_PACKETS_SENT_BY_SERVER = "packets_sent_by_server"; + private Long packetsSentByServer; + + public static final String JSON_PROPERTY_RTT_MICRO_SECONDS = "rtt_micro_seconds"; + private Long rttMicroSeconds; + + public static final String JSON_PROPERTY_TCP_CLOSED_CONNECTIONS = "tcp_closed_connections"; + private Long tcpClosedConnections; + + public static final String JSON_PROPERTY_TCP_ESTABLISHED_CONNECTIONS = + "tcp_established_connections"; + private Long tcpEstablishedConnections; + + public static final String JSON_PROPERTY_TCP_REFUSALS = "tcp_refusals"; + private Long tcpRefusals; + + public static final String JSON_PROPERTY_TCP_RESETS = "tcp_resets"; + private Long tcpResets; + + public static final String JSON_PROPERTY_TCP_RETRANSMITS = "tcp_retransmits"; + private Long tcpRetransmits; + + public static final String JSON_PROPERTY_TCP_TIMEOUTS = "tcp_timeouts"; + private Long tcpTimeouts; + + public SingleAggregatedConnectionResponseDataAttributes bytesSentByClient( + Long bytesSentByClient) { + this.bytesSentByClient = bytesSentByClient; + return this; + } + + /** + * The total number of bytes sent by the client over the given period. + * + * @return bytesSentByClient + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BYTES_SENT_BY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getBytesSentByClient() { + return bytesSentByClient; + } + + public void setBytesSentByClient(Long bytesSentByClient) { + this.bytesSentByClient = bytesSentByClient; + } + + public SingleAggregatedConnectionResponseDataAttributes bytesSentByServer( + Long bytesSentByServer) { + this.bytesSentByServer = bytesSentByServer; + return this; + } + + /** + * The total number of bytes sent by the server over the given period. + * + * @return bytesSentByServer + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BYTES_SENT_BY_SERVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getBytesSentByServer() { + return bytesSentByServer; + } + + public void setBytesSentByServer(Long bytesSentByServer) { + this.bytesSentByServer = bytesSentByServer; + } + + public SingleAggregatedConnectionResponseDataAttributes groupBys( + Map> groupBys) { + this.groupBys = groupBys; + return this; + } + + public SingleAggregatedConnectionResponseDataAttributes putGroupBysItem( + String key, List groupBysItem) { + if (this.groupBys == null) { + this.groupBys = new HashMap<>(); + } + this.groupBys.put(key, groupBysItem); + return this; + } + + /** + * The attributes group_bys. + * + * @return groupBys + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_BYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getGroupBys() { + return groupBys; + } + + public void setGroupBys(Map> groupBys) { + this.groupBys = groupBys; + } + + public SingleAggregatedConnectionResponseDataAttributes packetsSentByClient( + Long packetsSentByClient) { + this.packetsSentByClient = packetsSentByClient; + return this; + } + + /** + * The total number of packets sent by the client over the given period. + * + * @return packetsSentByClient + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PACKETS_SENT_BY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPacketsSentByClient() { + return packetsSentByClient; + } + + public void setPacketsSentByClient(Long packetsSentByClient) { + this.packetsSentByClient = packetsSentByClient; + } + + public SingleAggregatedConnectionResponseDataAttributes packetsSentByServer( + Long packetsSentByServer) { + this.packetsSentByServer = packetsSentByServer; + return this; + } + + /** + * The total number of packets sent by the server over the given period. + * + * @return packetsSentByServer + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PACKETS_SENT_BY_SERVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPacketsSentByServer() { + return packetsSentByServer; + } + + public void setPacketsSentByServer(Long packetsSentByServer) { + this.packetsSentByServer = packetsSentByServer; + } + + public SingleAggregatedConnectionResponseDataAttributes rttMicroSeconds(Long rttMicroSeconds) { + this.rttMicroSeconds = rttMicroSeconds; + return this; + } + + /** + * Measured as TCP smoothed roundtrip time in microseconds (the time between a TCP frame being + * sent and acknowledged). + * + * @return rttMicroSeconds + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RTT_MICRO_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRttMicroSeconds() { + return rttMicroSeconds; + } + + public void setRttMicroSeconds(Long rttMicroSeconds) { + this.rttMicroSeconds = rttMicroSeconds; + } + + public SingleAggregatedConnectionResponseDataAttributes tcpClosedConnections( + Long tcpClosedConnections) { + this.tcpClosedConnections = tcpClosedConnections; + return this; + } + + /** + * The number of TCP connections in a closed state. Measured in connections per second from the + * client. + * + * @return tcpClosedConnections + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_CLOSED_CONNECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTcpClosedConnections() { + return tcpClosedConnections; + } + + public void setTcpClosedConnections(Long tcpClosedConnections) { + this.tcpClosedConnections = tcpClosedConnections; + } + + public SingleAggregatedConnectionResponseDataAttributes tcpEstablishedConnections( + Long tcpEstablishedConnections) { + this.tcpEstablishedConnections = tcpEstablishedConnections; + return this; + } + + /** + * The number of TCP connections in an established state. Measured in connections per second from + * the client. + * + * @return tcpEstablishedConnections + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_ESTABLISHED_CONNECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTcpEstablishedConnections() { + return tcpEstablishedConnections; + } + + public void setTcpEstablishedConnections(Long tcpEstablishedConnections) { + this.tcpEstablishedConnections = tcpEstablishedConnections; + } + + public SingleAggregatedConnectionResponseDataAttributes tcpRefusals(Long tcpRefusals) { + this.tcpRefusals = tcpRefusals; + return this; + } + + /** + * The number of TCP connections that were refused by the server. Typically this indicates an + * attempt to connect to an IP/port that is not receiving connections, or a firewall/security + * misconfiguration. + * + * @return tcpRefusals + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_REFUSALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTcpRefusals() { + return tcpRefusals; + } + + public void setTcpRefusals(Long tcpRefusals) { + this.tcpRefusals = tcpRefusals; + } + + public SingleAggregatedConnectionResponseDataAttributes tcpResets(Long tcpResets) { + this.tcpResets = tcpResets; + return this; + } + + /** + * The number of TCP connections that were reset by the server. + * + * @return tcpResets + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_RESETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTcpResets() { + return tcpResets; + } + + public void setTcpResets(Long tcpResets) { + this.tcpResets = tcpResets; + } + + public SingleAggregatedConnectionResponseDataAttributes tcpRetransmits(Long tcpRetransmits) { + this.tcpRetransmits = tcpRetransmits; + return this; + } + + /** + * TCP Retransmits represent detected failures that are retransmitted to ensure delivery. Measured + * in count of retransmits from the client. + * + * @return tcpRetransmits + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_RETRANSMITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTcpRetransmits() { + return tcpRetransmits; + } + + public void setTcpRetransmits(Long tcpRetransmits) { + this.tcpRetransmits = tcpRetransmits; + } + + public SingleAggregatedConnectionResponseDataAttributes tcpTimeouts(Long tcpTimeouts) { + this.tcpTimeouts = tcpTimeouts; + return this; + } + + /** + * The number of TCP connections that timed out from the perspective of the operating system. This + * can indicate general connectivity and latency issues. + * + * @return tcpTimeouts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_TIMEOUTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTcpTimeouts() { + return tcpTimeouts; + } + + public void setTcpTimeouts(Long tcpTimeouts) { + this.tcpTimeouts = tcpTimeouts; + } + + /** + * 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 SingleAggregatedConnectionResponseDataAttributes + */ + @JsonAnySetter + public SingleAggregatedConnectionResponseDataAttributes 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 SingleAggregatedConnectionResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SingleAggregatedConnectionResponseDataAttributes + singleAggregatedConnectionResponseDataAttributes = + (SingleAggregatedConnectionResponseDataAttributes) o; + return Objects.equals( + this.bytesSentByClient, + singleAggregatedConnectionResponseDataAttributes.bytesSentByClient) + && Objects.equals( + this.bytesSentByServer, + singleAggregatedConnectionResponseDataAttributes.bytesSentByServer) + && Objects.equals(this.groupBys, singleAggregatedConnectionResponseDataAttributes.groupBys) + && Objects.equals( + this.packetsSentByClient, + singleAggregatedConnectionResponseDataAttributes.packetsSentByClient) + && Objects.equals( + this.packetsSentByServer, + singleAggregatedConnectionResponseDataAttributes.packetsSentByServer) + && Objects.equals( + this.rttMicroSeconds, singleAggregatedConnectionResponseDataAttributes.rttMicroSeconds) + && Objects.equals( + this.tcpClosedConnections, + singleAggregatedConnectionResponseDataAttributes.tcpClosedConnections) + && Objects.equals( + this.tcpEstablishedConnections, + singleAggregatedConnectionResponseDataAttributes.tcpEstablishedConnections) + && Objects.equals( + this.tcpRefusals, singleAggregatedConnectionResponseDataAttributes.tcpRefusals) + && Objects.equals( + this.tcpResets, singleAggregatedConnectionResponseDataAttributes.tcpResets) + && Objects.equals( + this.tcpRetransmits, singleAggregatedConnectionResponseDataAttributes.tcpRetransmits) + && Objects.equals( + this.tcpTimeouts, singleAggregatedConnectionResponseDataAttributes.tcpTimeouts) + && Objects.equals( + this.additionalProperties, + singleAggregatedConnectionResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + bytesSentByClient, + bytesSentByServer, + groupBys, + packetsSentByClient, + packetsSentByServer, + rttMicroSeconds, + tcpClosedConnections, + tcpEstablishedConnections, + tcpRefusals, + tcpResets, + tcpRetransmits, + tcpTimeouts, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SingleAggregatedConnectionResponseDataAttributes {\n"); + sb.append(" bytesSentByClient: ").append(toIndentedString(bytesSentByClient)).append("\n"); + sb.append(" bytesSentByServer: ").append(toIndentedString(bytesSentByServer)).append("\n"); + sb.append(" groupBys: ").append(toIndentedString(groupBys)).append("\n"); + sb.append(" packetsSentByClient: ") + .append(toIndentedString(packetsSentByClient)) + .append("\n"); + sb.append(" packetsSentByServer: ") + .append(toIndentedString(packetsSentByServer)) + .append("\n"); + sb.append(" rttMicroSeconds: ").append(toIndentedString(rttMicroSeconds)).append("\n"); + sb.append(" tcpClosedConnections: ") + .append(toIndentedString(tcpClosedConnections)) + .append("\n"); + sb.append(" tcpEstablishedConnections: ") + .append(toIndentedString(tcpEstablishedConnections)) + .append("\n"); + sb.append(" tcpRefusals: ").append(toIndentedString(tcpRefusals)).append("\n"); + sb.append(" tcpResets: ").append(toIndentedString(tcpResets)).append("\n"); + sb.append(" tcpRetransmits: ").append(toIndentedString(tcpRetransmits)).append("\n"); + sb.append(" tcpTimeouts: ").append(toIndentedString(tcpTimeouts)).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/SingleAggregatedConnectionResponseDataType.java b/src/main/java/com/datadog/api/client/v2/model/SingleAggregatedConnectionResponseDataType.java new file mode 100644 index 00000000000..0f1c4fb94dc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SingleAggregatedConnectionResponseDataType.java @@ -0,0 +1,66 @@ +/* + * 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; + +/** + * Aggregated connection resource type. Allowed enum values: aggregated_connection. + * default: aggregated_connection + */ +@JsonSerialize( + using = + SingleAggregatedConnectionResponseDataType + .SingleAggregatedConnectionResponseDataTypeSerializer.class) +public class SingleAggregatedConnectionResponseDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("aggregated_connection")); + + public static final SingleAggregatedConnectionResponseDataType AGGREGATED_CONNECTION = + new SingleAggregatedConnectionResponseDataType("aggregated_connection"); + + SingleAggregatedConnectionResponseDataType(String value) { + super(value, allowedValues); + } + + public static class SingleAggregatedConnectionResponseDataTypeSerializer + extends StdSerializer { + public SingleAggregatedConnectionResponseDataTypeSerializer( + Class t) { + super(t); + } + + public SingleAggregatedConnectionResponseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SingleAggregatedConnectionResponseDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SingleAggregatedConnectionResponseDataType fromValue(String value) { + return new SingleAggregatedConnectionResponseDataType(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Get_aggregated_connections_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_aggregated_connections_returns_OK_response.freeze new file mode 100644 index 00000000000..ec3ccb6dc70 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_aggregated_connections_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-03-31T18:18:50.338Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_aggregated_connections_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_aggregated_connections_returns_OK_response.json new file mode 100644 index 00000000000..e19e47be475 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_aggregated_connections_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/network/connections/aggregate", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e6fa1daa-1a14-81fc-eb36-e24e11462296" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_aggregated_connections_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_aggregated_connections_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..ca4c2f607f7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_aggregated_connections_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-03-31T18:18:50.770Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_aggregated_connections_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_all_aggregated_connections_returns_Bad_Request_response.json new file mode 100644 index 00000000000..a20f598615c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_aggregated_connections_returns_Bad_Request_response.json @@ -0,0 +1,33 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/network/connections/aggregate", + "queryStringParameters": { + "limit": [ + "6000" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid limit\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7d2e1246-1286-3aeb-3175-ac7aac0c7e6c" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/cloud_network_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/cloud_network_monitoring.feature new file mode 100644 index 00000000000..2ae8e7cf2d0 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/cloud_network_monitoring.feature @@ -0,0 +1,29 @@ +@endpoint(cloud-network-monitoring) @endpoint(cloud-network-monitoring-v2) +Feature: Cloud Network Monitoring + The Cloud Network Monitoring API allows you to fetch aggregated + connections and their attributes. See the [Cloud Network Monitoring page]( + https://docs.datadoghq.com/network_monitoring/cloud_network_monitoring/) + for more information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CloudNetworkMonitoring" API + And operation "GetAggregatedConnections" enabled + And new "GetAggregatedConnections" request + + @generated @skip @team:Datadog/networks + Scenario: Get aggregated connections returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/networks + Scenario: Get aggregated connections returns "OK" response + When the request is sent + Then the response status is 200 OK + + @skip-python @skip-ruby @team:Datadog/networks + Scenario: Get all aggregated connections returns "Bad Request" response + Given request contains "limit" parameter with value 6000 + When the request is sent + Then the response status is 400 Bad Request 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 13df2998019..f8e2c4ef1bd 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 @@ -1744,6 +1744,12 @@ "type": "idempotent" } }, + "GetAggregatedConnections": { + "tag": "Cloud Network Monitoring", + "undo": { + "type": "safe" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": {