Skip to content

Commit 8d15a60

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9a73736 of spec repo
1 parent 07c5c19 commit 8d15a60

File tree

10 files changed

+277
-36
lines changed

10 files changed

+277
-36
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41081,6 +41081,16 @@ components:
4108141081
example: report_id
4108241082
type: string
4108341083
type: object
41084+
SbomFormat:
41085+
description: The SBOM standard
41086+
enum:
41087+
- CycloneDX
41088+
- SPDX
41089+
example: CycloneDX
41090+
type: string
41091+
x-enum-varnames:
41092+
- CYCLONEDX
41093+
- SPDX
4108441094
ScalarColumn:
4108541095
description: A single column in a scalar query response.
4108641096
oneOf:
@@ -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,7 +71501,8 @@ 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
7147471508
the page `number` is invalid, a `400` response will be returned.\n\n### Filtering\n\nThe
@@ -71488,7 +71522,12 @@ paths:
7148871522
For more details on each of the properties included in this section, check
7148971523
the endpoints response tables.\n\n```JSON\n{\n \"data\": [...],\n \"meta\":
7149071524
{\n \"total\": 1500,\n \"count\": 18732,\n \"token\": \"some_token\"\n
71491-
\ },\n \"links\": {...}\n}\n```"
71525+
\ },\n \"links\": {...}\n}\n```\n### Extensions\n\nThe request in some cases
71526+
can include extensions to update behavior of the endpoint requested. The format
71527+
of the filter parameters follows the [JSON:API format](https://jsonapi.org/extensions/#extensions):
71528+
`ext:$extension_name`, where `extension_name` is the name of the modifier
71529+
that is being applied.\n\nExtensions can only include one value at the moment:
71530+
`ext:modifier=value`."
7149271531
operationId: ListVulnerabilities
7149371532
parameters:
7149471533
- description: Its value must come from the `links` section of the response
@@ -71596,7 +71635,7 @@ paths:
7159671635
- description: Filter by advisory ID.
7159771636
example: TRIVY-CVE-2023-0615
7159871637
in: query
71599-
name: filter[advisory_id]
71638+
name: filter[advisory.id]
7160071639
required: false
7160171640
schema:
7160271641
type: string
@@ -71696,7 +71735,8 @@ paths:
7169671735
required: false
7169771736
schema:
7169871737
type: string
71699-
- description: Filter by asset name.
71738+
- description: Filter by asset name. This field supports the usage of wildcards
71739+
(*).
7170071740
example: datadog-agent
7170171741
in: query
7170271742
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: 18 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.
@@ -3456,6 +3464,11 @@ def list_vulnerabilities(opts = {})
34563464
# "links": {...}
34573465
# }
34583466
# ```
3467+
# ### Extensions
3468+
#
3469+
# 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.
3470+
#
3471+
# Extensions can only include one value at the moment: `ext:modifier=value`.
34593472
#
34603473
# @param opts [Hash] the optional parameters
34613474
# @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 +3498,7 @@ def list_vulnerabilities(opts = {})
34853498
# @option opts [Boolean] :filter_fix_available Filter by fix availability.
34863499
# @option opts [String] :filter_repo_digests Filter by vulnerability `repo_digest` (when the vulnerability is related to `Image` asset).
34873500
# @option opts [String] :filter_origin Filter by origin.
3488-
# @option opts [String] :filter_asset_name Filter by asset name.
3501+
# @option opts [String] :filter_asset_name Filter by asset name. This field supports the usage of wildcards (*).
34893502
# @option opts [AssetType] :filter_asset_type Filter by asset type.
34903503
# @option opts [String] :filter_asset_version_first Filter by the first version of the asset this vulnerability has been detected on.
34913504
# @option opts [String] :filter_asset_version_last Filter by the last version of the asset this vulnerability has been detected on.
@@ -3583,7 +3596,7 @@ def list_vulnerabilities_with_http_info(opts = {})
35833596
query_params[:'filter[tool]'] = opts[:'filter_tool'] if !opts[:'filter_tool'].nil?
35843597
query_params[:'filter[library.name]'] = opts[:'filter_library_name'] if !opts[:'filter_library_name'].nil?
35853598
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?
3599+
query_params[:'filter[advisory.id]'] = opts[:'filter_advisory_id'] if !opts[:'filter_advisory_id'].nil?
35873600
query_params[:'filter[risks.exploitation_probability]'] = opts[:'filter_risks_exploitation_probability'] if !opts[:'filter_risks_exploitation_probability'].nil?
35883601
query_params[:'filter[risks.poc_exploit_available]'] = opts[:'filter_risks_poc_exploit_available'] if !opts[:'filter_risks_poc_exploit_available'].nil?
35893602
query_params[:'filter[risks.exploit_available]'] = opts[:'filter_risks_exploit_available'] if !opts[:'filter_risks_exploit_available'].nil?
@@ -3675,7 +3688,7 @@ def list_vulnerable_assets(opts = {})
36753688
# @param opts [Hash] the optional parameters
36763689
# @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.
36773690
# @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.
3691+
# @option opts [String] :filter_name Filter by name. This field supports the usage of wildcards (*).
36793692
# @option opts [AssetType] :filter_type Filter by type.
36803693
# @option opts [String] :filter_version_first Filter by the first version of the asset since it has been vulnerable.
36813694
# @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+
Contact: support@datadoghq.com
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)