Skip to content
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-02-12 18:33:46.151421",
"spec_repo_commit": "6a4cfb82"
"regenerated": "2025-02-14 15:03:35.352599",
"spec_repo_commit": "a739b49f"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-12 18:33:46.166854",
"spec_repo_commit": "6a4cfb82"
"regenerated": "2025-02-14 15:03:35.368038",
"spec_repo_commit": "a739b49f"
}
}
}
3 changes: 3 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45225,6 +45225,9 @@ 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
1 change: 1 addition & 0 deletions examples/v2/security-monitoring/GetSBOM.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getSBOM", true);
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);

try {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ public class ApiClient {
put("v2.getFinding", false);
put("v2.getHistoricalJob", false);
put("v2.getRuleVersionHistory", false);
put("v2.getSBOM", false);
put("v2.listFindings", false);
put("v2.listHistoricalJobs", false);
put("v2.muteFindings", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3459,6 +3459,13 @@ public CompletableFuture<GetSBOMResponse> getSBOMAsync(
public ApiResponse<GetSBOMResponse> getSBOMWithHttpInfo(
AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters)
throws ApiException {
// Check if unstable operation is enabled
String operationId = "getSBOM";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
Object localVarPostBody = null;

// verify the required parameter 'assetType' is set
Expand Down Expand Up @@ -3518,6 +3525,16 @@ public ApiResponse<GetSBOMResponse> getSBOMWithHttpInfo(
*/
public CompletableFuture<ApiResponse<GetSBOMResponse>> getSBOMWithHttpInfoAsync(
AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) {
// Check if unstable operation is enabled
String operationId = "getSBOM";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<GetSBOMResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = null;

// verify the required parameter 'assetType' is set
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-01-31T12:04:00.490Z
2025-02-10T11:40:12.098Z
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"errors\":[{\"title\":\"Asset not found\",\"detail\":\"asset_type: 'Host' with asset_name: 'unknown-host' not found\"}]}",
"body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Asset not found\",\"detail\":\"asset_type: 'Host' with asset_name: 'unknown-host' not found\"}]}",
"headers": {
"Content-Type": [
"application/vnd.api+json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-01-31T12:04:14.913Z
2025-02-10T11:38:04.662Z

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -457,23 +457,26 @@ 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 new "GetSBOM" request
Given operation "GetSBOM" enabled
And 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 new "GetSBOM" request
Given operation "GetSBOM" enabled
And 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 new "GetSBOM" request
Given operation "GetSBOM" enabled
And 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