Skip to content

Commit 81f8c0e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Revert GetSBOM to x-unstable (#2240)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 9da23c9 commit 81f8c0e

File tree

10 files changed

+30
-14
lines changed

10 files changed

+30
-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-12 18:33:48.053303",
8-
"spec_repo_commit": "6a4cfb82"
7+
"regenerated": "2025-02-14 15:03:43.770632",
8+
"spec_repo_commit": "a739b49f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-12 18:33:48.069553",
13-
"spec_repo_commit": "6a4cfb82"
12+
"regenerated": "2025-02-14 15:03:43.786179",
13+
"spec_repo_commit": "a739b49f"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45225,6 +45225,9 @@ paths:
4522545225
summary: Get SBOM
4522645226
tags:
4522745227
- Security Monitoring
45228+
x-unstable: '**Note**: This endpoint is a private preview.
45229+
45230+
If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
4522845231
/api/v2/security/signals/notification_rules:
4522945232
get:
4523045233
description: Returns the list of notification rules for security signals.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-31T12:04:00.490Z
1+
2025-02-10T11:40:12.098Z

cassettes/features/v2/security_monitoring/Get-SBOM-returns-Not-found-asset-not-found-response.yml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-31T12:04:14.913Z
1+
2025-02-10T11:38:04.662Z

cassettes/features/v2/security_monitoring/Get-SBOM-returns-OK-response.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Get SBOM returns "OK" response
22

33
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_sbom".to_sym] = true
6+
end
47
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
58
p api_instance.get_sbom(AssetType::REPOSITORY, "github.com/datadog/datadog-agent")

features/v2/security_monitoring.feature

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,23 +457,26 @@ Feature: Security Monitoring
457457

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

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

474476
@team:DataDog/asm-vm
475477
Scenario: Get SBOM returns "OK" response
476-
Given new "GetSBOM" request
478+
Given operation "GetSBOM" enabled
479+
And new "GetSBOM" request
477480
And request contains "asset_type" parameter with value "Repository"
478481
And request contains "filter[asset_name]" parameter with value "github.com/datadog/datadog-agent"
479482
When the request is sent

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ def initialize
244244
"v2.get_finding": false,
245245
"v2.get_historical_job": false,
246246
"v2.get_rule_version_history": false,
247+
"v2.get_sbom": false,
247248
"v2.list_findings": false,
248249
"v2.list_historical_jobs": false,
249250
"v2.mute_findings": false,

lib/datadog_api_client/v2/api/security_monitoring_api.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,12 @@ def get_sbom(asset_type, filter_asset_name, opts = {})
14921492
# @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.
14931493
# @return [Array<(GetSBOMResponse, Integer, Hash)>] GetSBOMResponse data, response status code and response headers
14941494
def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {})
1495+
unstable_enabled = @api_client.config.unstable_operations["v2.get_sbom".to_sym]
1496+
if unstable_enabled
1497+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_sbom")
1498+
else
1499+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_sbom"))
1500+
end
14951501

14961502
if @api_client.config.debugging
14971503
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_sbom ...'

0 commit comments

Comments
 (0)