Skip to content

Commit 5997176

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 32857d8 of spec repo
1 parent 07c5c19 commit 5997176

File tree

10 files changed

+286
-40
lines changed

10 files changed

+286
-40
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40967,6 +40967,16 @@ components:
4096740967
- MACHINE_LEARNING_MODEL
4096840968
- OPERATING_SYSTEM
4096940969
- PLATFORM
40970+
SBOMFormat:
40971+
description: The SBOM standard
40972+
enum:
40973+
- CycloneDX
40974+
- SPDX
40975+
example: CycloneDX
40976+
type: string
40977+
x-enum-varnames:
40978+
- CYCLONEDX
40979+
- SPDX
4097040980
SBOMMetadata:
4097140981
description: Provides additional information about a BOM.
4097240982
properties:
@@ -51419,13 +51429,29 @@ components:
5141951429
- attributes
5142051430
- relationships
5142151431
type: object
51422-
VulnerabilityAttributes:
51423-
description: The JSON:API attributes of the vulnerability.
51432+
VulnerabilityAdvisory:
51433+
description: Advisory that associated with the vulnerability.
5142451434
properties:
51425-
advisory_id:
51435+
id:
5142651436
description: Vulnerability advisory ID.
5142751437
example: TRIVY-CVE-2023-0615
5142851438
type: string
51439+
last_modification_date:
51440+
description: Vulnerability advisory last modification date.
51441+
example: 2024-09-19 21:23:08+00:00
51442+
type: string
51443+
publish_date:
51444+
description: Vulnerability advisory publish date.
51445+
example: 2024-09-19 21:23:08+00:00
51446+
type: string
51447+
required:
51448+
- id
51449+
type: object
51450+
VulnerabilityAttributes:
51451+
description: The JSON:API attributes of the vulnerability.
51452+
properties:
51453+
advisory:
51454+
$ref: '#/components/schemas/VulnerabilityAdvisory'
5142951455
code_location:
5143051456
$ref: '#/components/schemas/CodeLocation'
5143151457
cve_list:
@@ -70913,7 +70939,7 @@ paths:
7091370939
format: int64
7091470940
minimum: 1
7091570941
type: integer
70916-
- description: Filter by name.
70942+
- description: Filter by name. This field supports the usage of wildcards (*).
7091770943
example: datadog-agent
7091870944
in: query
7091970945
name: filter[name]
@@ -71208,7 +71234,7 @@ paths:
7120871234
security:
7120971235
- apiKeyAuth: []
7121071236
appKeyAuth: []
71211-
summary: List assets SBOMs
71237+
summary: List SBOMs
7121271238
tags:
7121371239
- Security Monitoring
7121471240
x-unstable: '**Note**: This endpoint is a private preview.
@@ -71241,6 +71267,13 @@ paths:
7124171267
required: false
7124271268
schema:
7124371269
type: string
71270+
- description: The standard of the SBOM.
71271+
example: CycloneDX
71272+
in: query
71273+
name: ext:format
71274+
required: false
71275+
schema:
71276+
$ref: '#/components/schemas/SBOMFormat'
7124471277
responses:
7124571278
'200':
7124671279
content:
@@ -71468,12 +71501,16 @@ paths:
7146871501
consider a request to be the first request when there is no `page[token]`
7146971502
parameter.\n\nThe response of this first request contains the newly created
7147071503
token in the `links` section.\n\nThis token can then be used in the subsequent
71471-
paginated requests.\n\n#### Subsequent requests\n\nAny request containing
71504+
paginated requests.\n\n*Note: The first request may take longer to complete
71505+
than subsequent requests.*\n\n#### Subsequent requests\n\nAny request containing
7147271506
valid `page[token]` and `page[number]` parameters will be considered a subsequent
7147371507
request.\n\nIf the `token` is invalid, a `404` response will be returned.\n\nIf
71474-
the page `number` is invalid, a `400` response will be returned.\n\n### Filtering\n\nThe
71475-
request can include some filter parameters to filter the data to be retrieved.
71476-
The format of the filter parameters follows the [JSON:API format](https://jsonapi.org/format/#fetching-filtering):
71508+
the page `number` is invalid, a `400` response will be returned.\n\nThe returned
71509+
`token` remains valid for every request in the pagination sequence. You may
71510+
send paginated requests in parallel by re-using this `token` and varying only
71511+
the `page[number]` parameter.\n\n### Filtering\n\nThe request can include
71512+
some filter parameters to filter the data to be retrieved. The format of the
71513+
filter parameters follows the [JSON:API format](https://jsonapi.org/format/#fetching-filtering):
7147771514
`filter[$prop_name]`, where `prop_name` is the property name in the entity
7147871515
being filtered by.\n\nAll filters can include multiple values, where data
7147971516
will be filtered with an OR clause: `filter[title]=Title1,Title2` will filter
@@ -71488,7 +71525,12 @@ paths:
7148871525
For more details on each of the properties included in this section, check
7148971526
the endpoints response tables.\n\n```JSON\n{\n \"data\": [...],\n \"meta\":
7149071527
{\n \"total\": 1500,\n \"count\": 18732,\n \"token\": \"some_token\"\n
71491-
\ },\n \"links\": {...}\n}\n```"
71528+
\ },\n \"links\": {...}\n}\n```\n### Extensions\n\nThe request in some cases
71529+
can include extensions to update behavior of the endpoint requested. The format
71530+
of the filter parameters follows the [JSON:API format](https://jsonapi.org/extensions/#extensions):
71531+
`ext:$extension_name`, where `extension_name` is the name of the modifier
71532+
that is being applied.\n\nExtensions can only include one value at the moment:
71533+
`ext:modifier=value`."
7149271534
operationId: ListVulnerabilities
7149371535
parameters:
7149471536
- description: Its value must come from the `links` section of the response
@@ -71594,9 +71636,9 @@ paths:
7159471636
schema:
7159571637
type: string
7159671638
- description: Filter by advisory ID.
71597-
example: TRIVY-CVE-2023-0615
71639+
example: CVE-2023-0615
7159871640
in: query
71599-
name: filter[advisory_id]
71641+
name: filter[advisory.id]
7160071642
required: false
7160171643
schema:
7160271644
type: string
@@ -71696,7 +71738,8 @@ paths:
7169671738
required: false
7169771739
schema:
7169871740
type: string
71699-
- description: Filter by asset name.
71741+
- description: Filter by asset name. This field supports the usage of wildcards
71742+
(*).
7170071743
example: datadog-agent
7170171744
in: query
7170271745
name: filter[asset.name]
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@
13131313
"asset_type" => "AssetType",
13141314
"filter_asset_name" => "String",
13151315
"filter_repo_digest" => "String",
1316+
"ext_format" => "SBOMFormat",
13161317
},
13171318
"v2.CreateSignalNotificationRule" => {
13181319
"body" => "CreateNotificationRuleParameters",

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

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: 20 additions & 5 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.
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)