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
25 changes: 24 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46152,7 +46152,7 @@ paths:
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get AWS Scan Options
summary: List AWS Scan Options
tags:
- Agentless Scanning
post:
Expand Down Expand Up @@ -46204,6 +46204,29 @@ paths:
summary: Delete AWS Scan Options
tags:
- Agentless Scanning
get:
description: Fetches the Agentless scan options for an activated account.
operationId: GetAwsScanOptions
parameters:
- $ref: '#/components/parameters/AwsAccountId'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/AwsScanOptionsResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get AWS scan options
tags:
- Agentless Scanning
patch:
description: Update the Agentless scan options for an activated account.
operationId: UpdateAwsScanOptions
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-08-27T13:04:35.618Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-08-27T01:14:07.103Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-08-27T01:14:24.197Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-08-24T22:53:40.600Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions examples/v2/agentless-scanning/GetAwsScanOptions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get AWS scan options returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::AgentlessScanningAPI.new

# there is a valid "aws_scan_options" in the system
AWS_SCAN_OPTIONS_ID = ENV["AWS_SCAN_OPTIONS_ID"]
p api_instance.get_aws_scan_options(AWS_SCAN_OPTIONS_ID)
2 changes: 1 addition & 1 deletion examples/v2/agentless-scanning/ListAwsScanOptions.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Get AWS Scan Options returns "OK" response
# List AWS Scan Options returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::AgentlessScanningAPI.new
Expand Down
3 changes: 3 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,9 @@
"v2.DeleteAwsScanOptions" => {
"account_id" => "String",
},
"v2.GetAwsScanOptions" => {
"account_id" => "String",
},
"v2.UpdateAwsScanOptions" => {
"account_id" => "String",
"body" => "AwsScanOptionsUpdateRequest",
Expand Down
26 changes: 25 additions & 1 deletion features/v2/agentless_scanning.feature
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,31 @@ Feature: Agentless Scanning
And the response "data[0].type" is equal to "aws_resource"

@team:DataDog/k9-agentless
Scenario: Get AWS Scan Options returns "OK" response
Scenario: Get AWS scan options returns "Bad Request" response
Given new "GetAwsScanOptions" request
And request contains "account_id" parameter with value "not-an-account-id"
When the request is sent
Then the response status is 400 Bad Request

@team:DataDog/k9-agentless
Scenario: Get AWS scan options returns "Not Found" response
Given new "GetAwsScanOptions" request
And request contains "account_id" parameter with value "404404404404"
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/k9-agentless
Scenario: Get AWS scan options returns "OK" response
Given there is a valid "aws_scan_options" in the system
And new "GetAwsScanOptions" request
And request contains "account_id" parameter with value "{{ aws_scan_options.id }}"
When the request is sent
Then the response status is 200 OK
And the response "data.id" is equal to "{{ aws_scan_options.id }}"
And the response "data.type" is equal to "{{ aws_scan_options.type }}"

@team:DataDog/k9-agentless
Scenario: List AWS Scan Options returns "OK" response
Given new "ListAwsScanOptions" request
When the request is sent
Then the response status is 200 OK
Expand Down
7 changes: 7 additions & 0 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"tag": "Action Connection",
"operationId": "CreateActionConnection"
},
{
"source": "data[0]",
"step": "there is a valid \"aws_scan_options\" in the system",
"key": "aws_scan_options",
"tag": "Agentless Scanning",
"operationId": "ListAwsScanOptions"
},
{
"parameters": [
{
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@
"type": "idempotent"
}
},
"GetAwsScanOptions": {
"tag": "Agentless Scanning",
"undo": {
"type": "safe"
}
},
"UpdateAwsScanOptions": {
"tag": "Agentless Scanning",
"undo": {
Expand Down
69 changes: 67 additions & 2 deletions lib/datadog_api_client/v2/api/agentless_scanning_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,71 @@ def get_aws_on_demand_task_with_http_info(task_id, opts = {})
return data, status_code, headers
end

# Get AWS scan options.
#
# @see #get_aws_scan_options_with_http_info
def get_aws_scan_options(account_id, opts = {})
data, _status_code, _headers = get_aws_scan_options_with_http_info(account_id, opts)
data
end

# Get AWS scan options.
#
# Fetches the Agentless scan options for an activated account.
#
# @param account_id [String] The ID of an AWS account.
# @param opts [Hash] the optional parameters
# @return [Array<(AwsScanOptionsResponse, Integer, Hash)>] AwsScanOptionsResponse data, response status code and response headers
def get_aws_scan_options_with_http_info(account_id, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.get_aws_scan_options ...'
end
# verify the required parameter 'account_id' is set
if @api_client.config.client_side_validation && account_id.nil?
fail ArgumentError, "Missing the required parameter 'account_id' when calling AgentlessScanningAPI.get_aws_scan_options"
end
# resource path
local_var_path = '/api/v2/agentless_scanning/accounts/aws/{account_id}'.sub('{account_id}', CGI.escape(account_id.to_s).gsub('%2F', '/'))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'AwsScanOptionsResponse'

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

new_options = opts.merge(
:operation => :get_aws_scan_options,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: AgentlessScanningAPI#get_aws_scan_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get AWS On Demand tasks.
#
# @see #list_aws_on_demand_tasks_with_http_info
Expand Down Expand Up @@ -347,15 +412,15 @@ def list_aws_on_demand_tasks_with_http_info(opts = {})
return data, status_code, headers
end

# Get AWS Scan Options.
# List AWS Scan Options.
#
# @see #list_aws_scan_options_with_http_info
def list_aws_scan_options(opts = {})
data, _status_code, _headers = list_aws_scan_options_with_http_info(opts)
data
end

# Get AWS Scan Options.
# List AWS Scan Options.
#
# Fetches the scan options configured for AWS accounts.
#
Expand Down
Loading