Skip to content

Add specs for Cloud Network Monitoring API #2124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-03-31 17:39:57.837620",
"spec_repo_commit": "3826157e"
"regenerated": "2025-04-01 20:56:02.087355",
"spec_repo_commit": "f629f10b"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-03-31 17:39:57.854596",
"spec_repo_commit": "3826157e"
"regenerated": "2025-04-01 20:56:02.103559",
"spec_repo_commit": "f629f10b"
}
}
}
185 changes: 185 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2025-03-31T18:18:50.338Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"log": {
"_recordingName": "Cloud Network Monitoring/Get aggregated connections returns \"OK\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "e6fa1daa1a1481fceb36e24e11462296",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
}
],
"headersSize": 534,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/network/connections/aggregate"
},
"response": {
"bodySize": 11,
"content": {
"mimeType": "application/vnd.api+json",
"size": 11,
"text": "{\"data\":[]}"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/vnd.api+json"
}
],
"headersSize": 524,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-03-31T18:18:50.572Z",
"time": 191
}
],
"pages": [],
"version": "1.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2025-03-31T18:18:50.770Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"log": {
"_recordingName": "Cloud Network Monitoring/Get all aggregated connections returns \"Bad Request\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "7d2e124612863aeb3175ac7aac0c7e6c",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
}
],
"headersSize": 545,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [
{
"name": "limit",
"value": "6000"
}
],
"url": "https://api.datadoghq.com/api/v2/network/connections/aggregate?limit=6000"
},
"response": {
"bodySize": 53,
"content": {
"mimeType": "application/vnd.api+json",
"size": 53,
"text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid limit\"}]}"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/vnd.api+json"
}
],
"headersSize": 524,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 400,
"statusText": "Bad Request"
},
"startedDateTime": "2025-03-31T18:18:50.792Z",
"time": 44
}
],
"pages": [],
"version": "1.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Get aggregated connections returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getAggregatedConnections"] = true;
const apiInstance = new v2.CloudNetworkMonitoringApi(configuration);

apiInstance
.getAggregatedConnections()
.then((data: v2.SingleAggregatedConnectionResponseArray) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
23 changes: 23 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4970,6 +4970,29 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "ListTagsResponse",
},
"v2.GetAggregatedConnections": {
"from": {
"type": "number",
"format": "int64",
},
"to": {
"type": "number",
"format": "int64",
},
"groupBy": {
"type": "string",
"format": "",
},
"tags": {
"type": "string",
"format": "",
},
"limit": {
"type": "number",
"format": "int32",
},
"operationResponseType": "SingleAggregatedConnectionResponseArray",
},
"v2.ListOrgConfigs": {
"operationResponseType": "OrgConfigListResponse",
},
Expand Down
Loading