Skip to content

Commit 2896101

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 791bb38 of spec repo
1 parent 07c5c19 commit 2896101

File tree

12 files changed

+500
-254
lines changed

12 files changed

+500
-254
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 243 additions & 200 deletions
Large diffs are not rendered by default.

cassettes/features/v2/security_monitoring/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
# List assets SBOMs returns "OK" response
1+
# List SBOMs returns "OK" response
22

33
require "datadog_api_client"
44
DatadogAPIClient.configure do |config|
55
config.unstable_operations["v2.list_assets_sbo_ms".to_sym] = true
66
end
77
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8-
opts = {
9-
filter_package_name: "pandas",
10-
filter_asset_type: AssetType::SERVICE,
11-
}
12-
p api_instance.list_assets_sbo_ms(opts)
8+
p api_instance.list_assets_sbo_ms()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# List assets SBOMs returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_assets_sbo_ms".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
opts = {
9+
filter_package_name: "pandas",
10+
filter_asset_type: AssetType::SERVICE,
11+
}
12+
p api_instance.list_assets_sbo_ms(opts)

features/scenarios_model_mapping.rb

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,25 +1280,6 @@
12801280
"finding_id" => "String",
12811281
"snapshot_timestamp" => "Integer",
12821282
},
1283-
"v2.ListVulnerableAssets" => {
1284-
"page_token" => "String",
1285-
"page_number" => "Integer",
1286-
"filter_name" => "String",
1287-
"filter_type" => "AssetType",
1288-
"filter_version_first" => "String",
1289-
"filter_version_last" => "String",
1290-
"filter_repository_url" => "String",
1291-
"filter_risks_in_production" => "Boolean",
1292-
"filter_risks_under_attack" => "Boolean",
1293-
"filter_risks_is_publicly_accessible" => "Boolean",
1294-
"filter_risks_has_privileged_access" => "Boolean",
1295-
"filter_risks_has_access_to_sensitive_data" => "Boolean",
1296-
"filter_environments" => "String",
1297-
"filter_teams" => "String",
1298-
"filter_arch" => "String",
1299-
"filter_operating_system_name" => "String",
1300-
"filter_operating_system_version" => "String",
1301-
},
13021283
"v2.ListAssetsSBOMs" => {
13031284
"page_token" => "String",
13041285
"page_number" => "Integer",
@@ -1313,6 +1294,7 @@
13131294
"asset_type" => "AssetType",
13141295
"filter_asset_name" => "String",
13151296
"filter_repo_digest" => "String",
1297+
"ext_format" => "SBOMFormat",
13161298
},
13171299
"v2.CreateSignalNotificationRule" => {
13181300
"body" => "CreateNotificationRuleParameters",
@@ -1384,6 +1366,25 @@
13841366
"id" => "String",
13851367
"body" => "PatchNotificationRuleParameters",
13861368
},
1369+
"v2.ListVulnerableAssets" => {
1370+
"page_token" => "String",
1371+
"page_number" => "Integer",
1372+
"filter_name" => "String",
1373+
"filter_type" => "AssetType",
1374+
"filter_version_first" => "String",
1375+
"filter_version_last" => "String",
1376+
"filter_repository_url" => "String",
1377+
"filter_risks_in_production" => "Boolean",
1378+
"filter_risks_under_attack" => "Boolean",
1379+
"filter_risks_is_publicly_accessible" => "Boolean",
1380+
"filter_risks_has_privileged_access" => "Boolean",
1381+
"filter_risks_has_access_to_sensitive_data" => "Boolean",
1382+
"filter_environments" => "String",
1383+
"filter_teams" => "String",
1384+
"filter_arch" => "String",
1385+
"filter_operating_system_name" => "String",
1386+
"filter_operating_system_version" => "String",
1387+
},
13871388
"v2.CreateSecurityFilter" => {
13881389
"body" => "SecurityFilterCreateRequest",
13891390
},

features/v2/security_monitoring.feature

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -924,27 +924,34 @@ Feature: Security Monitoring
924924
Then the response status is 200 The list of notification rules.
925925

926926
@generated @skip @team:DataDog/asm-vm
927-
Scenario: List assets SBOMs returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
927+
Scenario: List SBOMs returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
928928
Given operation "ListAssetsSBOMs" enabled
929929
And new "ListAssetsSBOMs" request
930930
When the request is sent
931931
Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request.
932932

933-
@team:DataDog/asm-vm
934-
Scenario: List assets SBOMs returns "Not found: There is no request associated with the provided token." response
933+
@generated @skip @team:DataDog/asm-vm
934+
Scenario: List SBOMs returns "Not found: asset not found" response
935935
Given operation "ListAssetsSBOMs" enabled
936936
And new "ListAssetsSBOMs" request
937-
And request contains "page[token]" parameter with value "unknown"
938-
And request contains "page[number]" parameter with value 1
939937
When the request is sent
940-
Then the response status is 404 Not found: There is no request associated with the provided token.
938+
Then the response status is 404 Not found: asset not found
941939

942940
@generated @skip @team:DataDog/asm-vm
943-
Scenario: List assets SBOMs returns "Not found: asset not found" response
941+
Scenario: List SBOMs returns "OK" response
944942
Given operation "ListAssetsSBOMs" enabled
945943
And new "ListAssetsSBOMs" request
946944
When the request is sent
947-
Then the response status is 404 Not found: asset not found
945+
Then the response status is 200 OK
946+
947+
@team:DataDog/asm-vm
948+
Scenario: List assets SBOMs returns "Not found: There is no request associated with the provided token." response
949+
Given operation "ListAssetsSBOMs" enabled
950+
And new "ListAssetsSBOMs" request
951+
And request contains "page[token]" parameter with value "unknown"
952+
And request contains "page[number]" parameter with value 1
953+
When the request is sent
954+
Then the response status is 404 Not found: There is no request associated with the provided token.
948955

949956
@team:DataDog/asm-vm
950957
Scenario: List assets SBOMs returns "OK" response

features/v2/undo.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3180,12 +3180,6 @@
31803180
"type": "idempotent"
31813181
}
31823182
},
3183-
"ListVulnerableAssets": {
3184-
"tag": "Security Monitoring",
3185-
"undo": {
3186-
"type": "safe"
3187-
}
3188-
},
31893183
"DownloadCloudWorkloadPolicyFile": {
31903184
"tag": "CSM Threats",
31913185
"undo": {
@@ -3284,6 +3278,12 @@
32843278
"type": "idempotent"
32853279
}
32863280
},
3281+
"ListVulnerableAssets": {
3282+
"tag": "Security Monitoring",
3283+
"undo": {
3284+
"type": "safe"
3285+
}
3286+
},
32873287
"ListCloudWorkloadSecurityAgentRules": {
32883288
"tag": "CSM Threats",
32893289
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3502,6 +3502,7 @@ def overrides
35023502
"v2.sbom_component_property" => "SBOMComponentProperty",
35033503
"v2.sbom_component_supplier" => "SBOMComponentSupplier",
35043504
"v2.sbom_component_type" => "SBOMComponentType",
3505+
"v2.sbom_format" => "SBOMFormat",
35053506
"v2.sbom_metadata" => "SBOMMetadata",
35063507
"v2.sbom_metadata_author" => "SBOMMetadataAuthor",
35073508
"v2.sbom_metadata_component" => "SBOMMetadataComponent",
@@ -4162,6 +4163,7 @@ def overrides
41624163
"v2.virus_total_integration_update" => "VirusTotalIntegrationUpdate",
41634164
"v2.vulnerabilities_type" => "VulnerabilitiesType",
41644165
"v2.vulnerability" => "Vulnerability",
4166+
"v2.vulnerability_advisory" => "VulnerabilityAdvisory",
41654167
"v2.vulnerability_attributes" => "VulnerabilityAttributes",
41664168
"v2.vulnerability_cvss" => "VulnerabilityCvss",
41674169
"v2.vulnerability_dependency_locations" => "VulnerabilityDependencyLocations",

lib/datadog_api_client/v2/api/security_monitoring_api.rb

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,7 @@ def get_sbom(asset_type, filter_asset_name, opts = {})
17621762
# @param filter_asset_name [String] The name of the asset for the SBOM request.
17631763
# @param opts [Hash] the optional parameters
17641764
# @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.
1765+
# @option opts [SBOMFormat] :ext_format The standard of the SBOM.
17651766
# @return [Array<(GetSBOMResponse, Integer, Hash)>] GetSBOMResponse data, response status code and response headers
17661767
def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {})
17671768
unstable_enabled = @api_client.config.unstable_operations["v2.get_sbom".to_sym]
@@ -1787,13 +1788,18 @@ def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {})
17871788
if @api_client.config.client_side_validation && filter_asset_name.nil?
17881789
fail ArgumentError, "Missing the required parameter 'filter_asset_name' when calling SecurityMonitoringAPI.get_sbom"
17891790
end
1791+
allowable_values = ['CycloneDX', 'SPDX']
1792+
if @api_client.config.client_side_validation && opts[:'ext_format'] && !allowable_values.include?(opts[:'ext_format'])
1793+
fail ArgumentError, "invalid value for \"ext_format\", must be one of #{allowable_values}"
1794+
end
17901795
# resource path
17911796
local_var_path = '/api/v2/security/sboms/{asset_type}'.sub('{asset_type}', CGI.escape(asset_type.to_s).gsub('%2F', '/'))
17921797

17931798
# query parameters
17941799
query_params = opts[:query_params] || {}
17951800
query_params[:'filter[asset_name]'] = filter_asset_name
17961801
query_params[:'filter[repo_digest]'] = opts[:'filter_repo_digest'] if !opts[:'filter_repo_digest'].nil?
1802+
query_params[:'ext:format'] = opts[:'ext_format'] if !opts[:'ext_format'].nil?
17971803

17981804
# header parameters
17991805
header_params = opts[:header_params] || {}
@@ -2636,15 +2642,15 @@ def get_vulnerability_notification_rules_with_http_info(opts = {})
26362642
return data, status_code, headers
26372643
end
26382644

2639-
# List assets SBOMs.
2645+
# List SBOMs.
26402646
#
26412647
# @see #list_assets_sbo_ms_with_http_info
26422648
def list_assets_sbo_ms(opts = {})
26432649
data, _status_code, _headers = list_assets_sbo_ms_with_http_info(opts)
26442650
data
26452651
end
26462652

2647-
# List assets SBOMs.
2653+
# List SBOMs.
26482654
#
26492655
# Get a list of assets SBOMs for an organization.
26502656
#
@@ -3417,6 +3423,8 @@ def list_vulnerabilities(opts = {})
34173423
#
34183424
# This token can then be used in the subsequent paginated requests.
34193425
#
3426+
# *Note: The first request may take longer to complete than subsequent requests.*
3427+
#
34203428
# #### Subsequent requests
34213429
#
34223430
# Any request containing valid `page[token]` and `page[number]` parameters will be considered a subsequent request.
@@ -3425,6 +3433,8 @@ def list_vulnerabilities(opts = {})
34253433
#
34263434
# If the page `number` is invalid, a `400` response will be returned.
34273435
#
3436+
# The returned `token` remains valid for every request in the pagination sequence. You may send paginated requests in parallel by re-using this `token` and varying only the `page[number]` parameter.
3437+
#
34283438
# ### Filtering
34293439
#
34303440
# The request can include some filter parameters to filter the data to be retrieved. The format of the filter parameters follows the [JSON:API format](https://jsonapi.org/format/#fetching-filtering): `filter[$prop_name]`, where `prop_name` is the property name in the entity being filtered by.
@@ -3456,6 +3466,11 @@ def list_vulnerabilities(opts = {})
34563466
# "links": {...}
34573467
# }
34583468
# ```
3469+
# ### Extensions
3470+
#
3471+
# The request in some cases can include extensions to update behavior of the endpoint requested. The format of the filter parameters follows the [JSON:API format](https://jsonapi.org/extensions/#extensions): `ext:$extension_name`, where `extension_name` is the name of the modifier that is being applied.
3472+
#
3473+
# Extensions can only include one value at the moment: `ext:modifier=value`.
34593474
#
34603475
# @param opts [Hash] the optional parameters
34613476
# @option opts [String] :page_token Its value must come from the `links` section of the response of the first request. Do not manually edit it.
@@ -3485,7 +3500,7 @@ def list_vulnerabilities(opts = {})
34853500
# @option opts [Boolean] :filter_fix_available Filter by fix availability.
34863501
# @option opts [String] :filter_repo_digests Filter by vulnerability `repo_digest` (when the vulnerability is related to `Image` asset).
34873502
# @option opts [String] :filter_origin Filter by origin.
3488-
# @option opts [String] :filter_asset_name Filter by asset name.
3503+
# @option opts [String] :filter_asset_name Filter by asset name. This field supports the usage of wildcards (*).
34893504
# @option opts [AssetType] :filter_asset_type Filter by asset type.
34903505
# @option opts [String] :filter_asset_version_first Filter by the first version of the asset this vulnerability has been detected on.
34913506
# @option opts [String] :filter_asset_version_last Filter by the last version of the asset this vulnerability has been detected on.
@@ -3583,7 +3598,7 @@ def list_vulnerabilities_with_http_info(opts = {})
35833598
query_params[:'filter[tool]'] = opts[:'filter_tool'] if !opts[:'filter_tool'].nil?
35843599
query_params[:'filter[library.name]'] = opts[:'filter_library_name'] if !opts[:'filter_library_name'].nil?
35853600
query_params[:'filter[library.version]'] = opts[:'filter_library_version'] if !opts[:'filter_library_version'].nil?
3586-
query_params[:'filter[advisory_id]'] = opts[:'filter_advisory_id'] if !opts[:'filter_advisory_id'].nil?
3601+
query_params[:'filter[advisory.id]'] = opts[:'filter_advisory_id'] if !opts[:'filter_advisory_id'].nil?
35873602
query_params[:'filter[risks.exploitation_probability]'] = opts[:'filter_risks_exploitation_probability'] if !opts[:'filter_risks_exploitation_probability'].nil?
35883603
query_params[:'filter[risks.poc_exploit_available]'] = opts[:'filter_risks_poc_exploit_available'] if !opts[:'filter_risks_poc_exploit_available'].nil?
35893604
query_params[:'filter[risks.exploit_available]'] = opts[:'filter_risks_exploit_available'] if !opts[:'filter_risks_exploit_available'].nil?
@@ -3675,7 +3690,7 @@ def list_vulnerable_assets(opts = {})
36753690
# @param opts [Hash] the optional parameters
36763691
# @option opts [String] :page_token Its value must come from the `links` section of the response of the first request. Do not manually edit it.
36773692
# @option opts [Integer] :page_number The page number to be retrieved. It should be equal or greater than `1`
3678-
# @option opts [String] :filter_name Filter by name.
3693+
# @option opts [String] :filter_name Filter by name. This field supports the usage of wildcards (*).
36793694
# @option opts [AssetType] :filter_type Filter by type.
36803695
# @option opts [String] :filter_version_first Filter by the first version of the asset since it has been vulnerable.
36813696
# @option opts [String] :filter_version_last Filter by the last detected version of the asset.
@@ -3710,7 +3725,7 @@ def list_vulnerable_assets_with_http_info(opts = {})
37103725
fail ArgumentError, "invalid value for \"filter_type\", must be one of #{allowable_values}"
37113726
end
37123727
# resource path
3713-
local_var_path = '/api/v2/security/assets'
3728+
local_var_path = '/api/v2/security/vulnerable-assets'
37143729

37153730
# query parameters
37163731
query_params = opts[:query_params] || {}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# The SBOM standard
21+
class SBOMFormat
22+
include BaseEnumModel
23+
24+
CYCLONEDX = "CycloneDX".freeze
25+
SPDX = "SPDX".freeze
26+
end
27+
end

0 commit comments

Comments
 (0)