Skip to content

Commit c03b812

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 092c127 of spec repo (#2788)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 0b4a0db commit c03b812

15 files changed

+200
-6
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46152,7 +46152,7 @@ paths:
4615246152
$ref: '#/components/responses/NotAuthorizedResponse'
4615346153
'429':
4615446154
$ref: '#/components/responses/TooManyRequestsResponse'
46155-
summary: Get AWS Scan Options
46155+
summary: List AWS Scan Options
4615646156
tags:
4615746157
- Agentless Scanning
4615846158
post:
@@ -46204,6 +46204,29 @@ paths:
4620446204
summary: Delete AWS Scan Options
4620546205
tags:
4620646206
- Agentless Scanning
46207+
get:
46208+
description: Fetches the Agentless scan options for an activated account.
46209+
operationId: GetAwsScanOptions
46210+
parameters:
46211+
- $ref: '#/components/parameters/AwsAccountId'
46212+
responses:
46213+
'200':
46214+
content:
46215+
application/json:
46216+
schema:
46217+
$ref: '#/components/schemas/AwsScanOptionsResponse'
46218+
description: OK
46219+
'400':
46220+
$ref: '#/components/responses/BadRequestResponse'
46221+
'403':
46222+
$ref: '#/components/responses/NotAuthorizedResponse'
46223+
'404':
46224+
$ref: '#/components/responses/NotFoundResponse'
46225+
'429':
46226+
$ref: '#/components/responses/TooManyRequestsResponse'
46227+
summary: Get AWS scan options
46228+
tags:
46229+
- Agentless Scanning
4620746230
patch:
4620846231
description: Update the Agentless scan options for an activated account.
4620946232
operationId: UpdateAwsScanOptions
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Get AWS scan options returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.agentless_scanning_api import AgentlessScanningApi
8+
9+
# there is a valid "aws_scan_options" in the system
10+
AWS_SCAN_OPTIONS_ID = environ["AWS_SCAN_OPTIONS_ID"]
11+
12+
configuration = Configuration()
13+
with ApiClient(configuration) as api_client:
14+
api_instance = AgentlessScanningApi(api_client)
15+
response = api_instance.get_aws_scan_options(
16+
account_id=AWS_SCAN_OPTIONS_ID,
17+
)
18+
19+
print(response)

examples/v2/agentless-scanning/ListAwsScanOptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Get AWS Scan Options returns "OK" response
2+
List AWS Scan Options returns "OK" response
33
"""
44

55
from datadog_api_client import ApiClient, Configuration

src/datadog_api_client/v2/api/agentless_scanning_api.py

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,29 @@ def __init__(self, api_client=None):
116116
api_client=api_client,
117117
)
118118

119+
self._get_aws_scan_options_endpoint = _Endpoint(
120+
settings={
121+
"response_type": (AwsScanOptionsResponse,),
122+
"auth": ["apiKeyAuth", "appKeyAuth"],
123+
"endpoint_path": "/api/v2/agentless_scanning/accounts/aws/{account_id}",
124+
"operation_id": "get_aws_scan_options",
125+
"http_method": "GET",
126+
"version": "v2",
127+
},
128+
params_map={
129+
"account_id": {
130+
"required": True,
131+
"openapi_types": (str,),
132+
"attribute": "account_id",
133+
"location": "path",
134+
},
135+
},
136+
headers_map={
137+
"accept": ["application/json"],
138+
},
139+
api_client=api_client,
140+
)
141+
119142
self._list_aws_on_demand_tasks_endpoint = _Endpoint(
120143
settings={
121144
"response_type": (AwsOnDemandListResponse,),
@@ -242,6 +265,23 @@ def get_aws_on_demand_task(
242265

243266
return self._get_aws_on_demand_task_endpoint.call_with_http_info(**kwargs)
244267

268+
def get_aws_scan_options(
269+
self,
270+
account_id: str,
271+
) -> AwsScanOptionsResponse:
272+
"""Get AWS scan options.
273+
274+
Fetches the Agentless scan options for an activated account.
275+
276+
:param account_id: The ID of an AWS account.
277+
:type account_id: str
278+
:rtype: AwsScanOptionsResponse
279+
"""
280+
kwargs: Dict[str, Any] = {}
281+
kwargs["account_id"] = account_id
282+
283+
return self._get_aws_scan_options_endpoint.call_with_http_info(**kwargs)
284+
245285
def list_aws_on_demand_tasks(
246286
self,
247287
) -> AwsOnDemandListResponse:
@@ -257,7 +297,7 @@ def list_aws_on_demand_tasks(
257297
def list_aws_scan_options(
258298
self,
259299
) -> AwsScanOptionsListResponse:
260-
"""Get AWS Scan Options.
300+
"""List AWS Scan Options.
261301
262302
Fetches the scan options configured for AWS accounts.
263303
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-08-27T13:04:35.618Z
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
accept:
6+
- application/json
7+
method: GET
8+
uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws/not-an-account-id
9+
response:
10+
body:
11+
string: '{"errors":[{"title":"Generic Error","detail":"missing or invalid url
12+
parameter ''accountId'', expected 12 digit format ''123456789012''"}]}'
13+
headers:
14+
content-type:
15+
- application/vnd.api+json
16+
status:
17+
code: 400
18+
message: Bad Request
19+
version: 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-08-27T01:14:07.103Z
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
accept:
6+
- application/json
7+
method: GET
8+
uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws/404404404404
9+
response:
10+
body:
11+
string: '{"errors":[{"status":"404","detail":"no aws scan options found for
12+
subscription 404404404404"}]}'
13+
headers:
14+
content-type:
15+
- application/vnd.api+json
16+
status:
17+
code: 404
18+
message: Not Found
19+
version: 1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-03-01T20:02:08.552Z
1+
2025-08-27T01:14:24.197Z

tests/v2/cassettes/test_scenarios/test_get_aws_scan_options_returns_ok_response.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,23 @@ interactions:
88
uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws
99
response:
1010
body:
11-
string: '{"data":[{"id":"000000000002","type":"aws_scan_options","attributes":{"lambda":false,"sensitive_data":false,"vuln_containers_os":true,"vuln_host_os":true}}]}'
11+
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}}]}'
12+
headers:
13+
content-type:
14+
- application/vnd.api+json
15+
status:
16+
code: 200
17+
message: OK
18+
- request:
19+
body: null
20+
headers:
21+
accept:
22+
- application/json
23+
method: GET
24+
uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/aws/000000000002
25+
response:
26+
body:
27+
string: '{"data":{"id":"000000000002","type":"aws_scan_options","attributes":{"lambda":false,"sensitive_data":false,"vuln_containers_os":true,"vuln_host_os":true}}}'
1228
headers:
1329
content-type:
1430
- application/vnd.api+json

0 commit comments

Comments
 (0)