Skip to content

Commit 318d77a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Publish IP allowlist APIs (#1330)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent b50d648 commit 318d77a

27 files changed

+1030
-4
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.4",
7-
"regenerated": "2023-02-17 16:19:14.693597",
8-
"spec_repo_commit": "a05a9d36"
7+
"regenerated": "2023-02-17 18:15:47.499532",
8+
"spec_repo_commit": "0a1c3444"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-02-17 16:19:14.705186",
13-
"spec_repo_commit": "a05a9d36"
12+
"regenerated": "2023-02-17 18:15:47.522391",
13+
"spec_repo_commit": "0a1c3444"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3873,6 +3873,104 @@ components:
38733873
- APP_SEC_HOST_COUNT
38743874
- OBSERVABILITY_PIPELINES_BYTES_PROCESSSED
38753875
- LAMBDA_TRACED_INVOCATIONS_COUNT
3876+
IPAllowlistAttributes:
3877+
description: Attributes of the IP allowlist.
3878+
properties:
3879+
enabled:
3880+
description: Whether the IP allowlist logic is enabled or not.
3881+
type: boolean
3882+
entries:
3883+
description: Array of entries in the IP allowlist.
3884+
items:
3885+
$ref: '#/components/schemas/IPAllowlistEntry'
3886+
type: array
3887+
type: object
3888+
IPAllowlistData:
3889+
description: IP allowlist data.
3890+
properties:
3891+
attributes:
3892+
$ref: '#/components/schemas/IPAllowlistAttributes'
3893+
id:
3894+
description: The unique identifier of the org.
3895+
type: string
3896+
type:
3897+
$ref: '#/components/schemas/IPAllowlistType'
3898+
required:
3899+
- type
3900+
type: object
3901+
IPAllowlistEntry:
3902+
description: IP allowlist entry object.
3903+
properties:
3904+
data:
3905+
$ref: '#/components/schemas/IPAllowlistEntryData'
3906+
required:
3907+
- data
3908+
type: object
3909+
IPAllowlistEntryAttributes:
3910+
description: Attributes of the IP allowlist entry.
3911+
properties:
3912+
cidr_block:
3913+
description: The CIDR block describing the IP range of the entry.
3914+
type: string
3915+
created_at:
3916+
description: Creation time of the entry.
3917+
format: date-time
3918+
readOnly: true
3919+
type: string
3920+
modified_at:
3921+
description: Time of last entry modification.
3922+
format: date-time
3923+
readOnly: true
3924+
type: string
3925+
note:
3926+
description: A note describing the IP allowlist entry.
3927+
type: string
3928+
type: object
3929+
IPAllowlistEntryData:
3930+
description: Data of the IP allowlist entry object.
3931+
properties:
3932+
attributes:
3933+
$ref: '#/components/schemas/IPAllowlistEntryAttributes'
3934+
id:
3935+
description: The unique identifier of the IP allowlist entry.
3936+
type: string
3937+
type:
3938+
$ref: '#/components/schemas/IPAllowlistEntryType'
3939+
required:
3940+
- type
3941+
type: object
3942+
IPAllowlistEntryType:
3943+
default: ip_allowlist_entry
3944+
description: IP allowlist Entry type.
3945+
enum:
3946+
- ip_allowlist_entry
3947+
example: ip_allowlist_entry
3948+
type: string
3949+
x-enum-varnames:
3950+
- IP_ALLOWLIST_ENTRY
3951+
IPAllowlistResponse:
3952+
description: Response containing information about the IP allowlist.
3953+
properties:
3954+
data:
3955+
$ref: '#/components/schemas/IPAllowlistData'
3956+
type: object
3957+
IPAllowlistType:
3958+
default: ip_allowlist
3959+
description: IP allowlist type.
3960+
enum:
3961+
- ip_allowlist
3962+
example: ip_allowlist
3963+
type: string
3964+
x-enum-varnames:
3965+
- IP_ALLOWLIST
3966+
IPAllowlistUpdateRequest:
3967+
description: Update the IP allowlist.
3968+
properties:
3969+
data:
3970+
$ref: '#/components/schemas/IPAllowlistData'
3971+
required:
3972+
- data
3973+
type: object
38763974
IdPMetadataFormData:
38773975
description: The form data submitted to upload IdP metadata
38783976
properties:
@@ -15159,6 +15257,64 @@ paths:
1515915257
tags:
1516015258
- Fastly Integration
1516115259
x-codegen-request-body-name: body
15260+
/api/v2/ip_allowlist:
15261+
get:
15262+
description: Returns the IP allowlist and its enabled or disabled state.
15263+
operationId: GetIPAllowlist
15264+
responses:
15265+
'200':
15266+
content:
15267+
application/json:
15268+
schema:
15269+
$ref: '#/components/schemas/IPAllowlistResponse'
15270+
description: OK
15271+
'403':
15272+
$ref: '#/components/responses/ForbiddenResponse'
15273+
'404':
15274+
$ref: '#/components/responses/NotFoundResponse'
15275+
'429':
15276+
$ref: '#/components/responses/TooManyRequestsResponse'
15277+
security:
15278+
- apiKeyAuth: []
15279+
appKeyAuth: []
15280+
- AuthZ:
15281+
- org_management
15282+
summary: Get IP Allowlist
15283+
tags:
15284+
- IP Allowlist
15285+
patch:
15286+
description: Edit the entries in the IP allowlist, and enable or disable it.
15287+
operationId: UpdateIPAllowlist
15288+
requestBody:
15289+
content:
15290+
application/json:
15291+
schema:
15292+
$ref: '#/components/schemas/IPAllowlistUpdateRequest'
15293+
required: true
15294+
responses:
15295+
'200':
15296+
content:
15297+
application/json:
15298+
schema:
15299+
$ref: '#/components/schemas/IPAllowlistResponse'
15300+
description: OK
15301+
'400':
15302+
$ref: '#/components/responses/BadRequestResponse'
15303+
'403':
15304+
$ref: '#/components/responses/ForbiddenResponse'
15305+
'404':
15306+
$ref: '#/components/responses/NotFoundResponse'
15307+
'429':
15308+
$ref: '#/components/responses/TooManyRequestsResponse'
15309+
security:
15310+
- apiKeyAuth: []
15311+
appKeyAuth: []
15312+
- AuthZ:
15313+
- org_management
15314+
summary: Update IP Allowlist
15315+
tags:
15316+
- IP Allowlist
15317+
x-codegen-request-body-name: body
1516215318
/api/v2/logs:
1516315319
post:
1516415320
description: 'Send your logs to your Datadog platform over HTTP. Limits per
@@ -20909,6 +21065,10 @@ tags:
2090921065
- description: Configure your Datadog Fastly integration directly through the Datadog
2091021066
API.
2091121067
name: Fastly Integration
21068+
- description: 'The IP allowlist API is used to manage the IP addresses that
21069+
21070+
can access the Datadog API and UI.'
21071+
name: IP Allowlist
2091221072
- description: Create, update, delete, and retrieve services which can be associated
2091321073
with incidents.
2091421074
name: Incident Services

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ incidents\_api
9292
:members:
9393
:show-inheritance:
9494

95+
ip\_allowlist\_api
96+
------------------
97+
98+
.. automodule:: datadog_api_client.v2.api.ip_allowlist_api
99+
:members:
100+
:show-inheritance:
101+
95102
key\_management\_api
96103
--------------------
97104

docs/datadog_api_client.v2.model.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2227,6 +2227,69 @@ intake\_payload\_accepted
22272227
:members:
22282228
:show-inheritance:
22292229

2230+
ip\_allowlist\_attributes
2231+
-------------------------
2232+
2233+
.. automodule:: datadog_api_client.v2.model.ip_allowlist_attributes
2234+
:members:
2235+
:show-inheritance:
2236+
2237+
ip\_allowlist\_data
2238+
-------------------
2239+
2240+
.. automodule:: datadog_api_client.v2.model.ip_allowlist_data
2241+
:members:
2242+
:show-inheritance:
2243+
2244+
ip\_allowlist\_entry
2245+
--------------------
2246+
2247+
.. automodule:: datadog_api_client.v2.model.ip_allowlist_entry
2248+
:members:
2249+
:show-inheritance:
2250+
2251+
ip\_allowlist\_entry\_attributes
2252+
--------------------------------
2253+
2254+
.. automodule:: datadog_api_client.v2.model.ip_allowlist_entry_attributes
2255+
:members:
2256+
:show-inheritance:
2257+
2258+
ip\_allowlist\_entry\_data
2259+
--------------------------
2260+
2261+
.. automodule:: datadog_api_client.v2.model.ip_allowlist_entry_data
2262+
:members:
2263+
:show-inheritance:
2264+
2265+
ip\_allowlist\_entry\_type
2266+
--------------------------
2267+
2268+
.. automodule:: datadog_api_client.v2.model.ip_allowlist_entry_type
2269+
:members:
2270+
:show-inheritance:
2271+
2272+
ip\_allowlist\_response
2273+
-----------------------
2274+
2275+
.. automodule:: datadog_api_client.v2.model.ip_allowlist_response
2276+
:members:
2277+
:show-inheritance:
2278+
2279+
ip\_allowlist\_type
2280+
-------------------
2281+
2282+
.. automodule:: datadog_api_client.v2.model.ip_allowlist_type
2283+
:members:
2284+
:show-inheritance:
2285+
2286+
ip\_allowlist\_update\_request
2287+
------------------------------
2288+
2289+
.. automodule:: datadog_api_client.v2.model.ip_allowlist_update_request
2290+
:members:
2291+
:show-inheritance:
2292+
22302293
list\_application\_keys\_response
22312294
---------------------------------
22322295

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Get IP Allowlist returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.ip_allowlist_api import IPAllowlistApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = IPAllowlistApi(api_client)
11+
response = api_instance.get_ip_allowlist()
12+
13+
print(response)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""
2+
Update IP Allowlist returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.ip_allowlist_api import IPAllowlistApi
7+
from datadog_api_client.v2.model.ip_allowlist_attributes import IPAllowlistAttributes
8+
from datadog_api_client.v2.model.ip_allowlist_data import IPAllowlistData
9+
from datadog_api_client.v2.model.ip_allowlist_entry import IPAllowlistEntry
10+
from datadog_api_client.v2.model.ip_allowlist_entry_attributes import IPAllowlistEntryAttributes
11+
from datadog_api_client.v2.model.ip_allowlist_entry_data import IPAllowlistEntryData
12+
from datadog_api_client.v2.model.ip_allowlist_entry_type import IPAllowlistEntryType
13+
from datadog_api_client.v2.model.ip_allowlist_type import IPAllowlistType
14+
from datadog_api_client.v2.model.ip_allowlist_update_request import IPAllowlistUpdateRequest
15+
16+
body = IPAllowlistUpdateRequest(
17+
data=IPAllowlistData(
18+
attributes=IPAllowlistAttributes(
19+
entries=[
20+
IPAllowlistEntry(
21+
data=IPAllowlistEntryData(
22+
attributes=IPAllowlistEntryAttributes(
23+
note="Example-Update_IP_Allowlist_returns_OK_response",
24+
cidr_block="127.0.0.1",
25+
),
26+
type=IPAllowlistEntryType.IP_ALLOWLIST_ENTRY,
27+
),
28+
),
29+
],
30+
enabled=False,
31+
),
32+
type=IPAllowlistType.IP_ALLOWLIST,
33+
),
34+
)
35+
36+
configuration = Configuration()
37+
with ApiClient(configuration) as api_client:
38+
api_instance = IPAllowlistApi(api_client)
39+
response = api_instance.update_ip_allowlist(body=body)
40+
41+
print(response)

0 commit comments

Comments
 (0)