Skip to content

Add domain allowlist endpoints #351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-29 20:46:35.814473",
"spec_repo_commit": "c0b9551e"
"regenerated": "2024-10-30 18:57:59.245021",
"spec_repo_commit": "755120dd"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-29 20:46:35.833539",
"spec_repo_commit": "c0b9551e"
"regenerated": "2024-10-30 18:57:59.263439",
"spec_repo_commit": "755120dd"
}
}
}
138 changes: 138 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7115,6 +7115,81 @@ components:
description: The type of the resource. The value should always be device.
type: string
type: object
DomainAllowlist:
description: The email domain allowlist for an org.
properties:
attributes:
$ref: '#/components/schemas/DomainAllowlistAttributes'
id:
description: The unique identifier of the org.
nullable: true
type: string
type:
$ref: '#/components/schemas/DomainAllowlistType'
required:
- type
type: object
DomainAllowlistAttributes:
description: The details of the email domain allowlist.
properties:
domains:
description: The list of domains in the email domain allowlist.
items:
type: string
type: array
enabled:
description: Whether the email domain allowlist is enabled for the org.
type: boolean
type: object
DomainAllowlistRequest:
description: Request containing the desired email domain allowlist configuration.
properties:
data:
$ref: '#/components/schemas/DomainAllowlist'
required:
- data
type: object
DomainAllowlistResponse:
description: Response containing information about the email domain allowlist.
properties:
data:
$ref: '#/components/schemas/DomainAllowlistResponseData'
type: object
DomainAllowlistResponseData:
description: The email domain allowlist response for an org.
properties:
attributes:
$ref: '#/components/schemas/DomainAllowlistResponseDataAttributes'
id:
description: The unique identifier of the org.
nullable: true
type: string
type:
$ref: '#/components/schemas/DomainAllowlistType'
required:
- type
type: object
DomainAllowlistResponseDataAttributes:
description: The details of the email domain allowlist.
properties:
domains:
description: The list of domains in the email domain allowlist.
items:
type: string
type: array
enabled:
description: Whether the email domain allowlist is enabled for the org.
type: boolean
type: object
DomainAllowlistType:
default: domain_allowlist
description: Email domain allowlist allowlist type.
enum:
- domain_allowlist
example: domain_allowlist
type: string
x-enum-varnames:
- DOMAIN_ALLOWLIST
DowntimeCreateRequest:
description: Request for creating a downtime.
properties:
Expand Down Expand Up @@ -29433,6 +29508,61 @@ paths:
tags:
- Dashboard Lists
x-codegen-request-body-name: body
/api/v2/domain_allowlist:
get:
description: Get the domain allowlist for an organization.
operationId: GetDomainAllowlist
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAllowlistResponse'
description: OK
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- org_management
summary: Get Domain Allowlist
tags:
- Domain Allowlist
x-permission:
operator: OR
permissions:
- org_management
patch:
description: Update the domain allowlist for an organization.
operationId: PatchDomainAllowlist
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAllowlistRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAllowlistResponse'
description: OK
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- org_management
summary: Sets Domain Allowlist
tags:
- Domain Allowlist
x-permission:
operator: OR
permissions:
- org_management
/api/v2/dora/deployment:
post:
description: 'Use this API endpoint to provide data about deployments for DORA
Expand Down Expand Up @@ -41786,6 +41916,14 @@ tags:

organization.'
name: Dashboard Lists
- description: 'Configure your Datadog Email Domain Allowlist directly through the
Datadog API.

The Email Domain Allowlist controls the domains that certain datadog emails can
be sent to.

For more information, see the [Domain Allowlist docs page](https://docs.datadoghq.com/account_management/org_settings/domain_allowlist)'
name: Domain Allowlist
- description: '**Note**: Downtime V2 is currently in private beta. To request access,
contact [Datadog support](https://docs.datadoghq.com/help/).

Expand Down
15 changes: 15 additions & 0 deletions examples/v2_domain-allowlist_GetDomainAllowlist.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Get Domain Allowlist returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_domain_allowlist::DomainAllowlistAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = DomainAllowlistAPI::with_config(configuration);
let resp = api.get_domain_allowlist().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
26 changes: 26 additions & 0 deletions examples/v2_domain-allowlist_PatchDomainAllowlist.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Sets Domain Allowlist returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_domain_allowlist::DomainAllowlistAPI;
use datadog_api_client::datadogV2::model::DomainAllowlist;
use datadog_api_client::datadogV2::model::DomainAllowlistAttributes;
use datadog_api_client::datadogV2::model::DomainAllowlistRequest;
use datadog_api_client::datadogV2::model::DomainAllowlistType;

#[tokio::main]
async fn main() {
let body = DomainAllowlistRequest::new(
DomainAllowlist::new(DomainAllowlistType::DOMAIN_ALLOWLIST).attributes(
DomainAllowlistAttributes::new()
.domains(vec!["@static-test-domain.test".to_string()])
.enabled(false),
),
);
let configuration = datadog::Configuration::new();
let api = DomainAllowlistAPI::with_config(configuration);
let resp = api.patch_domain_allowlist(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Loading
Loading