Skip to content

Commit 11c56e2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI documentation for cloud-auth-config service (#3115)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent ba375cd commit 11c56e2

14 files changed

+423
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,6 +1834,65 @@ components:
18341834
required:
18351835
- role_name
18361836
type: object
1837+
AWSCloudAuthPersonaMappingAttributesResponse:
1838+
description: Attributes for AWS cloud authentication persona mapping response
1839+
properties:
1840+
account_identifier:
1841+
description: Datadog account identifier (email or handle) mapped to the
1842+
AWS principal
1843+
example: test@test.com
1844+
type: string
1845+
account_uuid:
1846+
description: Datadog account UUID
1847+
example: 12bbdc5c-5966-47e0-8733-285f9e44bcf4
1848+
type: string
1849+
arn_pattern:
1850+
description: AWS IAM ARN pattern to match for authentication
1851+
example: arn:aws:iam::123456789012:user/testuser
1852+
type: string
1853+
required:
1854+
- arn_pattern
1855+
- account_identifier
1856+
- account_uuid
1857+
type: object
1858+
AWSCloudAuthPersonaMappingDataResponse:
1859+
description: Data for AWS cloud authentication persona mapping response
1860+
properties:
1861+
attributes:
1862+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingAttributesResponse'
1863+
id:
1864+
description: Unique identifier for the persona mapping
1865+
example: c5c758c6-18c2-4484-ae3f-46b84128404a
1866+
type: string
1867+
type:
1868+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingType'
1869+
required:
1870+
- id
1871+
- type
1872+
- attributes
1873+
type: object
1874+
AWSCloudAuthPersonaMappingType:
1875+
description: Type identifier for AWS cloud authentication persona mapping
1876+
enum:
1877+
- aws_cloud_auth_config
1878+
example: aws_cloud_auth_config
1879+
type: string
1880+
x-enum-varnames:
1881+
- AWS_CLOUD_AUTH_CONFIG
1882+
AWSCloudAuthPersonaMappingsData:
1883+
description: List of AWS cloud authentication persona mappings
1884+
items:
1885+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingDataResponse'
1886+
type: array
1887+
AWSCloudAuthPersonaMappingsResponse:
1888+
description: Response containing a list of AWS cloud authentication persona
1889+
mappings
1890+
properties:
1891+
data:
1892+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingsData'
1893+
required:
1894+
- data
1895+
type: object
18371896
AWSCredentials:
18381897
description: The definition of `AWSCredentials` object.
18391898
oneOf:
@@ -74551,6 +74610,39 @@ paths:
7455174610
permissions:
7455274611
- ci_visibility_read
7455374612
- test_optimization_read
74613+
/api/v2/cloud_auth/aws/persona_mapping:
74614+
get:
74615+
description: List all AWS cloud authentication persona mappings. This endpoint
74616+
retrieves all configured persona mappings that associate AWS IAM principals
74617+
with Datadog users.
74618+
operationId: ListAWSCloudAuthPersonaMappings
74619+
responses:
74620+
'200':
74621+
content:
74622+
application/json:
74623+
schema:
74624+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingsResponse'
74625+
description: OK
74626+
'400':
74627+
content:
74628+
application/json:
74629+
schema:
74630+
$ref: '#/components/schemas/JSONAPIErrorResponse'
74631+
description: Bad Request
74632+
'403':
74633+
content:
74634+
application/json:
74635+
schema:
74636+
$ref: '#/components/schemas/JSONAPIErrorResponse'
74637+
description: Forbidden
74638+
'429':
74639+
$ref: '#/components/responses/TooManyRequestsResponse'
74640+
summary: List AWS cloud authentication persona mappings
74641+
tags:
74642+
- Cloud Authentication
74643+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
74644+
74645+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
7455474646
/api/v2/cloud_security_management/custom_frameworks:
7455574647
post:
7455674648
description: Create a custom framework.
@@ -104331,6 +104423,9 @@ tags:
104331104423
Management page](https://docs.datadoghq.com/service_management/case_management/)
104332104424
for more information.
104333104425
name: Case Management Type
104426+
- description: Configure AWS cloud authentication mappings for persona and intake
104427+
authentication through the Datadog API.
104428+
name: Cloud Authentication
104334104429
- description: The Cloud Cost Management API allows you to set up, edit, and delete
104335104430
Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query
104336104431
your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products)

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ datadog\_api\_client.v2.api.ci\_visibility\_tests\_api module
123123
:members:
124124
:show-inheritance:
125125

126+
datadog\_api\_client.v2.api.cloud\_authentication\_api module
127+
-------------------------------------------------------------
128+
129+
.. automodule:: datadog_api_client.v2.api.cloud_authentication_api
130+
:members:
131+
:show-inheritance:
132+
126133
datadog\_api\_client.v2.api.cloud\_cost\_management\_api module
127134
---------------------------------------------------------------
128135

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,34 @@ datadog\_api\_client.v2.model.aws\_auth\_config\_role module
17821782
:members:
17831783
:show-inheritance:
17841784

1785+
datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_attributes\_response module
1786+
---------------------------------------------------------------------------------------------
1787+
1788+
.. automodule:: datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_attributes_response
1789+
:members:
1790+
:show-inheritance:
1791+
1792+
datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_data\_response module
1793+
---------------------------------------------------------------------------------------
1794+
1795+
.. automodule:: datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_data_response
1796+
:members:
1797+
:show-inheritance:
1798+
1799+
datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_type module
1800+
-----------------------------------------------------------------------------
1801+
1802+
.. automodule:: datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_type
1803+
:members:
1804+
:show-inheritance:
1805+
1806+
datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mappings\_response module
1807+
----------------------------------------------------------------------------------
1808+
1809+
.. automodule:: datadog_api_client.v2.model.aws_cloud_auth_persona_mappings_response
1810+
:members:
1811+
:show-inheritance:
1812+
17851813
datadog\_api\_client.v2.model.aws\_credentials module
17861814
-----------------------------------------------------
17871815

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
List AWS cloud authentication persona mappings returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.cloud_authentication_api import CloudAuthenticationApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["list_aws_cloud_auth_persona_mappings"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = CloudAuthenticationApi(api_client)
12+
response = api_instance.list_aws_cloud_auth_persona_mappings()
13+
14+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ def __init__(
273273
"v2.link_jira_issue_to_case": False,
274274
"v2.move_case_to_project": False,
275275
"v2.unlink_jira_issue": False,
276+
"v2.list_aws_cloud_auth_persona_mappings": False,
276277
"v2.activate_content_pack": False,
277278
"v2.cancel_threat_hunting_job": False,
278279
"v2.convert_job_result_to_signal": False,
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Any, Dict
7+
8+
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
9+
from datadog_api_client.configuration import Configuration
10+
from datadog_api_client.v2.model.aws_cloud_auth_persona_mappings_response import AWSCloudAuthPersonaMappingsResponse
11+
12+
13+
class CloudAuthenticationApi:
14+
"""
15+
Configure AWS cloud authentication mappings for persona and intake authentication through the Datadog API.
16+
"""
17+
18+
def __init__(self, api_client=None):
19+
if api_client is None:
20+
api_client = ApiClient(Configuration())
21+
self.api_client = api_client
22+
23+
self._list_aws_cloud_auth_persona_mappings_endpoint = _Endpoint(
24+
settings={
25+
"response_type": (AWSCloudAuthPersonaMappingsResponse,),
26+
"auth": ["apiKeyAuth", "appKeyAuth"],
27+
"endpoint_path": "/api/v2/cloud_auth/aws/persona_mapping",
28+
"operation_id": "list_aws_cloud_auth_persona_mappings",
29+
"http_method": "GET",
30+
"version": "v2",
31+
},
32+
params_map={},
33+
headers_map={
34+
"accept": ["application/json"],
35+
},
36+
api_client=api_client,
37+
)
38+
39+
def list_aws_cloud_auth_persona_mappings(
40+
self,
41+
) -> AWSCloudAuthPersonaMappingsResponse:
42+
"""List AWS cloud authentication persona mappings.
43+
44+
List all AWS cloud authentication persona mappings. This endpoint retrieves all configured persona mappings that associate AWS IAM principals with Datadog users.
45+
46+
:rtype: AWSCloudAuthPersonaMappingsResponse
47+
"""
48+
kwargs: Dict[str, Any] = {}
49+
return self._list_aws_cloud_auth_persona_mappings_endpoint.call_with_http_info(**kwargs)

src/datadog_api_client/v2/apis/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
1919
from datadog_api_client.v2.api.case_management_attribute_api import CaseManagementAttributeApi
2020
from datadog_api_client.v2.api.case_management_type_api import CaseManagementTypeApi
21+
from datadog_api_client.v2.api.cloud_authentication_api import CloudAuthenticationApi
2122
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
2223
from datadog_api_client.v2.api.cloud_network_monitoring_api import CloudNetworkMonitoringApi
2324
from datadog_api_client.v2.api.cloudflare_integration_api import CloudflareIntegrationApi
@@ -119,6 +120,7 @@
119120
"CaseManagementApi",
120121
"CaseManagementAttributeApi",
121122
"CaseManagementTypeApi",
123+
"CloudAuthenticationApi",
122124
"CloudCostManagementApi",
123125
"CloudNetworkMonitoringApi",
124126
"CloudflareIntegrationApi",
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelNormal,
9+
cached_property,
10+
)
11+
12+
13+
class AWSCloudAuthPersonaMappingAttributesResponse(ModelNormal):
14+
@cached_property
15+
def openapi_types(_):
16+
return {
17+
"account_identifier": (str,),
18+
"account_uuid": (str,),
19+
"arn_pattern": (str,),
20+
}
21+
22+
attribute_map = {
23+
"account_identifier": "account_identifier",
24+
"account_uuid": "account_uuid",
25+
"arn_pattern": "arn_pattern",
26+
}
27+
28+
def __init__(self_, account_identifier: str, account_uuid: str, arn_pattern: str, **kwargs):
29+
"""
30+
Attributes for AWS cloud authentication persona mapping response
31+
32+
:param account_identifier: Datadog account identifier (email or handle) mapped to the AWS principal
33+
:type account_identifier: str
34+
35+
:param account_uuid: Datadog account UUID
36+
:type account_uuid: str
37+
38+
:param arn_pattern: AWS IAM ARN pattern to match for authentication
39+
:type arn_pattern: str
40+
"""
41+
super().__init__(kwargs)
42+
43+
self_.account_identifier = account_identifier
44+
self_.account_uuid = account_uuid
45+
self_.arn_pattern = arn_pattern
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_attributes_response import (
16+
AWSCloudAuthPersonaMappingAttributesResponse,
17+
)
18+
from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_type import AWSCloudAuthPersonaMappingType
19+
20+
21+
class AWSCloudAuthPersonaMappingDataResponse(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_attributes_response import (
25+
AWSCloudAuthPersonaMappingAttributesResponse,
26+
)
27+
from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_type import AWSCloudAuthPersonaMappingType
28+
29+
return {
30+
"attributes": (AWSCloudAuthPersonaMappingAttributesResponse,),
31+
"id": (str,),
32+
"type": (AWSCloudAuthPersonaMappingType,),
33+
}
34+
35+
attribute_map = {
36+
"attributes": "attributes",
37+
"id": "id",
38+
"type": "type",
39+
}
40+
41+
def __init__(
42+
self_,
43+
attributes: AWSCloudAuthPersonaMappingAttributesResponse,
44+
id: str,
45+
type: AWSCloudAuthPersonaMappingType,
46+
**kwargs,
47+
):
48+
"""
49+
Data for AWS cloud authentication persona mapping response
50+
51+
:param attributes: Attributes for AWS cloud authentication persona mapping response
52+
:type attributes: AWSCloudAuthPersonaMappingAttributesResponse
53+
54+
:param id: Unique identifier for the persona mapping
55+
:type id: str
56+
57+
:param type: Type identifier for AWS cloud authentication persona mapping
58+
:type type: AWSCloudAuthPersonaMappingType
59+
"""
60+
super().__init__(kwargs)
61+
62+
self_.attributes = attributes
63+
self_.id = id
64+
self_.type = type

0 commit comments

Comments
 (0)