Skip to content

Commit 356980e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Rename RetrieveAwsOnDemandTask operation id (#2275)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent bd7f2ca commit 356980e

File tree

11 files changed

+149
-69
lines changed

11 files changed

+149
-69
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-03-06 16:19:13.708125",
8-
"spec_repo_commit": "1a11ef53"
7+
"regenerated": "2025-03-06 17:12:16.957125",
8+
"spec_repo_commit": "9dd2b6ae"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-06 16:19:13.723185",
13-
"spec_repo_commit": "1a11ef53"
12+
"regenerated": "2025-03-06 17:12:16.974299",
13+
"spec_repo_commit": "9dd2b6ae"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4122,6 +4122,8 @@ components:
41224122
of EC2 instances, lambda functions, AMI, ECR, RDS and S3 buckets.
41234123
example: arn:aws:ec2:us-east-1:727000456123:instance/i-0eabb50529b67a1ba
41244124
type: string
4125+
required:
4126+
- arn
41254127
type: object
41264128
AwsOnDemandCreateData:
41274129
description: Object for a single AWS on demand task.
@@ -4219,6 +4221,11 @@ components:
42194221
description: Indicates if scanning for vulnerabilities in hosts is enabled.
42204222
example: true
42214223
type: boolean
4224+
required:
4225+
- lambda
4226+
- sensitive_data
4227+
- vuln_containers_os
4228+
- vuln_host_os
42224229
type: object
42234230
AwsScanOptionsCreateData:
42244231
description: Object for the scan options of a single AWS account.
@@ -33982,7 +33989,9 @@ paths:
3398233989
permissions:
3398333990
- security_monitoring_findings_read
3398433991
post:
33985-
description: Trigger the scan of an AWS resource with a high priority.
33992+
description: Trigger the scan of an AWS resource with a high priority. Agentless
33993+
scanning must be activated for the AWS account containing the resource to
33994+
scan.
3398633995
operationId: CreateAwsOnDemandTask
3398733996
requestBody:
3398833997
content:
@@ -34015,7 +34024,7 @@ paths:
3401534024
/api/v2/agentless_scanning/ondemand/aws/{task_id}:
3401634025
get:
3401734026
description: Fetch the data of a specific on demand task.
34018-
operationId: RetrieveAwsOnDemandTask
34027+
operationId: GetAwsOnDemandTask
3401934028
parameters:
3402034029
- $ref: '#/components/parameters/OnDemandTaskId'
3402134030
responses:
@@ -53068,8 +53077,9 @@ tags:
5306853077
name: Action Connection
5306953078
- description: "Datadog Agentless Scanning provides visibility into risks and vulnerabilities\nwithin
5307053079
your hosts, running containers, and serverless functions\u2014all without\nrequiring
53071-
teams to install Agents on every host or where Agents cannot be installed.\nGo
53072-
to https://www.datadoghq.com/blog/agentless-scanning/ to learn more."
53080+
teams to install Agents on every host or where Agents cannot be installed.\nAgentless
53081+
offers also Sensitive Data Scanning capabilities on your storage.\nGo to https://www.datadoghq.com/blog/agentless-scanning/
53082+
to learn more."
5307353083
name: Agentless Scanning
5307453084
- description: Datadog App Builder provides a low-code solution to rapidly develop
5307553085
and integrate secure, customized applications into your monitoring stack that
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-03-01T20:02:10.630Z
1+
2025-03-06T11:57:47.413Z

cassettes/features/v2/agentless_scanning/Post-AWS-Scan-Options-returns-Conflict-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.

examples/v2/agentless-scanning/RetrieveAwsOnDemandTask.rb renamed to examples/v2/agentless-scanning/GetAwsOnDemandTask.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
require "datadog_api_client"
44
api_instance = DatadogAPIClient::V2::AgentlessScanningAPI.new
5-
p api_instance.retrieve_aws_on_demand_task("63d6b4f5-e5d0-4d90-824a-9580f05f026a")
5+
p api_instance.get_aws_on_demand_task("63d6b4f5-e5d0-4d90-824a-9580f05f026a")

features/scenarios_model_mapping.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@
853853
"v2.CreateAwsOnDemandTask" => {
854854
"body" => "AwsOnDemandCreateRequest",
855855
},
856-
"v2.RetrieveAwsOnDemandTask" => {
856+
"v2.GetAwsOnDemandTask" => {
857857
"task_id" => "String",
858858
},
859859
"v2.ListAPIKeys" => {

features/v2/agentless_scanning.feature

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Feature: Agentless Scanning
33
Datadog Agentless Scanning provides visibility into risks and
44
vulnerabilities within your hosts, running containers, and serverless
55
functions—all without requiring teams to install Agents on every host or
6-
where Agents cannot be installed. Go to
6+
where Agents cannot be installed. Agentless offers also Sensitive Data
7+
Scanning capabilities on your storage. Go to
78
https://www.datadoghq.com/blog/agentless-scanning/ to learn more.
89

910
Background:
@@ -34,21 +35,21 @@ Feature: Agentless Scanning
3435

3536
@team:DataDog/k9-agentless
3637
Scenario: Get AWS On Demand task by id returns "Bad Request" response
37-
Given new "RetrieveAwsOnDemandTask" request
38+
Given new "GetAwsOnDemandTask" request
3839
And request contains "task_id" parameter with value "invalid-uuid"
3940
When the request is sent
4041
Then the response status is 400 Bad Request
4142

4243
@team:DataDog/k9-agentless
4344
Scenario: Get AWS On Demand task by id returns "Not Found" response
44-
Given new "RetrieveAwsOnDemandTask" request
45+
Given new "GetAwsOnDemandTask" request
4546
And request contains "task_id" parameter with value "00000000-0000-0000-824a-000000000000"
4647
When the request is sent
4748
Then the response status is 404 Not Found
4849

4950
@team:DataDog/k9-agentless
5051
Scenario: Get AWS On Demand task by id returns "OK." response
51-
Given new "RetrieveAwsOnDemandTask" request
52+
Given new "GetAwsOnDemandTask" request
5253
And request contains "task_id" parameter with value "63d6b4f5-e5d0-4d90-824a-9580f05f026a"
5354
When the request is sent
5455
Then the response status is 200 OK
@@ -115,7 +116,7 @@ Feature: Agentless Scanning
115116
@team:DataDog/k9-agentless
116117
Scenario: Post AWS Scan Options returns "Conflict" response
117118
Given new "CreateAwsScanOptions" request
118-
And body with value {"data":{"type":"aws_scan_options","id":"000000000002","attributes":{"vuln_host_os":true,"vuln_containers_os":true,"lambda":false}}}
119+
And body with value {"data":{"type":"aws_scan_options","id":"000000000002","attributes":{"vuln_host_os":true,"vuln_containers_os":true,"sensitive_data":false,"lambda":false}}}
119120
When the request is sent
120121
Then the response status is 409 Conflict
121122

features/v2/undo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"type": "idempotent"
7474
}
7575
},
76-
"RetrieveAwsOnDemandTask": {
76+
"GetAwsOnDemandTask": {
7777
"tag": "Agentless Scanning",
7878
"undo": {
7979
"type": "safe"

lib/datadog_api_client/v2/api/agentless_scanning_api.rb

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def create_aws_on_demand_task(body, opts = {})
3333

3434
# Post an AWS on demand task.
3535
#
36-
# Trigger the scan of an AWS resource with a high priority.
36+
# Trigger the scan of an AWS resource with a high priority. Agentless scanning must be activated for the AWS account containing the resource to scan.
3737
#
3838
# @param body [AwsOnDemandCreateRequest] The definition of the on demand task.
3939
# @param opts [Hash] the optional parameters
@@ -222,27 +222,32 @@ def delete_aws_scan_options_with_http_info(account_id, opts = {})
222222
return data, status_code, headers
223223
end
224224

225-
# Get AWS On Demand tasks.
225+
# Get AWS On Demand task by id.
226226
#
227-
# @see #list_aws_on_demand_tasks_with_http_info
228-
def list_aws_on_demand_tasks(opts = {})
229-
data, _status_code, _headers = list_aws_on_demand_tasks_with_http_info(opts)
227+
# @see #get_aws_on_demand_task_with_http_info
228+
def get_aws_on_demand_task(task_id, opts = {})
229+
data, _status_code, _headers = get_aws_on_demand_task_with_http_info(task_id, opts)
230230
data
231231
end
232232

233-
# Get AWS On Demand tasks.
233+
# Get AWS On Demand task by id.
234234
#
235-
# Fetches the most recent 1000 AWS on demand tasks.
235+
# Fetch the data of a specific on demand task.
236236
#
237+
# @param task_id [String] The UUID of the task.
237238
# @param opts [Hash] the optional parameters
238-
# @return [Array<(AwsOnDemandListResponse, Integer, Hash)>] AwsOnDemandListResponse data, response status code and response headers
239-
def list_aws_on_demand_tasks_with_http_info(opts = {})
239+
# @return [Array<(AwsOnDemandResponse, Integer, Hash)>] AwsOnDemandResponse data, response status code and response headers
240+
def get_aws_on_demand_task_with_http_info(task_id, opts = {})
240241

241242
if @api_client.config.debugging
242-
@api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.list_aws_on_demand_tasks ...'
243+
@api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.get_aws_on_demand_task ...'
244+
end
245+
# verify the required parameter 'task_id' is set
246+
if @api_client.config.client_side_validation && task_id.nil?
247+
fail ArgumentError, "Missing the required parameter 'task_id' when calling AgentlessScanningAPI.get_aws_on_demand_task"
243248
end
244249
# resource path
245-
local_var_path = '/api/v2/agentless_scanning/ondemand/aws'
250+
local_var_path = '/api/v2/agentless_scanning/ondemand/aws/{task_id}'.sub('{task_id}', CGI.escape(task_id.to_s).gsub('%2F', '/'))
246251

247252
# query parameters
248253
query_params = opts[:query_params] || {}
@@ -259,13 +264,13 @@ def list_aws_on_demand_tasks_with_http_info(opts = {})
259264
post_body = opts[:debug_body]
260265

261266
# return_type
262-
return_type = opts[:debug_return_type] || 'AwsOnDemandListResponse'
267+
return_type = opts[:debug_return_type] || 'AwsOnDemandResponse'
263268

264269
# auth_names
265270
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
266271

267272
new_options = opts.merge(
268-
:operation => :list_aws_on_demand_tasks,
273+
:operation => :get_aws_on_demand_task,
269274
:header_params => header_params,
270275
:query_params => query_params,
271276
:form_params => form_params,
@@ -277,32 +282,32 @@ def list_aws_on_demand_tasks_with_http_info(opts = {})
277282

278283
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
279284
if @api_client.config.debugging
280-
@api_client.config.logger.debug "API called: AgentlessScanningAPI#list_aws_on_demand_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
285+
@api_client.config.logger.debug "API called: AgentlessScanningAPI#get_aws_on_demand_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
281286
end
282287
return data, status_code, headers
283288
end
284289

285-
# Get AWS Scan Options.
290+
# Get AWS On Demand tasks.
286291
#
287-
# @see #list_aws_scan_options_with_http_info
288-
def list_aws_scan_options(opts = {})
289-
data, _status_code, _headers = list_aws_scan_options_with_http_info(opts)
292+
# @see #list_aws_on_demand_tasks_with_http_info
293+
def list_aws_on_demand_tasks(opts = {})
294+
data, _status_code, _headers = list_aws_on_demand_tasks_with_http_info(opts)
290295
data
291296
end
292297

293-
# Get AWS Scan Options.
298+
# Get AWS On Demand tasks.
294299
#
295-
# Fetches the scan options configured for AWS accounts.
300+
# Fetches the most recent 1000 AWS on demand tasks.
296301
#
297302
# @param opts [Hash] the optional parameters
298-
# @return [Array<(AwsScanOptionsListResponse, Integer, Hash)>] AwsScanOptionsListResponse data, response status code and response headers
299-
def list_aws_scan_options_with_http_info(opts = {})
303+
# @return [Array<(AwsOnDemandListResponse, Integer, Hash)>] AwsOnDemandListResponse data, response status code and response headers
304+
def list_aws_on_demand_tasks_with_http_info(opts = {})
300305

301306
if @api_client.config.debugging
302-
@api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.list_aws_scan_options ...'
307+
@api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.list_aws_on_demand_tasks ...'
303308
end
304309
# resource path
305-
local_var_path = '/api/v2/agentless_scanning/accounts/aws'
310+
local_var_path = '/api/v2/agentless_scanning/ondemand/aws'
306311

307312
# query parameters
308313
query_params = opts[:query_params] || {}
@@ -319,13 +324,13 @@ def list_aws_scan_options_with_http_info(opts = {})
319324
post_body = opts[:debug_body]
320325

321326
# return_type
322-
return_type = opts[:debug_return_type] || 'AwsScanOptionsListResponse'
327+
return_type = opts[:debug_return_type] || 'AwsOnDemandListResponse'
323328

324329
# auth_names
325330
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
326331

327332
new_options = opts.merge(
328-
:operation => :list_aws_scan_options,
333+
:operation => :list_aws_on_demand_tasks,
329334
:header_params => header_params,
330335
:query_params => query_params,
331336
:form_params => form_params,
@@ -337,37 +342,32 @@ def list_aws_scan_options_with_http_info(opts = {})
337342

338343
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
339344
if @api_client.config.debugging
340-
@api_client.config.logger.debug "API called: AgentlessScanningAPI#list_aws_scan_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
345+
@api_client.config.logger.debug "API called: AgentlessScanningAPI#list_aws_on_demand_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
341346
end
342347
return data, status_code, headers
343348
end
344349

345-
# Get AWS On Demand task by id.
350+
# Get AWS Scan Options.
346351
#
347-
# @see #retrieve_aws_on_demand_task_with_http_info
348-
def retrieve_aws_on_demand_task(task_id, opts = {})
349-
data, _status_code, _headers = retrieve_aws_on_demand_task_with_http_info(task_id, opts)
352+
# @see #list_aws_scan_options_with_http_info
353+
def list_aws_scan_options(opts = {})
354+
data, _status_code, _headers = list_aws_scan_options_with_http_info(opts)
350355
data
351356
end
352357

353-
# Get AWS On Demand task by id.
358+
# Get AWS Scan Options.
354359
#
355-
# Fetch the data of a specific on demand task.
360+
# Fetches the scan options configured for AWS accounts.
356361
#
357-
# @param task_id [String] The UUID of the task.
358362
# @param opts [Hash] the optional parameters
359-
# @return [Array<(AwsOnDemandResponse, Integer, Hash)>] AwsOnDemandResponse data, response status code and response headers
360-
def retrieve_aws_on_demand_task_with_http_info(task_id, opts = {})
363+
# @return [Array<(AwsScanOptionsListResponse, Integer, Hash)>] AwsScanOptionsListResponse data, response status code and response headers
364+
def list_aws_scan_options_with_http_info(opts = {})
361365

362366
if @api_client.config.debugging
363-
@api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.retrieve_aws_on_demand_task ...'
364-
end
365-
# verify the required parameter 'task_id' is set
366-
if @api_client.config.client_side_validation && task_id.nil?
367-
fail ArgumentError, "Missing the required parameter 'task_id' when calling AgentlessScanningAPI.retrieve_aws_on_demand_task"
367+
@api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.list_aws_scan_options ...'
368368
end
369369
# resource path
370-
local_var_path = '/api/v2/agentless_scanning/ondemand/aws/{task_id}'.sub('{task_id}', CGI.escape(task_id.to_s).gsub('%2F', '/'))
370+
local_var_path = '/api/v2/agentless_scanning/accounts/aws'
371371

372372
# query parameters
373373
query_params = opts[:query_params] || {}
@@ -384,13 +384,13 @@ def retrieve_aws_on_demand_task_with_http_info(task_id, opts = {})
384384
post_body = opts[:debug_body]
385385

386386
# return_type
387-
return_type = opts[:debug_return_type] || 'AwsOnDemandResponse'
387+
return_type = opts[:debug_return_type] || 'AwsScanOptionsListResponse'
388388

389389
# auth_names
390390
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
391391

392392
new_options = opts.merge(
393-
:operation => :retrieve_aws_on_demand_task,
393+
:operation => :list_aws_scan_options,
394394
:header_params => header_params,
395395
:query_params => query_params,
396396
:form_params => form_params,
@@ -402,7 +402,7 @@ def retrieve_aws_on_demand_task_with_http_info(task_id, opts = {})
402402

403403
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
404404
if @api_client.config.debugging
405-
@api_client.config.logger.debug "API called: AgentlessScanningAPI#retrieve_aws_on_demand_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
405+
@api_client.config.logger.debug "API called: AgentlessScanningAPI#list_aws_scan_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
406406
end
407407
return data, status_code, headers
408408
end

lib/datadog_api_client/v2/models/aws_on_demand_create_attributes.rb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AwsOnDemandCreateAttributes
2222
include BaseGenericModel
2323

2424
# The arn of the resource to scan. Agentless supports the scan of EC2 instances, lambda functions, AMI, ECR, RDS and S3 buckets.
25-
attr_accessor :arn
25+
attr_reader :arn
2626

2727
attr_accessor :additional_properties
2828

@@ -65,6 +65,24 @@ def initialize(attributes = {})
6565
end
6666
end
6767

68+
# Check to see if the all the properties in the model are valid
69+
# @return true if the model is valid
70+
# @!visibility private
71+
def valid?
72+
return false if @arn.nil?
73+
true
74+
end
75+
76+
# Custom attribute writer method with validation
77+
# @param arn [Object] Object to be assigned
78+
# @!visibility private
79+
def arn=(arn)
80+
if arn.nil?
81+
fail ArgumentError, 'invalid value for "arn", arn cannot be nil.'
82+
end
83+
@arn = arn
84+
end
85+
6886
# Returns the object in the form of hash, with additionalProperties support.
6987
# @return [Hash] Returns the object in the form of hash
7088
# @!visibility private

0 commit comments

Comments
 (0)