Skip to content

Commit 9fd1117

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add support for vulnerability management - Add ListScannedAssetsMetadata new endpoint and update existing ones (#2884)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 74cfbc3 commit 9fd1117

File tree

26 files changed

+1526
-300
lines changed

26 files changed

+1526
-300
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 461 additions & 210 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-10-15T08:41:14.545Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"log": {
3+
"_recordingName": "Security Monitoring/List scanned assets metadata returns \"Not found: asset not found\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "62e254343c98aa74afed678d589a7636",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
}
23+
],
24+
"headersSize": 581,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [
28+
{
29+
"name": "page",
30+
"value": {
31+
"number": "1",
32+
"token": "unknown"
33+
}
34+
}
35+
],
36+
"url": "https://api.datadoghq.com/api/v2/security/scanned-assets-metadata?page%5Btoken%5D=unknown&page%5Bnumber%5D=1"
37+
},
38+
"response": {
39+
"bodySize": 65,
40+
"content": {
41+
"mimeType": "application/vnd.api+json",
42+
"size": 65,
43+
"text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Unexpected internal error\"}]}"
44+
},
45+
"cookies": [],
46+
"headers": [
47+
{
48+
"name": "content-type",
49+
"value": "application/vnd.api+json"
50+
}
51+
],
52+
"headersSize": 660,
53+
"httpVersion": "HTTP/1.1",
54+
"redirectURL": "",
55+
"status": 404,
56+
"statusText": "Not Found"
57+
},
58+
"startedDateTime": "2025-10-15T08:41:14.549Z",
59+
"time": 450
60+
}
61+
],
62+
"pages": [],
63+
"version": "1.2"
64+
}
65+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-10-15T08:42:14.735Z"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"log": {
3+
"_recordingName": "Security Monitoring/List scanned assets metadata returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "df97e37bed679b44c3310ea3c5e9a0bf",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
}
23+
],
24+
"headersSize": 538,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [],
28+
"url": "https://api.datadoghq.com/api/v2/security/scanned-assets-metadata"
29+
},
30+
"response": {
31+
"bodySize": 11,
32+
"content": {
33+
"mimeType": "application/vnd.api+json",
34+
"size": 11,
35+
"text": "{\"data\":[]}"
36+
},
37+
"cookies": [],
38+
"headers": [
39+
{
40+
"name": "content-type",
41+
"value": "application/vnd.api+json"
42+
}
43+
],
44+
"headersSize": 660,
45+
"httpVersion": "HTTP/1.1",
46+
"redirectURL": "",
47+
"status": 200,
48+
"statusText": "OK"
49+
},
50+
"startedDateTime": "2025-10-15T08:42:14.739Z",
51+
"time": 651
52+
}
53+
],
54+
"pages": [],
55+
"version": "1.2"
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2025-01-31T12:04:52.159Z"
1+
"2025-10-14T13:43:32.350Z"

cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/recording.har

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"entries": [
1010
{
11-
"_id": "c6d229b3cd796e5e593c6ebc987186ec",
11+
"_id": "9910b6cc2c33c0371794ef62062d3ec2",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
@@ -21,7 +21,7 @@
2121
"value": "application/json"
2222
}
2323
],
24-
"headersSize": 559,
24+
"headersSize": 568,
2525
"httpVersion": "HTTP/1.1",
2626
"method": "GET",
2727
"queryString": [
@@ -33,14 +33,14 @@
3333
}
3434
}
3535
],
36-
"url": "https://api.datadoghq.com/api/v2/security/assets?page%5Btoken%5D=unknown&page%5Bnumber%5D=1"
36+
"url": "https://api.datadoghq.com/api/v2/security/vulnerable-assets?page%5Btoken%5D=unknown&page%5Bnumber%5D=1"
3737
},
3838
"response": {
39-
"bodySize": 131,
39+
"bodySize": 65,
4040
"content": {
4141
"mimeType": "application/vnd.api+json",
42-
"size": 131,
43-
"text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"rpc error: code = Internal desc = no cached result set found for queryID: unknown\"}]}"
42+
"size": 65,
43+
"text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Unexpected internal error\"}]}"
4444
},
4545
"cookies": [],
4646
"headers": [
@@ -55,8 +55,8 @@
5555
"status": 404,
5656
"statusText": "Not Found"
5757
},
58-
"startedDateTime": "2025-01-31T12:04:52.166Z",
59-
"time": 470
58+
"startedDateTime": "2025-10-14T13:43:32.354Z",
59+
"time": 514
6060
}
6161
],
6262
"pages": [],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2025-01-31T12:05:04.773Z"
1+
"2025-10-14T13:43:52.800Z"

cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/recording.har

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"entries": [
1010
{
11-
"_id": "8b691c923faa0d44ea73715eceb660c3",
11+
"_id": "e8a64c256dc34b4416b3c26a580df140",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
@@ -21,7 +21,7 @@
2121
"value": "application/json"
2222
}
2323
],
24-
"headersSize": 631,
24+
"headersSize": 642,
2525
"httpVersion": "HTTP/1.1",
2626
"method": "GET",
2727
"queryString": [
@@ -34,7 +34,7 @@
3434
}
3535
}
3636
],
37-
"url": "https://api.datadoghq.com/api/v2/security/assets?filter%5Btype%5D=Host&filter%5Brepository_url%5D=github.com%2Fdatadog%2Fdd-go&filter%5Brisks.in_production%5D=true"
37+
"url": "https://api.datadoghq.com/api/v2/security/vulnerable-assets?filter%5Btype%5D=Host&filter%5Brepository_url%5D=github.com%2Fdatadog%2Fdd-go&filter%5Brisks.in_production%5D=true"
3838
},
3939
"response": {
4040
"bodySize": 11,
@@ -50,14 +50,14 @@
5050
"value": "application/vnd.api+json"
5151
}
5252
],
53-
"headersSize": 660,
53+
"headersSize": 659,
5454
"httpVersion": "HTTP/1.1",
5555
"redirectURL": "",
5656
"status": 200,
5757
"statusText": "OK"
5858
},
59-
"startedDateTime": "2025-01-31T12:05:04.782Z",
60-
"time": 613
59+
"startedDateTime": "2025-10-14T13:43:52.805Z",
60+
"time": 851
6161
}
6262
],
6363
"pages": [],
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* List scanned assets metadata returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listScannedAssetsMetadata"] = true;
9+
const apiInstance = new v2.SecurityMonitoringApi(configuration);
10+
11+
apiInstance
12+
.listScannedAssetsMetadata()
13+
.then((data: v2.ScannedAssetsMetadata) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)