Skip to content
Open
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
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "98e3371",
"generated": "2025-08-27 08:45:21.765"
"spec_repo_commit": "9e8e271",
"generated": "2025-08-27 13:11:08.001"
}
25 changes: 24 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46082,7 +46082,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 @@ -46134,6 +46134,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
19 changes: 19 additions & 0 deletions examples/v2/agentless-scanning/GetAwsScanOptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Get AWS scan options returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.agentless_scanning_api import AgentlessScanningApi

# there is a valid "aws_scan_options" in the system
AWS_SCAN_OPTIONS_ID = environ["AWS_SCAN_OPTIONS_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = AgentlessScanningApi(api_client)
response = api_instance.get_aws_scan_options(
account_id=AWS_SCAN_OPTIONS_ID,
)

print(response)
2 changes: 1 addition & 1 deletion examples/v2/agentless-scanning/ListAwsScanOptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Get AWS Scan Options returns "OK" response
List AWS Scan Options returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
Expand Down
42 changes: 41 additions & 1 deletion src/datadog_api_client/v2/api/agentless_scanning_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,29 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._get_aws_scan_options_endpoint = _Endpoint(
settings={
"response_type": (AwsScanOptionsResponse,),
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/agentless_scanning/accounts/aws/{account_id}",
"operation_id": "get_aws_scan_options",
"http_method": "GET",
"version": "v2",
},
params_map={
"account_id": {
"required": True,
"openapi_types": (str,),
"attribute": "account_id",
"location": "path",
},
},
headers_map={
"accept": ["application/json"],
},
api_client=api_client,
)

self._list_aws_on_demand_tasks_endpoint = _Endpoint(
settings={
"response_type": (AwsOnDemandListResponse,),
Expand Down Expand Up @@ -242,6 +265,23 @@ def get_aws_on_demand_task(

return self._get_aws_on_demand_task_endpoint.call_with_http_info(**kwargs)

def get_aws_scan_options(
self,
account_id: str,
) -> AwsScanOptionsResponse:
"""Get AWS scan options.

Fetches the Agentless scan options for an activated account.

:param account_id: The ID of an AWS account.
:type account_id: str
:rtype: AwsScanOptionsResponse
"""
kwargs: Dict[str, Any] = {}
kwargs["account_id"] = account_id

return self._get_aws_scan_options_endpoint.call_with_http_info(**kwargs)

def list_aws_on_demand_tasks(
self,
) -> AwsOnDemandListResponse:
Expand All @@ -257,7 +297,7 @@ def list_aws_on_demand_tasks(
def list_aws_scan_options(
self,
) -> AwsScanOptionsListResponse:
"""Get AWS Scan Options.
"""List AWS Scan Options.

Fetches the scan options configured for AWS accounts.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-08-27T13:04:35.618Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
interactions:
- request:
body: null
headers:
accept:
- application/json
method: GET
uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws/not-an-account-id
response:
body:
string: '{"errors":[{"title":"Generic Error","detail":"missing or invalid url
parameter ''accountId'', expected 12 digit format ''123456789012''"}]}'
headers:
content-type:
- application/vnd.api+json
status:
code: 400
message: Bad Request
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-08-27T01:14:07.103Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
interactions:
- request:
body: null
headers:
accept:
- application/json
method: GET
uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws/404404404404
response:
body:
string: '{"errors":[{"status":"404","detail":"no aws scan options found for
subscription 404404404404"}]}'
headers:
content-type:
- application/vnd.api+json
status:
code: 404
message: Not Found
version: 1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-03-01T20:02:08.552Z
2025-08-27T01:14:24.197Z
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ interactions:
uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws
response:
body:
string: '{"data":[{"id":"000000000002","type":"aws_scan_options","attributes":{"lambda":false,"sensitive_data":false,"vuln_containers_os":true,"vuln_host_os":true}}]}'
string: '{"data":[{"id":"000000000002","type":"aws_scan_options","attributes":{"lambda":false,"sensitive_data":false,"vuln_containers_os":true,"vuln_host_os":true}},{"id":"123456789012","type":"aws_scan_options","attributes":{"lambda":true,"sensitive_data":true,"vuln_containers_os":true,"vuln_host_os":true}}]}'
headers:
content-type:
- application/vnd.api+json
status:
code: 200
message: OK
- request:
body: null
headers:
accept:
- application/json
method: GET
uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws/000000000002
response:
body:
string: '{"data":{"id":"000000000002","type":"aws_scan_options","attributes":{"lambda":false,"sensitive_data":false,"vuln_containers_os":true,"vuln_host_os":true}}}'
headers:
content-type:
- application/vnd.api+json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-08-24T22:53:40.600Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
interactions:
- request:
body: null
headers:
accept:
- application/json
method: GET
uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws
response:
body:
string: '{"data":[{"id":"000000000002","type":"aws_scan_options","attributes":{"lambda":false,"sensitive_data":false,"vuln_containers_os":true,"vuln_host_os":true}},{"id":"123456789012","type":"aws_scan_options","attributes":{"lambda":true,"sensitive_data":true,"vuln_containers_os":true,"vuln_host_os":true}}]}'
headers:
content-type:
- application/vnd.api+json
status:
code: 200
message: OK
version: 1
26 changes: 25 additions & 1 deletion tests/v2/features/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 tests/v2/features/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 tests/v2/features/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
Loading