Skip to content

Commit

Permalink
Vulnerabilities endpoints GA - Remove x-unstable (#2224)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Feb 3, 2025
1 parent f8c802f commit bd24447
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 76 deletions.
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-02-03 18:38:22.614563",
"spec_repo_commit": "325cdedf"
"regenerated": "2025-02-03 19:47:16.708391",
"spec_repo_commit": "b52549d9"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-03 18:38:22.629330",
"spec_repo_commit": "325cdedf"
"regenerated": "2025-02-03 19:47:16.725832",
"spec_repo_commit": "b52549d9"
}
}
}
9 changes: 0 additions & 9 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43976,9 +43976,6 @@ paths:
summary: List vulnerable assets
tags:
- Security Monitoring
x-unstable: '**Note**: This endpoint is a private preview.

If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
/api/v2/security/cloud_workload/policy/download:
get:
description: 'The download endpoint generates a Cloud Workload Security policy
Expand Down Expand Up @@ -44071,9 +44068,6 @@ paths:
summary: Get SBOM
tags:
- Security Monitoring
x-unstable: '**Note**: This endpoint is a private preview.

If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
/api/v2/security/signals/notification_rules:
get:
description: Returns the list of notification rules for security signals.
Expand Down Expand Up @@ -44632,9 +44626,6 @@ paths:
summary: List vulnerabilities
tags:
- Security Monitoring
x-unstable: '**Note**: This endpoint is a private preview.

If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
/api/v2/security/vulnerabilities/notification_rules:
get:
description: Returns the list of notification rules for security vulnerabilities.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-01-15T14:19:46.527Z
2025-01-31T12:04:00.490Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-01-17T13:12:50.575Z
2025-01-31T12:04:14.913Z

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-19T16:15:23.508Z
2025-01-31T12:04:28.397Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-19T16:15:24.088Z
2025-01-31T12:04:39.730Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-19T16:15:24.530Z
2025-01-31T12:04:52.159Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-19T16:15:24.699Z
2025-01-31T12:05:04.773Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions examples/v2/security-monitoring/GetSBOM.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Get SBOM returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_sbom".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
p api_instance.get_sbom(AssetType::REPOSITORY, "github.com/datadog/datadog-agent")
3 changes: 0 additions & 3 deletions examples/v2/security-monitoring/ListVulnerabilities.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# List vulnerabilities returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_vulnerabilities".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
opts = {
filter_cvss_base_severity: VulnerabilitySeverity::HIGH,
Expand Down
3 changes: 0 additions & 3 deletions examples/v2/security-monitoring/ListVulnerableAssets.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# List vulnerable assets returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_vulnerable_assets".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
opts = {
filter_type: AssetType::HOST,
Expand Down
27 changes: 9 additions & 18 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -447,26 +447,23 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/asm-vm
Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
Given operation "GetSBOM" enabled
And new "GetSBOM" request
Given new "GetSBOM" request
And request contains "asset_type" parameter from "REPLACE.ME"
And request contains "filter[asset_name]" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request.

@team:DataDog/asm-vm
Scenario: Get SBOM returns "Not found: asset not found" response
Given operation "GetSBOM" enabled
And new "GetSBOM" request
Given new "GetSBOM" request
And request contains "asset_type" parameter with value "Host"
And request contains "filter[asset_name]" parameter with value "unknown-host"
When the request is sent
Then the response status is 404 Not found: asset not found

@team:DataDog/asm-vm
Scenario: Get SBOM returns "OK" response
Given operation "GetSBOM" enabled
And new "GetSBOM" request
Given new "GetSBOM" request
And request contains "asset_type" parameter with value "Repository"
And request contains "filter[asset_name]" parameter with value "github.com/datadog/datadog-agent"
When the request is sent
Expand Down Expand Up @@ -783,24 +780,21 @@ Feature: Security Monitoring

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

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

@team:DataDog/asm-vm
Scenario: List vulnerabilities returns "OK" response
Given operation "ListVulnerabilities" enabled
And new "ListVulnerabilities" request
Given new "ListVulnerabilities" request
And request contains "filter[cvss.base.severity]" parameter with value "High"
And request contains "filter[asset.type]" parameter with value "Service"
And request contains "filter[tool]" parameter with value "Infra"
Expand All @@ -809,24 +803,21 @@ Feature: Security Monitoring

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

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

@team:DataDog/asm-vm
Scenario: List vulnerable assets returns "OK" response
Given operation "ListVulnerableAssets" enabled
And new "ListVulnerableAssets" request
Given new "ListVulnerableAssets" request
And request contains "filter[type]" parameter with value "Host"
And request contains "filter[repository_url]" parameter with value "github.com/datadog/dd-go"
And request contains "filter[risks.in_production]" parameter with value true
Expand Down
3 changes: 0 additions & 3 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,8 @@ def initialize
"v2.delete_historical_job": false,
"v2.get_finding": false,
"v2.get_historical_job": false,
"v2.get_sbom": false,
"v2.list_findings": false,
"v2.list_historical_jobs": false,
"v2.list_vulnerabilities": false,
"v2.list_vulnerable_assets": false,
"v2.mute_findings": false,
"v2.run_historical_job": false,
"v2.create_scorecard_outcomes_batch": false,
Expand Down
18 changes: 0 additions & 18 deletions lib/datadog_api_client/v2/api/security_monitoring_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1417,12 +1417,6 @@ def get_sbom(asset_type, filter_asset_name, opts = {})
# @option opts [String] :filter_repo_digest The container image `repo_digest` for the SBOM request. When the requested asset type is 'Image', this filter is mandatory.
# @return [Array<(GetSBOMResponse, Integer, Hash)>] GetSBOMResponse data, response status code and response headers
def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.get_sbom".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_sbom")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_sbom"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_sbom ...'
Expand Down Expand Up @@ -2654,12 +2648,6 @@ def list_vulnerabilities(opts = {})
# @option opts [String] :filter_asset_operating_system_version Filter by asset operating system version.
# @return [Array<(ListVulnerabilitiesResponse, Integer, Hash)>] ListVulnerabilitiesResponse data, response status code and response headers
def list_vulnerabilities_with_http_info(opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.list_vulnerabilities".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_vulnerabilities")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_vulnerabilities"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_vulnerabilities ...'
Expand Down Expand Up @@ -2842,12 +2830,6 @@ def list_vulnerable_assets(opts = {})
# @option opts [String] :filter_operating_system_version Filter by operating system version.
# @return [Array<(ListVulnerableAssetsResponse, Integer, Hash)>] ListVulnerableAssetsResponse data, response status code and response headers
def list_vulnerable_assets_with_http_info(opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.list_vulnerable_assets".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_vulnerable_assets")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_vulnerable_assets"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_vulnerable_assets ...'
Expand Down

0 comments on commit bd24447

Please sign in to comment.