Skip to content

Commit d933b5c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 16f9aceb of spec repo
1 parent 300af22 commit d933b5c

File tree

7 files changed

+55
-14
lines changed

7 files changed

+55
-14
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-02-27 14:00:40.195720",
8-
"spec_repo_commit": "240ec82d"
7+
"regenerated": "2025-02-27 16:37:27.604702",
8+
"spec_repo_commit": "16f9aceb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-27 14:00:40.212406",
13-
"spec_repo_commit": "240ec82d"
12+
"regenerated": "2025-02-27 16:37:27.619784",
13+
"spec_repo_commit": "16f9aceb"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32353,6 +32353,9 @@ components:
3235332353
apm_service_catalog_read: View service catalog and service definitions.
3235432354
apm_service_catalog_write: Add, modify, and delete service catalog definitions
3235532355
when those definitions are maintained by Datadog.
32356+
appsec_vm_read: View infrastructure, application code, and library vulnerabilities.
32357+
This does not restrict API or inventory SQL access to the vulnerability
32358+
data source.
3235632359
cases_read: View Cases.
3235732360
cases_write: Create and update cases.
3235832361
ci_visibility_pipelines_write: Create CI Visibility pipeline spans using
@@ -45204,9 +45207,14 @@ paths:
4520445207
security:
4520545208
- apiKeyAuth: []
4520645209
appKeyAuth: []
45210+
- AuthZ:
45211+
- appsec_vm_read
4520745212
summary: List vulnerable assets
4520845213
tags:
4520945214
- Security Monitoring
45215+
x-unstable: '**Note**: This endpoint is a private preview.
45216+
45217+
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
4521045218
/api/v2/security/cloud_workload/policy/download:
4521145219
get:
4521245220
description: 'The download endpoint generates a Cloud Workload Security policy
@@ -45296,12 +45304,14 @@ paths:
4529645304
security:
4529745305
- apiKeyAuth: []
4529845306
appKeyAuth: []
45307+
- AuthZ:
45308+
- appsec_vm_read
4529945309
summary: Get SBOM
4530045310
tags:
4530145311
- Security Monitoring
4530245312
x-unstable: '**Note**: This endpoint is a private preview.
4530345313

45304-
If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
45314+
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
4530545315
/api/v2/security/signals/notification_rules:
4530645316
get:
4530745317
description: Returns the list of notification rules for security signals.
@@ -45857,9 +45867,14 @@ paths:
4585745867
security:
4585845868
- apiKeyAuth: []
4585945869
appKeyAuth: []
45870+
- AuthZ:
45871+
- appsec_vm_read
4586045872
summary: List vulnerabilities
4586145873
tags:
4586245874
- Security Monitoring
45875+
x-unstable: '**Note**: This endpoint is a private preview.
45876+
45877+
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
4586345878
/api/v2/security/vulnerabilities/notification_rules:
4586445879
get:
4586545880
description: Returns the list of notification rules for security vulnerabilities.

examples/v2_security-monitoring_ListVulnerabilities.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use datadog_api_client::datadogV2::model::VulnerabilityTool;
88

99
#[tokio::main]
1010
async fn main() {
11-
let configuration = datadog::Configuration::new();
11+
let mut configuration = datadog::Configuration::new();
12+
configuration.set_unstable_operation_enabled("v2.ListVulnerabilities", true);
1213
let api = SecurityMonitoringAPI::with_config(configuration);
1314
let resp = api
1415
.list_vulnerabilities(

examples/v2_security-monitoring_ListVulnerableAssets.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use datadog_api_client::datadogV2::model::AssetType;
66

77
#[tokio::main]
88
async fn main() {
9-
let configuration = datadog::Configuration::new();
9+
let mut configuration = datadog::Configuration::new();
10+
configuration.set_unstable_operation_enabled("v2.ListVulnerableAssets", true);
1011
let api = SecurityMonitoringAPI::with_config(configuration);
1112
let resp = api
1213
.list_vulnerable_assets(

src/datadog/configuration.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ impl Default for Configuration {
187187
("v2.get_sbom".to_owned(), false),
188188
("v2.list_findings".to_owned(), false),
189189
("v2.list_historical_jobs".to_owned(), false),
190+
("v2.list_vulnerabilities".to_owned(), false),
191+
("v2.list_vulnerable_assets".to_owned(), false),
190192
("v2.mute_findings".to_owned(), false),
191193
("v2.run_historical_job".to_owned(), false),
192194
("v2.create_scorecard_outcomes_batch".to_owned(), false),

src/datadogV2/api/api_security_monitoring.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6072,6 +6072,14 @@ impl SecurityMonitoringAPI {
60726072
> {
60736073
let local_configuration = &self.config;
60746074
let operation_id = "v2.list_vulnerabilities";
6075+
if local_configuration.is_unstable_operation_enabled(operation_id) {
6076+
warn!("Using unstable operation {operation_id}");
6077+
} else {
6078+
let local_error = datadog::UnstableOperationDisabledError {
6079+
msg: "Operation 'v2.list_vulnerabilities' is not enabled".to_string(),
6080+
};
6081+
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
6082+
}
60756083

60766084
// unbox and build optional parameters
60776085
let page_token = params.page_token;
@@ -6454,6 +6462,14 @@ impl SecurityMonitoringAPI {
64546462
> {
64556463
let local_configuration = &self.config;
64566464
let operation_id = "v2.list_vulnerable_assets";
6465+
if local_configuration.is_unstable_operation_enabled(operation_id) {
6466+
warn!("Using unstable operation {operation_id}");
6467+
} else {
6468+
let local_error = datadog::UnstableOperationDisabledError {
6469+
msg: "Operation 'v2.list_vulnerable_assets' is not enabled".to_string(),
6470+
};
6471+
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
6472+
}
64576473

64586474
// unbox and build optional parameters
64596475
let page_token = params.page_token;

tests/scenarios/features/v2/security_monitoring.feature

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ Feature: Security Monitoring
473473
When the request is sent
474474
Then the response status is 404 Not found: asset not found
475475

476-
@team:DataDog/asm-vm
476+
@skip @team:DataDog/asm-vm
477477
Scenario: Get SBOM returns "OK" response
478478
Given operation "GetSBOM" enabled
479479
And new "GetSBOM" request
@@ -830,21 +830,24 @@ Feature: Security Monitoring
830830

831831
@generated @skip @team:DataDog/asm-vm
832832
Scenario: List vulnerabilities returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
833-
Given new "ListVulnerabilities" request
833+
Given operation "ListVulnerabilities" enabled
834+
And new "ListVulnerabilities" request
834835
When the request is sent
835836
Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request.
836837

837838
@team:DataDog/asm-vm
838839
Scenario: List vulnerabilities returns "Not found: There is no request associated with the provided token." response
839-
Given new "ListVulnerabilities" request
840+
Given operation "ListVulnerabilities" enabled
841+
And new "ListVulnerabilities" request
840842
And request contains "page[token]" parameter with value "unknown"
841843
And request contains "page[number]" parameter with value 1
842844
When the request is sent
843845
Then the response status is 404 Not found: There is no request associated with the provided token.
844846

845847
@team:DataDog/asm-vm
846848
Scenario: List vulnerabilities returns "OK" response
847-
Given new "ListVulnerabilities" request
849+
Given operation "ListVulnerabilities" enabled
850+
And new "ListVulnerabilities" request
848851
And request contains "filter[cvss.base.severity]" parameter with value "High"
849852
And request contains "filter[asset.type]" parameter with value "Service"
850853
And request contains "filter[tool]" parameter with value "Infra"
@@ -853,21 +856,24 @@ Feature: Security Monitoring
853856

854857
@generated @skip @team:DataDog/asm-vm
855858
Scenario: List vulnerable assets returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
856-
Given new "ListVulnerableAssets" request
859+
Given operation "ListVulnerableAssets" enabled
860+
And new "ListVulnerableAssets" request
857861
When the request is sent
858862
Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request.
859863

860864
@team:DataDog/asm-vm
861865
Scenario: List vulnerable assets returns "Not found: There is no request associated with the provided token." response
862-
Given new "ListVulnerableAssets" request
866+
Given operation "ListVulnerableAssets" enabled
867+
And new "ListVulnerableAssets" request
863868
And request contains "page[token]" parameter with value "unknown"
864869
And request contains "page[number]" parameter with value 1
865870
When the request is sent
866871
Then the response status is 404 Not found: There is no request associated with the provided token.
867872

868873
@team:DataDog/asm-vm
869874
Scenario: List vulnerable assets returns "OK" response
870-
Given new "ListVulnerableAssets" request
875+
Given operation "ListVulnerableAssets" enabled
876+
And new "ListVulnerableAssets" request
871877
And request contains "filter[type]" parameter with value "Host"
872878
And request contains "filter[repository_url]" parameter with value "github.com/datadog/dd-go"
873879
And request contains "filter[risks.in_production]" parameter with value true

0 commit comments

Comments
 (0)