datadog_api_client.v2.api

audit_api

class AuditApi(api_client=None)

Bases: object

Search your Audit Logs events over HTTP.

list_audit_logs(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: AuditLogsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) AuditLogsEventsResponse

Get a list of Audit Logs events.

List endpoint returns events that match a Audit Logs search query. Results are paginated.

Use this endpoint to see your latest Audit Logs events.

Parameters:
  • filter_query (str, optional) – Search query following Audit Logs syntax.

  • filter_from (datetime, optional) – Minimum timestamp for requested events.

  • filter_to (datetime, optional) – Maximum timestamp for requested events.

  • sort (AuditLogsSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Return type:

AuditLogsEventsResponse

list_audit_logs_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: AuditLogsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[AuditLogsEvent]

Get a list of Audit Logs events.

Provide a paginated version of list_audit_logs(), returning all items.

Parameters:
  • filter_query (str, optional) – Search query following Audit Logs syntax.

  • filter_from (datetime, optional) – Minimum timestamp for requested events.

  • filter_to (datetime, optional) – Maximum timestamp for requested events.

  • sort (AuditLogsSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[AuditLogsEvent]

search_audit_logs(*, body: AuditLogsSearchEventsRequest | UnsetType = UnsetType.unset) AuditLogsEventsResponse

Search Audit Logs events.

List endpoint returns Audit Logs events that match an Audit search query. Results are paginated.

Use this endpoint to build complex Audit Logs events filtering and search.

Return type:

AuditLogsEventsResponse

search_audit_logs_with_pagination(*, body: AuditLogsSearchEventsRequest | UnsetType = UnsetType.unset) Iterable[AuditLogsEvent]

Search Audit Logs events.

Provide a paginated version of search_audit_logs(), returning all items.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[AuditLogsEvent]

authn_mappings_api

class AuthNMappingsApi(api_client=None)

Bases: object

AuthN Mappings API is used to automatically map group of users to roles in Datadog using attributes sent from Identity Providers.

create_authn_mapping(body: AuthNMappingCreateRequest) AuthNMappingResponse

Create an AuthN Mapping.

Create an AuthN Mapping.

Return type:

AuthNMappingResponse

delete_authn_mapping(authn_mapping_id: str) None

Delete an AuthN Mapping.

Delete an AuthN Mapping specified by AuthN Mapping UUID.

Parameters:

authn_mapping_id (str) – The UUID of the AuthN Mapping.

Return type:

None

get_authn_mapping(authn_mapping_id: str) AuthNMappingResponse

Get an AuthN Mapping by UUID.

Get an AuthN Mapping specified by the AuthN Mapping UUID.

Parameters:

authn_mapping_id (str) – The UUID of the AuthN Mapping.

Return type:

AuthNMappingResponse

list_authn_mappings(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: AuthNMappingsSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset) AuthNMappingsResponse

List all AuthN Mappings.

List all AuthN Mappings in the org.

Parameters:
  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_number (int, optional) – Specific page number to return.

  • sort (AuthNMappingsSort, optional) – Sort AuthN Mappings depending on the given field.

  • filter (str, optional) – Filter all mappings by the given string.

Return type:

AuthNMappingsResponse

update_authn_mapping(authn_mapping_id: str, body: AuthNMappingUpdateRequest) AuthNMappingResponse

Edit an AuthN Mapping.

Edit an AuthN Mapping.

Parameters:

authn_mapping_id (str) – The UUID of the AuthN Mapping.

Return type:

AuthNMappingResponse

ci_visibility_pipelines_api

class CIVisibilityPipelinesApi(api_client=None)

Bases: object

Search or aggregate your CI Visibility pipeline events over HTTP.

aggregate_ci_app_pipeline_events(body: CIAppPipelinesAggregateRequest) CIAppPipelinesAnalyticsAggregateResponse

Aggregate pipelines events.

The API endpoint to aggregate CI Visibility pipeline events into buckets of computed metrics and timeseries.

Return type:

CIAppPipelinesAnalyticsAggregateResponse

list_ci_app_pipeline_events(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: CIAppSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) CIAppPipelineEventsResponse

Get a list of pipelines events.

List endpoint returns CI Visibility pipeline events that match a log search query. Results are paginated similarly to logs.

Use this endpoint to see your latest pipeline events.

Parameters:
  • filter_query (str, optional) – Search query following log syntax.

  • filter_from (datetime, optional) – Minimum timestamp for requested events.

  • filter_to (datetime, optional) – Maximum timestamp for requested events.

  • sort (CIAppSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Return type:

CIAppPipelineEventsResponse

list_ci_app_pipeline_events_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: CIAppSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[CIAppPipelineEvent]

Get a list of pipelines events.

Provide a paginated version of list_ci_app_pipeline_events(), returning all items.

Parameters:
  • filter_query (str, optional) – Search query following log syntax.

  • filter_from (datetime, optional) – Minimum timestamp for requested events.

  • filter_to (datetime, optional) – Maximum timestamp for requested events.

  • sort (CIAppSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[CIAppPipelineEvent]

search_ci_app_pipeline_events(*, body: CIAppPipelineEventsRequest | UnsetType = UnsetType.unset) CIAppPipelineEventsResponse

Search pipelines events.

List endpoint returns CI Visibility pipeline events that match a log search query. Results are paginated similarly to logs.

Use this endpoint to build complex events filtering and search.

Return type:

CIAppPipelineEventsResponse

search_ci_app_pipeline_events_with_pagination(*, body: CIAppPipelineEventsRequest | UnsetType = UnsetType.unset) Iterable[CIAppPipelineEvent]

Search pipelines events.

Provide a paginated version of search_ci_app_pipeline_events(), returning all items.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[CIAppPipelineEvent]

ci_visibility_tests_api

class CIVisibilityTestsApi(api_client=None)

Bases: object

Search or aggregate your CI Visibility test events over HTTP.

aggregate_ci_app_test_events(body: CIAppTestsAggregateRequest) CIAppTestsAnalyticsAggregateResponse

Aggregate tests events.

The API endpoint to aggregate CI Visibility test events into buckets of computed metrics and timeseries.

Return type:

CIAppTestsAnalyticsAggregateResponse

list_ci_app_test_events(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: CIAppSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) CIAppTestEventsResponse

Get a list of tests events.

List endpoint returns CI Visibility test events that match a log search query. Results are paginated similarly to logs.

Use this endpoint to see your latest test events.

Parameters:
  • filter_query (str, optional) – Search query following log syntax.

  • filter_from (datetime, optional) – Minimum timestamp for requested events.

  • filter_to (datetime, optional) – Maximum timestamp for requested events.

  • sort (CIAppSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Return type:

CIAppTestEventsResponse

list_ci_app_test_events_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: CIAppSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[CIAppTestEvent]

Get a list of tests events.

Provide a paginated version of list_ci_app_test_events(), returning all items.

Parameters:
  • filter_query (str, optional) – Search query following log syntax.

  • filter_from (datetime, optional) – Minimum timestamp for requested events.

  • filter_to (datetime, optional) – Maximum timestamp for requested events.

  • sort (CIAppSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[CIAppTestEvent]

search_ci_app_test_events(*, body: CIAppTestEventsRequest | UnsetType = UnsetType.unset) CIAppTestEventsResponse

Search tests events.

List endpoint returns CI Visibility test events that match a log search query. Results are paginated similarly to logs.

Use this endpoint to build complex events filtering and search.

Return type:

CIAppTestEventsResponse

search_ci_app_test_events_with_pagination(*, body: CIAppTestEventsRequest | UnsetType = UnsetType.unset) Iterable[CIAppTestEvent]

Search tests events.

Provide a paginated version of search_ci_app_test_events(), returning all items.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[CIAppTestEvent]

cloud_workload_security_api

class CloudWorkloadSecurityApi(api_client=None)

Bases: object

Workload activity security rules for generating events using the Datadog security Agent.

create_cloud_workload_security_agent_rule(body: CloudWorkloadSecurityAgentRuleCreateRequest) CloudWorkloadSecurityAgentRuleResponse

Create a Cloud Workload Security Agent rule.

Create a new Agent rule with the given parameters.

Parameters:

body (CloudWorkloadSecurityAgentRuleCreateRequest) – The definition of the new Agent rule.

Return type:

CloudWorkloadSecurityAgentRuleResponse

delete_cloud_workload_security_agent_rule(agent_rule_id: str) None

Delete a Cloud Workload Security Agent rule.

Delete a specific Agent rule.

Parameters:

agent_rule_id (str) – The ID of the Agent rule.

Return type:

None

download_cloud_workload_policy_file() IOBase

Get the latest Cloud Workload Security policy.

The download endpoint generates a Cloud Workload Security policy file from your currently active Cloud Workload Security rules, and downloads them as a .policy file. This file can then be deployed to your Agents to update the policy running in your environment.

Return type:

file_type

get_cloud_workload_security_agent_rule(agent_rule_id: str) CloudWorkloadSecurityAgentRuleResponse

Get a Cloud Workload Security Agent rule.

Get the details of a specific Agent rule.

Parameters:

agent_rule_id (str) – The ID of the Agent rule.

Return type:

CloudWorkloadSecurityAgentRuleResponse

list_cloud_workload_security_agent_rules() CloudWorkloadSecurityAgentRulesListResponse

Get all Cloud Workload Security Agent rules.

Get the list of Agent rules.

Return type:

CloudWorkloadSecurityAgentRulesListResponse

update_cloud_workload_security_agent_rule(agent_rule_id: str, body: CloudWorkloadSecurityAgentRuleUpdateRequest) CloudWorkloadSecurityAgentRuleResponse

Update a Cloud Workload Security Agent rule.

Update a specific Agent rule. Returns the Agent rule object when the request is successful.

Parameters:
Return type:

CloudWorkloadSecurityAgentRuleResponse

cloudflare_integration_api

class CloudflareIntegrationApi(api_client=None)

Bases: object

Configure your Datadog Cloudflare integration directly through the Datadog API.

create_cloudflare_account(body: CloudflareAccountCreateRequest) CloudflareAccountResponse

Add Cloudflare account.

Create a Cloudflare account.

Return type:

CloudflareAccountResponse

delete_cloudflare_account(account_id: str) None

Delete Cloudflare account.

Delete a Cloudflare account.

Parameters:

account_id (str) – None

Return type:

None

get_cloudflare_account(account_id: str) CloudflareAccountResponse

Get Cloudflare account.

Get a Cloudflare account.

Parameters:

account_id (str) – None

Return type:

CloudflareAccountResponse

list_cloudflare_accounts() CloudflareAccountsResponse

List Cloudflare accounts.

List Cloudflare accounts.

Return type:

CloudflareAccountsResponse

update_cloudflare_account(account_id: str, body: CloudflareAccountUpdateRequest) CloudflareAccountResponse

Update Cloudflare account.

Update a Cloudflare account.

Parameters:

account_id (str) – None

Return type:

CloudflareAccountResponse

confluent_cloud_api

class ConfluentCloudApi(api_client=None)

Bases: object

Configure your Datadog Confluent Cloud integration directly through the Datadog API.

create_confluent_account(body: ConfluentAccountCreateRequest) ConfluentAccountResponse

Add Confluent account.

Create a Confluent account.

Parameters:

body (ConfluentAccountCreateRequest) – Confluent payload

Return type:

ConfluentAccountResponse

create_confluent_resource(account_id: str, body: ConfluentResourceRequest) ConfluentResourceResponse

Add resource to Confluent account.

Create a Confluent resource for the account associated with the provided ID.

Parameters:
Return type:

ConfluentResourceResponse

delete_confluent_account(account_id: str) None

Delete Confluent account.

Delete a Confluent account with the provided account ID.

Parameters:

account_id (str) – Confluent Account id.

Return type:

None

delete_confluent_resource(account_id: str, resource_id: str) None

Delete resource from Confluent account.

Delete a Confluent resource with the provided resource id for the account associated with the provided account ID.

Parameters:
  • account_id (str) – Confluent Account id.

  • resource_id (str) – Confluent Account Resource ID.

Return type:

None

get_confluent_account(account_id: str) ConfluentAccountResponse

Get Confluent account.

Get the Confluent account with the provided account ID.

Parameters:

account_id (str) – Confluent Account id.

Return type:

ConfluentAccountResponse

get_confluent_resource(account_id: str, resource_id: str) ConfluentResourceResponse

Get resource from Confluent account.

Get a Confluent resource with the provided resource id for the account associated with the provided account ID.

Parameters:
  • account_id (str) – Confluent Account id.

  • resource_id (str) – Confluent Account Resource ID.

Return type:

ConfluentResourceResponse

list_confluent_account() ConfluentAccountsResponse

List Confluent accounts.

List Confluent accounts.

Return type:

ConfluentAccountsResponse

list_confluent_resource(account_id: str) ConfluentResourcesResponse

List Confluent Account resources.

Get a Confluent resource for the account associated with the provided ID.

Parameters:

account_id (str) – Confluent Account id.

Return type:

ConfluentResourcesResponse

update_confluent_account(account_id: str, body: ConfluentAccountUpdateRequest) ConfluentAccountResponse

Update Confluent account.

Update the Confluent account with the provided account ID.

Parameters:
Return type:

ConfluentAccountResponse

update_confluent_resource(account_id: str, resource_id: str, body: ConfluentResourceRequest) ConfluentResourceResponse

Update resource in Confluent account.

Update a Confluent resource with the provided resource id for the account associated with the provided account ID.

Parameters:
  • account_id (str) – Confluent Account id.

  • resource_id (str) – Confluent Account Resource ID.

  • body (ConfluentResourceRequest) – Confluent payload

Return type:

ConfluentResourceResponse

dashboard_lists_api

class DashboardListsApi(api_client=None)

Bases: object

Interact with your dashboard lists through the API to organize, find, and share all of your dashboards with your team and organization.

create_dashboard_list_items(dashboard_list_id: int, body: DashboardListAddItemsRequest) DashboardListAddItemsResponse

Add Items to a Dashboard List.

Add dashboards to an existing dashboard list.

Parameters:
  • dashboard_list_id (int) – ID of the dashboard list to add items to.

  • body (DashboardListAddItemsRequest) – Dashboards to add to the dashboard list.

Return type:

DashboardListAddItemsResponse

delete_dashboard_list_items(dashboard_list_id: int, body: DashboardListDeleteItemsRequest) DashboardListDeleteItemsResponse

Delete items from a dashboard list.

Delete dashboards from an existing dashboard list.

Parameters:
  • dashboard_list_id (int) – ID of the dashboard list to delete items from.

  • body (DashboardListDeleteItemsRequest) – Dashboards to delete from the dashboard list.

Return type:

DashboardListDeleteItemsResponse

get_dashboard_list_items(dashboard_list_id: int) DashboardListItems

Get items of a Dashboard List.

Fetch the dashboard list’s dashboard definitions.

Parameters:

dashboard_list_id (int) – ID of the dashboard list to get items from.

Return type:

DashboardListItems

update_dashboard_list_items(dashboard_list_id: int, body: DashboardListUpdateItemsRequest) DashboardListUpdateItemsResponse

Update items of a dashboard list.

Update dashboards of an existing dashboard list.

Parameters:
  • dashboard_list_id (int) – ID of the dashboard list to update items from.

  • body (DashboardListUpdateItemsRequest) – New dashboards of the dashboard list.

Return type:

DashboardListUpdateItemsResponse

events_api

class EventsApi(api_client=None)

Bases: object

The events service allows you to programmatically post events to the event stream and fetch events from the event stream. Events are limited to 4000 characters. If an event is sent out with a message containing more than 4000 characters, only the first 4000 characters are displayed.

list_events(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: str | UnsetType = UnsetType.unset, filter_to: str | UnsetType = UnsetType.unset, sort: EventsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) EventsListResponse

Get a list of events.

List endpoint returns events that match an events search query. Results are paginated similarly to logs.

Use this endpoint to see your latest events.

Parameters:
  • filter_query (str, optional) – Search query following events syntax.

  • filter_from (str, optional) – Minimum timestamp for requested events.

  • filter_to (str, optional) – Maximum timestamp for requested events.

  • sort (EventsSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Return type:

EventsListResponse

list_events_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: str | UnsetType = UnsetType.unset, filter_to: str | UnsetType = UnsetType.unset, sort: EventsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[EventResponse]

Get a list of events.

Provide a paginated version of list_events(), returning all items.

Parameters:
  • filter_query (str, optional) – Search query following events syntax.

  • filter_from (str, optional) – Minimum timestamp for requested events.

  • filter_to (str, optional) – Maximum timestamp for requested events.

  • sort (EventsSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[EventResponse]

search_events(*, body: EventsListRequest | UnsetType = UnsetType.unset) EventsListResponse

Search events.

List endpoint returns events that match an events search query. Results are paginated similarly to logs.

Use this endpoint to build complex events filtering and search.

Return type:

EventsListResponse

search_events_with_pagination(*, body: EventsListRequest | UnsetType = UnsetType.unset) Iterable[EventResponse]

Search events.

Provide a paginated version of search_events(), returning all items.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[EventResponse]

fastly_integration_api

class FastlyIntegrationApi(api_client=None)

Bases: object

Configure your Datadog Fastly integration directly through the Datadog API.

create_fastly_account(body: FastlyAccountCreateRequest) FastlyAccountResponse

Add Fastly account.

Create a Fastly account.

Return type:

FastlyAccountResponse

create_fastly_service(account_id: str, body: FastlyServiceRequest) FastlyServiceResponse

Add Fastly service.

Create a Fastly service for an account.

Parameters:

account_id (str) – Fastly Account id.

Return type:

FastlyServiceResponse

delete_fastly_account(account_id: str) None

Delete Fastly account.

Delete a Fastly account.

Parameters:

account_id (str) – Fastly Account id.

Return type:

None

delete_fastly_service(account_id: str, service_id: str) None

Delete Fastly service.

Delete a Fastly service for an account.

Parameters:
  • account_id (str) – Fastly Account id.

  • service_id (str) – Fastly Service ID.

Return type:

None

get_fastly_account(account_id: str) FastlyAccountResponse

Get Fastly account.

Get a Fastly account.

Parameters:

account_id (str) – Fastly Account id.

Return type:

FastlyAccountResponse

get_fastly_service(account_id: str, service_id: str) FastlyServiceResponse

Get Fastly service.

Get a Fastly service for an account.

Parameters:
  • account_id (str) – Fastly Account id.

  • service_id (str) – Fastly Service ID.

Return type:

FastlyServiceResponse

list_fastly_accounts() FastlyAccountsResponse

List Fastly accounts.

List Fastly accounts.

Return type:

FastlyAccountsResponse

list_fastly_services(account_id: str) FastlyServicesResponse

List Fastly services.

List Fastly services for an account.

Parameters:

account_id (str) – Fastly Account id.

Return type:

FastlyServicesResponse

update_fastly_account(account_id: str, body: FastlyAccountUpdateRequest) FastlyAccountResponse

Update Fastly account.

Update a Fastly account.

Parameters:

account_id (str) – Fastly Account id.

Return type:

FastlyAccountResponse

update_fastly_service(account_id: str, service_id: str, body: FastlyServiceRequest) FastlyServiceResponse

Update Fastly service.

Update a Fastly service for an account.

Parameters:
  • account_id (str) – Fastly Account id.

  • service_id (str) – Fastly Service ID.

Return type:

FastlyServiceResponse

incident_services_api

class IncidentServicesApi(api_client=None)

Bases: object

Create, update, delete, and retrieve services which can be associated with incidents.

create_incident_service(body: IncidentServiceCreateRequest) IncidentServiceResponse

Create a new incident service.

Creates a new incident service.

Parameters:

body (IncidentServiceCreateRequest) – Incident Service Payload.

Return type:

IncidentServiceResponse

delete_incident_service(service_id: str) None

Delete an existing incident service.

Deletes an existing incident service.

Parameters:

service_id (str) – The ID of the incident service.

Return type:

None

get_incident_service(service_id: str, *, include: IncidentRelatedObject | UnsetType = UnsetType.unset) IncidentServiceResponse

Get details of an incident service.

Get details of an incident service. If the include[users] query parameter is provided, the included attribute will contain the users related to these incident services.

Parameters:
  • service_id (str) – The ID of the incident service.

  • include (IncidentRelatedObject, optional) – Specifies which types of related objects should be included in the response.

Return type:

IncidentServiceResponse

list_incident_services(*, include: IncidentRelatedObject | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset) IncidentServicesResponse

Get a list of all incident services.

Get all incident services uploaded for the requesting user’s organization. If the include[users] query parameter is provided, the included attribute will contain the users related to these incident services.

Parameters:
  • include (IncidentRelatedObject, optional) – Specifies which types of related objects should be included in the response.

  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_offset (int, optional) – Specific offset to use as the beginning of the returned page.

  • filter (str, optional) – A search query that filters services by name.

Return type:

IncidentServicesResponse

update_incident_service(service_id: str, body: IncidentServiceUpdateRequest) IncidentServiceResponse

Update an existing incident service.

Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update.

Parameters:
Return type:

IncidentServiceResponse

incident_teams_api

class IncidentTeamsApi(api_client=None)

Bases: object

Create, update, delete and retrieve teams which can be associated with incidents.

create_incident_team(body: IncidentTeamCreateRequest) IncidentTeamResponse

Create a new incident team.

Creates a new incident team.

Parameters:

body (IncidentTeamCreateRequest) – Incident Team Payload.

Return type:

IncidentTeamResponse

delete_incident_team(team_id: str) None

Delete an existing incident team.

Deletes an existing incident team.

Parameters:

team_id (str) – The ID of the incident team.

Return type:

None

get_incident_team(team_id: str, *, include: IncidentRelatedObject | UnsetType = UnsetType.unset) IncidentTeamResponse

Get details of an incident team.

Get details of an incident team. If the include[users] query parameter is provided, the included attribute will contain the users related to these incident teams.

Parameters:
  • team_id (str) – The ID of the incident team.

  • include (IncidentRelatedObject, optional) – Specifies which types of related objects should be included in the response.

Return type:

IncidentTeamResponse

list_incident_teams(*, include: IncidentRelatedObject | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset) IncidentTeamsResponse

Get a list of all incident teams.

Get all incident teams for the requesting user’s organization. If the include[users] query parameter is provided, the included attribute will contain the users related to these incident teams.

Parameters:
  • include (IncidentRelatedObject, optional) – Specifies which types of related objects should be included in the response.

  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_offset (int, optional) – Specific offset to use as the beginning of the returned page.

  • filter (str, optional) – A search query that filters teams by name.

Return type:

IncidentTeamsResponse

update_incident_team(team_id: str, body: IncidentTeamUpdateRequest) IncidentTeamResponse

Update an existing incident team.

Updates an existing incident team. Only provide the attributes which should be updated as this request is a partial update.

Parameters:
Return type:

IncidentTeamResponse

incidents_api

class IncidentsApi(api_client=None)

Bases: object

Manage incident response.

create_incident(body: IncidentCreateRequest) IncidentResponse

Create an incident.

Create an incident.

Parameters:

body (IncidentCreateRequest) – Incident payload.

Return type:

IncidentResponse

delete_incident(incident_id: str) None

Delete an existing incident.

Deletes an existing incident from the users organization.

Parameters:

incident_id (str) – The UUID of the incident.

Return type:

None

get_incident(incident_id: str, *, include: List[IncidentRelatedObject] | UnsetType = UnsetType.unset) IncidentResponse

Get the details of an incident.

Get the details of an incident by incident_id.

Parameters:
  • incident_id (str) – The UUID of the incident.

  • include ([IncidentRelatedObject], optional) – Specifies which types of related objects should be included in the response.

Return type:

IncidentResponse

list_incident_attachments(incident_id: str, *, include: List[IncidentAttachmentRelatedObject] | UnsetType = UnsetType.unset, filter_attachment_type: List[IncidentAttachmentAttachmentType] | UnsetType = UnsetType.unset) IncidentAttachmentsResponse

Get a list of attachments.

Get all attachments for a given incident.

Parameters:
  • incident_id (str) – The UUID of the incident.

  • include ([IncidentAttachmentRelatedObject], optional) – Specifies which types of related objects are included in the response.

  • filter_attachment_type ([IncidentAttachmentAttachmentType], optional) – Specifies which types of attachments are included in the response.

Return type:

IncidentAttachmentsResponse

list_incidents(*, include: List[IncidentRelatedObject] | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset) IncidentsResponse

Get a list of incidents.

Get all incidents for the user’s organization.

Parameters:
  • include ([IncidentRelatedObject], optional) – Specifies which types of related objects should be included in the response.

  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_offset (int, optional) – Specific offset to use as the beginning of the returned page.

Return type:

IncidentsResponse

list_incidents_with_pagination(*, include: List[IncidentRelatedObject] | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset) Iterable[IncidentResponseData]

Get a list of incidents.

Provide a paginated version of list_incidents(), returning all items.

Parameters:
  • include ([IncidentRelatedObject], optional) – Specifies which types of related objects should be included in the response.

  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_offset (int, optional) – Specific offset to use as the beginning of the returned page.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[IncidentResponseData]

search_incidents(query: str, *, include: IncidentRelatedObject | UnsetType = UnsetType.unset, sort: IncidentSearchSortOrder | UnsetType = UnsetType.unset) IncidentSearchResponse

Search for incidents.

Search for incidents matching a certain query.

Parameters:
  • query (str) –

    Specifies which incidents should be returned. After entering a search query in your Incidents page , use the query parameter value in the URL of the page as the value for this parameter.

    The query can contain any number of incident facets joined by ANDs , along with multiple values for each of those facets joined by OR s, for instance: query="state:active AND severity:(SEV-2 OR SEV-1)".

  • include (IncidentRelatedObject, optional) – Specifies which types of related objects should be included in the response.

  • sort (IncidentSearchSortOrder, optional) – Specifies the order of returned incidents.

Return type:

IncidentSearchResponse

update_incident(incident_id: str, body: IncidentUpdateRequest, *, include: List[IncidentRelatedObject] | UnsetType = UnsetType.unset) IncidentResponse

Update an existing incident.

Updates an incident. Provide only the attributes that should be updated as this request is a partial update.

Parameters:
  • incident_id (str) – The UUID of the incident.

  • body (IncidentUpdateRequest) – Incident Payload.

  • include ([IncidentRelatedObject], optional) – Specifies which types of related objects should be included in the response.

Return type:

IncidentResponse

update_incident_attachments(incident_id: str, body: IncidentAttachmentUpdateRequest, *, include: List[IncidentAttachmentRelatedObject] | UnsetType = UnsetType.unset) IncidentAttachmentUpdateResponse

Create, update, and delete incident attachments.

The bulk update endpoint for creating, updating, and deleting attachments for a given incident.

Parameters:
Return type:

IncidentAttachmentUpdateResponse

key_management_api

class KeyManagementApi(api_client=None)

Bases: object

Manage your Datadog API and application keys. You need an API key and an application key for a user with the required permissions to interact with these endpoints. The full list of API and application keys can be seen on your Datadog API page.

create_api_key(body: APIKeyCreateRequest) APIKeyResponse

Create an API key.

Create an API key.

Return type:

APIKeyResponse

create_current_user_application_key(body: ApplicationKeyCreateRequest) ApplicationKeyResponse

Create an application key for current user.

Create an application key for current user

Return type:

ApplicationKeyResponse

delete_api_key(api_key_id: str) None

Delete an API key.

Delete an API key.

Parameters:

api_key_id (str) – The ID of the API key.

Return type:

None

delete_application_key(app_key_id: str) None

Delete an application key.

Delete an application key

Parameters:

app_key_id (str) – The ID of the application key.

Return type:

None

delete_current_user_application_key(app_key_id: str) None

Delete an application key owned by current user.

Delete an application key owned by current user

Parameters:

app_key_id (str) – The ID of the application key.

Return type:

None

get_api_key(api_key_id: str, *, include: str | UnsetType = UnsetType.unset) APIKeyResponse

Get API key.

Get an API key.

Parameters:
  • api_key_id (str) – The ID of the API key.

  • include (str, optional) – Comma separated list of resource paths for related resources to include in the response. Supported resource paths are created_by and modified_by.

Return type:

APIKeyResponse

get_application_key(app_key_id: str, *, include: str | UnsetType = UnsetType.unset) ApplicationKeyResponse

Get an application key.

Get an application key for your org.

Parameters:
  • app_key_id (str) – The ID of the application key.

  • include (str, optional) – Resource path for related resources to include in the response. Only owned_by is supported.

Return type:

ApplicationKeyResponse

get_current_user_application_key(app_key_id: str) ApplicationKeyResponse

Get one application key owned by current user.

Get an application key owned by current user

Parameters:

app_key_id (str) – The ID of the application key.

Return type:

ApplicationKeyResponse

list_api_keys(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: APIKeysSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset, filter_created_at_start: str | UnsetType = UnsetType.unset, filter_created_at_end: str | UnsetType = UnsetType.unset, filter_modified_at_start: str | UnsetType = UnsetType.unset, filter_modified_at_end: str | UnsetType = UnsetType.unset, include: str | UnsetType = UnsetType.unset) APIKeysResponse

Get all API keys.

List all API keys available for your account.

Parameters:
  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_number (int, optional) – Specific page number to return.

  • sort (APIKeysSort, optional) – API key attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign.

  • filter (str, optional) – Filter API keys by the specified string.

  • filter_created_at_start (str, optional) – Only include API keys created on or after the specified date.

  • filter_created_at_end (str, optional) – Only include API keys created on or before the specified date.

  • filter_modified_at_start (str, optional) – Only include API keys modified on or after the specified date.

  • filter_modified_at_end (str, optional) – Only include API keys modified on or before the specified date.

  • include (str, optional) – Comma separated list of resource paths for related resources to include in the response. Supported resource paths are created_by and modified_by.

Return type:

APIKeysResponse

list_application_keys(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: ApplicationKeysSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset, filter_created_at_start: str | UnsetType = UnsetType.unset, filter_created_at_end: str | UnsetType = UnsetType.unset) ListApplicationKeysResponse

Get all application keys.

List all application keys available for your org

Parameters:
  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_number (int, optional) – Specific page number to return.

  • sort (ApplicationKeysSort, optional) – Application key attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign.

  • filter (str, optional) – Filter application keys by the specified string.

  • filter_created_at_start (str, optional) – Only include application keys created on or after the specified date.

  • filter_created_at_end (str, optional) – Only include application keys created on or before the specified date.

Return type:

ListApplicationKeysResponse

list_current_user_application_keys(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: ApplicationKeysSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset, filter_created_at_start: str | UnsetType = UnsetType.unset, filter_created_at_end: str | UnsetType = UnsetType.unset) ListApplicationKeysResponse

Get all application keys owned by current user.

List all application keys available for current user

Parameters:
  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_number (int, optional) – Specific page number to return.

  • sort (ApplicationKeysSort, optional) – Application key attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign.

  • filter (str, optional) – Filter application keys by the specified string.

  • filter_created_at_start (str, optional) – Only include application keys created on or after the specified date.

  • filter_created_at_end (str, optional) – Only include application keys created on or before the specified date.

Return type:

ListApplicationKeysResponse

update_api_key(api_key_id: str, body: APIKeyUpdateRequest) APIKeyResponse

Edit an API key.

Update an API key.

Parameters:

api_key_id (str) – The ID of the API key.

Return type:

APIKeyResponse

update_application_key(app_key_id: str, body: ApplicationKeyUpdateRequest) ApplicationKeyResponse

Edit an application key.

Edit an application key

Parameters:

app_key_id (str) – The ID of the application key.

Return type:

ApplicationKeyResponse

update_current_user_application_key(app_key_id: str, body: ApplicationKeyUpdateRequest) ApplicationKeyResponse

Edit an application key owned by current user.

Edit an application key owned by current user

Parameters:

app_key_id (str) – The ID of the application key.

Return type:

ApplicationKeyResponse

logs_api

class LogsApi(api_client=None)

Bases: object

Search your logs and send them to your Datadog platform over HTTP.

aggregate_logs(body: LogsAggregateRequest) LogsAggregateResponse

Aggregate events.

The API endpoint to aggregate events into buckets and compute metrics and timeseries.

Return type:

LogsAggregateResponse

list_logs(*, body: LogsListRequest | UnsetType = UnsetType.unset) LogsListResponse

Search logs.

List endpoint returns logs that match a log search query. Results are paginated.

Use this endpoint to build complex logs filtering and search.

If you are considering archiving logs for your organization, consider use of the Datadog archive capabilities instead of the log list API. See Datadog Logs Archive documentation.

Return type:

LogsListResponse

list_logs_get(*, filter_query: str | UnsetType = UnsetType.unset, filter_index: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, filter_storage_tier: LogsStorageTier | UnsetType = UnsetType.unset, sort: LogsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) LogsListResponse

Get a list of logs.

List endpoint returns logs that match a log search query. Results are paginated.

Use this endpoint to see your latest logs.

If you are considering archiving logs for your organization, consider use of the Datadog archive capabilities instead of the log list API. See Datadog Logs Archive documentation.

Parameters:
  • filter_query (str, optional) – Search query following logs syntax.

  • filter_index (str, optional) – For customers with multiple indexes, the indexes to search Defaults to ‘*’ which means all indexes

  • filter_from (datetime, optional) – Minimum timestamp for requested logs.

  • filter_to (datetime, optional) – Maximum timestamp for requested logs.

  • filter_storage_tier (LogsStorageTier, optional) – Specifies the storage type to be used

  • sort (LogsSort, optional) – Order of logs in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of logs in the response.

Return type:

LogsListResponse

list_logs_get_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_index: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, filter_storage_tier: LogsStorageTier | UnsetType = UnsetType.unset, sort: LogsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[Log]

Get a list of logs.

Provide a paginated version of list_logs_get(), returning all items.

Parameters:
  • filter_query (str, optional) – Search query following logs syntax.

  • filter_index (str, optional) – For customers with multiple indexes, the indexes to search Defaults to ‘*’ which means all indexes

  • filter_from (datetime, optional) – Minimum timestamp for requested logs.

  • filter_to (datetime, optional) – Maximum timestamp for requested logs.

  • filter_storage_tier (LogsStorageTier, optional) – Specifies the storage type to be used

  • sort (LogsSort, optional) – Order of logs in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of logs in the response.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[Log]

list_logs_with_pagination(*, body: LogsListRequest | UnsetType = UnsetType.unset) Iterable[Log]

Search logs.

Provide a paginated version of list_logs(), returning all items.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[Log]

submit_log(body: HTTPLog, *, content_encoding: ContentEncoding | UnsetType = UnsetType.unset, ddtags: str | UnsetType = UnsetType.unset) dict

Send logs.

Send your logs to your Datadog platform over HTTP. Limits per HTTP request are:

  • Maximum content size per payload (uncompressed): 5MB

  • Maximum size for a single log: 1MB

  • Maximum array size if sending multiple logs in an array: 1000 entries

Any log exceeding 1MB is accepted and truncated by Datadog:

  • For a single log request, the API truncates the log at 1MB and returns a 2xx.

  • For a multi-logs request, the API processes all logs, truncates only logs larger than 1MB, and returns a 2xx.

Datadog recommends sending your logs compressed. Add the Content-Encoding: gzip header to the request when sending compressed logs.

The status codes answered by the HTTP API are:

  • 202: Accepted: the request has been accepted for processing

  • 400: Bad request (likely an issue in the payload formatting)

  • 401: Unauthorized (likely a missing API Key)

  • 403: Permission issue (likely using an invalid API Key)

  • 408: Request Timeout, request should be retried after some time

  • 413: Payload too large (batch is above 5MB uncompressed)

  • 429: Too Many Requests, request should be retried after some time

  • 500: Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time

  • 503: Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time

Parameters:
  • body (HTTPLog) – Log to send (JSON format).

  • content_encoding (ContentEncoding, optional) – HTTP header used to compress the media-type.

  • ddtags (str, optional) – Log tags can be passed as query parameters with text/plain content type.

Return type:

dict

logs_archives_api

class LogsArchivesApi(api_client=None)

Bases: object

Archives forward all the logs ingested to a cloud storage system.

See the Archives Page for a list of the archives currently configured in web UI.

add_read_role_to_archive(archive_id: str, body: RelationshipToRole) None

Grant role to an archive.

Adds a read role to an archive. ( Roles API )

Parameters:

archive_id (str) – The ID of the archive.

Return type:

None

create_logs_archive(body: LogsArchiveCreateRequest) LogsArchive

Create an archive.

Create an archive in your organization.

Parameters:

body (LogsArchiveCreateRequest) – The definition of the new archive.

Return type:

LogsArchive

delete_logs_archive(archive_id: str) None

Delete an archive.

Delete a given archive from your organization.

Parameters:

archive_id (str) – The ID of the archive.

Return type:

None

get_logs_archive(archive_id: str) LogsArchive

Get an archive.

Get a specific archive from your organization.

Parameters:

archive_id (str) – The ID of the archive.

Return type:

LogsArchive

get_logs_archive_order() LogsArchiveOrder

Get archive order.

Get the current order of your archives. This endpoint takes no JSON arguments.

Return type:

LogsArchiveOrder

list_archive_read_roles(archive_id: str) RolesResponse

List read roles for an archive.

Returns all read roles a given archive is restricted to.

Parameters:

archive_id (str) – The ID of the archive.

Return type:

RolesResponse

list_logs_archives() LogsArchives

Get all archives.

Get the list of configured logs archives with their definitions.

Return type:

LogsArchives

remove_role_from_archive(archive_id: str, body: RelationshipToRole) None

Revoke role from an archive.

Removes a role from an archive. ( Roles API )

Parameters:

archive_id (str) – The ID of the archive.

Return type:

None

update_logs_archive(archive_id: str, body: LogsArchiveCreateRequest) LogsArchive

Update an archive.

Update a given archive configuration.

Note : Using this method updates your archive configuration by replacing your current configuration with the new one sent to your Datadog organization.

Parameters:
Return type:

LogsArchive

update_logs_archive_order(body: LogsArchiveOrder) LogsArchiveOrder

Update archive order.

Update the order of your archives. Since logs are processed sequentially, reordering an archive may change the structure and content of the data processed by other archives.

Note : Using the PUT method updates your archive’s order by replacing the current order with the new one.

Parameters:

body (LogsArchiveOrder) – An object containing the new ordered list of archive IDs.

Return type:

LogsArchiveOrder

logs_metrics_api

class LogsMetricsApi(api_client=None)

Bases: object

Manage configuration of log-based metrics for your organization.

create_logs_metric(body: LogsMetricCreateRequest) LogsMetricResponse

Create a log-based metric.

Create a metric based on your ingested logs in your organization. Returns the log-based metric object from the request body when the request is successful.

Parameters:

body (LogsMetricCreateRequest) – The definition of the new log-based metric.

Return type:

LogsMetricResponse

delete_logs_metric(metric_id: str) None

Delete a log-based metric.

Delete a specific log-based metric from your organization.

Parameters:

metric_id (str) – The name of the log-based metric.

Return type:

None

get_logs_metric(metric_id: str) LogsMetricResponse

Get a log-based metric.

Get a specific log-based metric from your organization.

Parameters:

metric_id (str) – The name of the log-based metric.

Return type:

LogsMetricResponse

list_logs_metrics() LogsMetricsResponse

Get all log-based metrics.

Get the list of configured log-based metrics with their definitions.

Return type:

LogsMetricsResponse

update_logs_metric(metric_id: str, body: LogsMetricUpdateRequest) LogsMetricResponse

Update a log-based metric.

Update a specific log-based metric from your organization. Returns the log-based metric object from the request body when the request is successful.

Parameters:
  • metric_id (str) – The name of the log-based metric.

  • body (LogsMetricUpdateRequest) – New definition of the log-based metric.

Return type:

LogsMetricResponse

metrics_api

class MetricsApi(api_client=None)

Bases: object

The metrics endpoint allows you to:

  • Post metrics data so it can be graphed on Datadog’s dashboards

  • Query metrics from any time period (timeseries and scalar)

  • Modify tag configurations for metrics

  • View tags and volumes for metrics

Note : A graph can only contain a set number of points and as the timeframe over which a metric is viewed increases, aggregation between points occurs to stay below that set number.

The Post, Patch, and Delete manage_tags API methods can only be performed by a user who has the Manage Tags for Metrics permission.

create_bulk_tags_metrics_configuration(body: MetricBulkTagConfigCreateRequest) MetricBulkTagConfigResponse

Configure tags for multiple metrics.

Create and define a list of queryable tag keys for a set of existing count, gauge, rate, and distribution metrics. Metrics are selected by passing a metric name prefix. Use the Delete method of this API path to remove tag configurations. Results can be sent to a set of account email addresses, just like the same operation in the Datadog web app. If multiple calls include the same metric, the last configuration applied (not by submit order) is used, do not expect deterministic ordering of concurrent calls. Can only be used with application keys of users with the Manage Tags for Metrics permission.

Return type:

MetricBulkTagConfigResponse

create_tag_configuration(metric_name: str, body: MetricTagConfigurationCreateRequest) MetricTagConfigurationResponse

Create a tag configuration.

Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric. Optionally, include percentile aggregations on any distribution metric or configure custom aggregations on any count, rate, or gauge metric. Can only be used with application keys of users with the Manage Tags for Metrics permission.

Parameters:

metric_name (str) – The name of the metric.

Return type:

MetricTagConfigurationResponse

delete_bulk_tags_metrics_configuration(body: MetricBulkTagConfigDeleteRequest) MetricBulkTagConfigResponse

Configure tags for multiple metrics.

Delete all custom lists of queryable tag keys for a set of existing count, gauge, rate, and distribution metrics. Metrics are selected by passing a metric name prefix. Results can be sent to a set of account email addresses, just like the same operation in the Datadog web app. Can only be used with application keys of users with the Manage Tags for Metrics permission.

Return type:

MetricBulkTagConfigResponse

delete_tag_configuration(metric_name: str) None

Delete a tag configuration.

Deletes a metric’s tag configuration. Can only be used with application keys from users with the Manage Tags for Metrics permission.

Parameters:

metric_name (str) – The name of the metric.

Return type:

None

estimate_metrics_output_series(metric_name: str, *, filter_groups: str | UnsetType = UnsetType.unset, filter_hours_ago: int | UnsetType = UnsetType.unset, filter_num_aggregations: int | UnsetType = UnsetType.unset, filter_pct: bool | UnsetType = UnsetType.unset, filter_timespan_h: int | UnsetType = UnsetType.unset) MetricEstimateResponse

Tag Configuration Cardinality Estimator.

Returns the estimated cardinality for a metric with a given tag, percentile and number of aggregations configuration using Metrics without Limits™.

Parameters:
  • metric_name (str) – The name of the metric.

  • filter_groups (str, optional) – Filtered tag keys that the metric is configured to query with.

  • filter_hours_ago (int, optional) – The number of hours of look back (from now) to estimate cardinality with.

  • filter_num_aggregations (int, optional) – The number of aggregations that a count , rate , or gauge metric is configured to use. Max number of aggregation combos is 9.

  • filter_pct (bool, optional) – A boolean, for distribution metrics only, to estimate cardinality if the metric includes additional percentile aggregators.

  • filter_timespan_h (int, optional) – A window, in hours, from the look back to estimate cardinality with.

Return type:

MetricEstimateResponse

list_active_metric_configurations(metric_name: str, *, window_seconds: int | UnsetType = UnsetType.unset) MetricSuggestedTagsAndAggregationsResponse

List active tags and aggregations.

List tags and aggregations that are actively queried on dashboards and monitors for a given metric name.

Parameters:
  • metric_name (str) – The name of the metric.

  • window_seconds (int, optional) – The number of seconds of look back (from now). Default value is 604,800 (1 week), minimum value is 7200 (2 hours), maximum value is 2,630,000 (1 month).

Return type:

MetricSuggestedTagsAndAggregationsResponse

list_tag_configuration_by_name(metric_name: str) MetricTagConfigurationResponse

List tag configuration by name.

Returns the tag configuration for the given metric name.

Parameters:

metric_name (str) – The name of the metric.

Return type:

MetricTagConfigurationResponse

list_tag_configurations(*, filter_configured: bool | UnsetType = UnsetType.unset, filter_tags_configured: str | UnsetType = UnsetType.unset, filter_metric_type: MetricTagConfigurationMetricTypes | UnsetType = UnsetType.unset, filter_include_percentiles: bool | UnsetType = UnsetType.unset, filter_queried: bool | UnsetType = UnsetType.unset, filter_tags: str | UnsetType = UnsetType.unset, window_seconds: int | UnsetType = UnsetType.unset) MetricsAndMetricTagConfigurationsResponse

Get a list of metrics.

Returns all metrics that can be configured in the Metrics Summary page or with Metrics without Limits™ (matching additional filters if specified).

Parameters:
  • filter_configured (bool, optional) – Filter custom metrics that have configured tags.

  • filter_tags_configured (str, optional) – Filter tag configurations by configured tags.

  • filter_metric_type (MetricTagConfigurationMetricTypes, optional) – Filter metrics by metric type.

  • filter_include_percentiles (bool, optional) – Filter distributions with additional percentile aggregations enabled or disabled.

  • filter_queried (bool, optional) – Filter custom metrics that have or have not been queried in the specified window[seconds]. If no window is provided or the window is less than 2 hours, a default of 2 hours will be applied.

  • filter_tags (str, optional) – Filter metrics that have been submitted with the given tags. Supports boolean and wildcard expressions. Can only be combined with the filter[queried] filter.

  • window_seconds (int, optional) – The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query. Defaults value is 3600 (1 hour), maximum value is 1,209,600 (2 weeks).

Return type:

MetricsAndMetricTagConfigurationsResponse

list_tags_by_metric_name(metric_name: str) MetricAllTagsResponse

List tags by metric name.

View indexed tag key-value pairs for a given metric name.

Parameters:

metric_name (str) – The name of the metric.

Return type:

MetricAllTagsResponse

list_volumes_by_metric_name(metric_name: str) MetricVolumesResponse

List distinct metric volumes by metric name.

View distinct metrics volumes for the given metric name.

Custom metrics generated in-app from other products will return null for ingested volumes.

Parameters:

metric_name (str) – The name of the metric.

Return type:

MetricVolumesResponse

query_scalar_data(body: ScalarFormulaQueryRequest) ScalarFormulaQueryResponse

Query scalar data across multiple products.

Query scalar values (as seen on Query Value, Table and Toplist widgets). Multiple data sources are supported with the ability to process the data using formulas and functions.

Return type:

ScalarFormulaQueryResponse

query_timeseries_data(body: TimeseriesFormulaQueryRequest) TimeseriesFormulaQueryResponse

Query timeseries data across multiple products.

Query timeseries data across various data sources and process the data by applying formulas and functions.

Return type:

TimeseriesFormulaQueryResponse

submit_metrics(body: MetricPayload, *, content_encoding: MetricContentEncoding | UnsetType = UnsetType.unset) IntakePayloadAccepted

Submit metrics.

The metrics end-point allows you to post time-series data that can be graphed on Datadog’s dashboards. The maximum payload size is 500 kilobytes (512000 bytes). Compressed payloads must have a decompressed size of less than 5 megabytes (5242880 bytes).

If you’re submitting metrics directly to the Datadog API without using DogStatsD, expect:

  • 64 bits for the timestamp

  • 64 bits for the value

  • 20 bytes for the metric names

  • 50 bytes for the timeseries

  • The full payload is approximately 100 bytes.

Host name is one of the resources in the Resources field.

Parameters:

content_encoding (MetricContentEncoding, optional) – HTTP header used to compress the media-type.

Return type:

IntakePayloadAccepted

update_tag_configuration(metric_name: str, body: MetricTagConfigurationUpdateRequest) MetricTagConfigurationResponse

Update a tag configuration.

Update the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations of a count, rate, or gauge metric. Can only be used with application keys from users with the Manage Tags for Metrics permission.

Parameters:

metric_name (str) – The name of the metric.

Return type:

MetricTagConfigurationResponse

monitors_api

class MonitorsApi(api_client=None)

Bases: object

Monitors allow you to watch a metric or check that you care about and notifies your team when a defined threshold has exceeded.

For more information, see Creating Monitors and Tag Policies.

create_monitor_config_policy(body: MonitorConfigPolicyCreateRequest) MonitorConfigPolicyResponse

Create a monitor configuration policy.

Create a monitor configuration policy.

Parameters:

body (MonitorConfigPolicyCreateRequest) – Create a monitor configuration policy request body.

Return type:

MonitorConfigPolicyResponse

delete_monitor_config_policy(policy_id: str) None

Delete a monitor configuration policy.

Delete a monitor configuration policy.

Parameters:

policy_id (str) – ID of the monitor configuration policy.

Return type:

None

get_monitor_config_policy(policy_id: str) MonitorConfigPolicyResponse

Get a monitor configuration policy.

Get a monitor configuration policy by policy_id.

Parameters:

policy_id (str) – ID of the monitor configuration policy.

Return type:

MonitorConfigPolicyResponse

list_monitor_config_policies() MonitorConfigPolicyListResponse

Get all monitor configuration policies.

Get all monitor configuration policies.

Return type:

MonitorConfigPolicyListResponse

update_monitor_config_policy(policy_id: str, body: MonitorConfigPolicyEditRequest) MonitorConfigPolicyResponse

Edit a monitor configuration policy.

Edit a monitor configuration policy.

Parameters:
Return type:

MonitorConfigPolicyResponse

opsgenie_integration_api

class OpsgenieIntegrationApi(api_client=None)

Bases: object

Configure your Datadog Opsgenie integration directly through the Datadog API.

create_opsgenie_service(body: OpsgenieServiceCreateRequest) OpsgenieServiceResponse

Create a new service object.

Create a new service object in the Opsgenie integration.

Parameters:

body (OpsgenieServiceCreateRequest) – Opsgenie service payload

Return type:

OpsgenieServiceResponse

delete_opsgenie_service(integration_service_id: str) None

Delete a single service object.

Delete a single service object in the Datadog Opsgenie integration.

Parameters:

integration_service_id (str) – The UUID of the service.

Return type:

None

get_opsgenie_service(integration_service_id: str) OpsgenieServiceResponse

Get a single service object.

Get a single service from the Datadog Opsgenie integration.

Parameters:

integration_service_id (str) – The UUID of the service.

Return type:

OpsgenieServiceResponse

list_opsgenie_services() OpsgenieServicesResponse

Get all service objects.

Get a list of all services from the Datadog Opsgenie integration.

Return type:

OpsgenieServicesResponse

update_opsgenie_service(integration_service_id: str, body: OpsgenieServiceUpdateRequest) OpsgenieServiceResponse

Update a single service object.

Update a single service object in the Datadog Opsgenie integration.

Parameters:
Return type:

OpsgenieServiceResponse

organizations_api

class OrganizationsApi(api_client=None)

Bases: object

Create, edit, and manage your organizations. Read more about multi-org accounts.

upload_idp_metadata(*, idp_file: IOBase | UnsetType = UnsetType.unset) None

Upload IdP metadata.

Endpoint for uploading IdP metadata for SAML setup.

Use this endpoint to upload or replace IdP metadata for SAML login configuration.

Parameters:

idp_file (file_type, optional) – The IdP metadata XML file

Return type:

None

processes_api

class ProcessesApi(api_client=None)

Bases: object

The processes API allows you to query processes data for your organization.

list_processes(*, search: str | UnsetType = UnsetType.unset, tags: str | UnsetType = UnsetType.unset, _from: int | UnsetType = UnsetType.unset, to: int | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset) ProcessSummariesResponse

Get all processes.

Get all processes for your organization.

Parameters:
  • search (str, optional) – String to search processes by.

  • tags (str, optional) – Comma-separated list of tags to filter processes by.

  • _from (int, optional) – Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window will be 15 minutes before the to timestamp. If neither from nor to are provided, the query window will be [now - 15m, now].

  • to (int, optional) – Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window will be 15 minutes after the from timestamp. If neither from nor to are provided, the query window will be [now - 15m, now].

  • page_limit (int, optional) – Maximum number of results returned.

  • page_cursor (str, optional) – String to query the next page of results. This key is provided with each valid response from the API in meta.page.after.

Return type:

ProcessSummariesResponse

list_processes_with_pagination(*, search: str | UnsetType = UnsetType.unset, tags: str | UnsetType = UnsetType.unset, _from: int | UnsetType = UnsetType.unset, to: int | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset) Iterable[ProcessSummary]

Get all processes.

Provide a paginated version of list_processes(), returning all items.

Parameters:
  • search (str, optional) – String to search processes by.

  • tags (str, optional) – Comma-separated list of tags to filter processes by.

  • _from (int, optional) – Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window will be 15 minutes before the to timestamp. If neither from nor to are provided, the query window will be [now - 15m, now].

  • to (int, optional) – Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window will be 15 minutes after the from timestamp. If neither from nor to are provided, the query window will be [now - 15m, now].

  • page_limit (int, optional) – Maximum number of results returned.

  • page_cursor (str, optional) – String to query the next page of results. This key is provided with each valid response from the API in meta.page.after.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[ProcessSummary]

roles_api

class RolesApi(api_client=None)

Bases: object

The Roles API is used to create and manage Datadog roles, what global permissions they grant, and which users belong to them.

Permissions related to specific account assets can be granted to roles in the Datadog application without using this API. For example, granting read access on a specific log index to a role can be done in Datadog from the Pipelines page.

add_permission_to_role(role_id: str, body: RelationshipToPermission) PermissionsResponse

Grant permission to a role.

Adds a permission to a role.

Parameters:

role_id (str) – The unique identifier of the role.

Return type:

PermissionsResponse

add_user_to_role(role_id: str, body: RelationshipToUser) UsersResponse

Add a user to a role.

Adds a user to a role.

Parameters:

role_id (str) – The unique identifier of the role.

Return type:

UsersResponse

clone_role(role_id: str, body: RoleCloneRequest) RoleResponse

Create a new role by cloning an existing role.

Clone an existing role

Parameters:

role_id (str) – The unique identifier of the role.

Return type:

RoleResponse

create_role(body: RoleCreateRequest) RoleCreateResponse

Create role.

Create a new role for your organization.

Return type:

RoleCreateResponse

delete_role(role_id: str) None

Delete role.

Disables a role.

Parameters:

role_id (str) – The unique identifier of the role.

Return type:

None

get_role(role_id: str) RoleResponse

Get a role.

Get a role in the organization specified by the role’s role_id.

Parameters:

role_id (str) – The unique identifier of the role.

Return type:

RoleResponse

list_permissions() PermissionsResponse

List permissions.

Returns a list of all permissions, including name, description, and ID.

Return type:

PermissionsResponse

list_role_permissions(role_id: str) PermissionsResponse

List permissions for a role.

Returns a list of all permissions for a single role.

Parameters:

role_id (str) – The unique identifier of the role.

Return type:

PermissionsResponse

list_role_users(role_id: str, *, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: str | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset) UsersResponse

Get all users of a role.

Gets all users of a role.

Parameters:
  • role_id (str) – The unique identifier of the role.

  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_number (int, optional) – Specific page number to return.

  • sort (str, optional) – User attribute to order results by. Sort order is ascending by default. Sort order is descending if the field is prefixed by a negative sign, for example sort=-name. Options: name , email , status.

  • filter (str, optional) – Filter all users by the given string. Defaults to no filtering.

Return type:

UsersResponse

list_roles(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: RolesSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset) RolesResponse

List roles.

Returns all roles, including their names and their unique identifiers.

Parameters:
  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_number (int, optional) – Specific page number to return.

  • sort (RolesSort, optional) – Sort roles depending on the given field. Sort order is ascending by default. Sort order is descending if the field is prefixed by a negative sign, for example: sort=-name.

  • filter (str, optional) – Filter all roles by the given string.

Return type:

RolesResponse

remove_permission_from_role(role_id: str, body: RelationshipToPermission) PermissionsResponse

Revoke permission.

Removes a permission from a role.

Parameters:

role_id (str) – The unique identifier of the role.

Return type:

PermissionsResponse

remove_user_from_role(role_id: str, body: RelationshipToUser) UsersResponse

Remove a user from a role.

Removes a user from a role.

Parameters:

role_id (str) – The unique identifier of the role.

Return type:

UsersResponse

update_role(role_id: str, body: RoleUpdateRequest) RoleUpdateResponse

Update a role.

Edit a role. Can only be used with application keys belonging to administrators.

Parameters:

role_id (str) – The unique identifier of the role.

Return type:

RoleUpdateResponse

rum_api

class RUMApi(api_client=None)

Bases: object

Search or aggregate your RUM events over HTTP.

aggregate_rum_events(body: RUMAggregateRequest) RUMAnalyticsAggregateResponse

Aggregate RUM events.

The API endpoint to aggregate RUM events into buckets of computed metrics and timeseries.

Return type:

RUMAnalyticsAggregateResponse

create_rum_application(body: RUMApplicationCreateRequest) RUMApplicationResponse

Create a new RUM application.

Create a new RUM application in your organization.

Return type:

RUMApplicationResponse

delete_rum_application(id: str) None

Delete a RUM application.

Delete an existing RUM application in your organization.

Parameters:

id (str) – RUM application ID.

Return type:

None

get_rum_application(id: str) RUMApplicationResponse

Get a RUM application.

Get the RUM application with given ID in your organization.

Parameters:

id (str) – RUM application ID.

Return type:

RUMApplicationResponse

get_rum_applications() RUMApplicationsResponse

List all the RUM applications.

List all the RUM applications in your organization.

Return type:

RUMApplicationsResponse

list_rum_events(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: RUMSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) RUMEventsResponse

Get a list of RUM events.

List endpoint returns events that match a RUM search query. Results are paginated.

Use this endpoint to see your latest RUM events.

Parameters:
  • filter_query (str, optional) – Search query following RUM syntax.

  • filter_from (datetime, optional) – Minimum timestamp for requested events.

  • filter_to (datetime, optional) – Maximum timestamp for requested events.

  • sort (RUMSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Return type:

RUMEventsResponse

list_rum_events_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: RUMSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[RUMEvent]

Get a list of RUM events.

Provide a paginated version of list_rum_events(), returning all items.

Parameters:
  • filter_query (str, optional) – Search query following RUM syntax.

  • filter_from (datetime, optional) – Minimum timestamp for requested events.

  • filter_to (datetime, optional) – Maximum timestamp for requested events.

  • sort (RUMSort, optional) – Order of events in results.

  • page_cursor (str, optional) – List following results with a cursor provided in the previous query.

  • page_limit (int, optional) – Maximum number of events in the response.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[RUMEvent]

search_rum_events(body: RUMSearchEventsRequest) RUMEventsResponse

Search RUM events.

List endpoint returns RUM events that match a RUM search query. Results are paginated.

Use this endpoint to build complex RUM events filtering and search.

Return type:

RUMEventsResponse

search_rum_events_with_pagination(body: RUMSearchEventsRequest) Iterable[RUMEvent]

Search RUM events.

Provide a paginated version of search_rum_events(), returning all items.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[RUMEvent]

update_rum_application(id: str, body: RUMApplicationUpdateRequest) RUMApplicationResponse

Update a RUM application.

Update the RUM application with given ID in your organization.

Parameters:

id (str) – RUM application ID.

Return type:

RUMApplicationResponse

security_monitoring_api

class SecurityMonitoringApi(api_client=None)

Bases: object

Detection rules for generating signals and listing of generated signals.

create_security_filter(body: SecurityFilterCreateRequest) SecurityFilterResponse

Create a security filter.

Create a security filter.

See the security filter guide for more examples.

Parameters:

body (SecurityFilterCreateRequest) – The definition of the new security filter.

Return type:

SecurityFilterResponse

create_security_monitoring_rule(body: SecurityMonitoringRuleCreatePayload | SecurityMonitoringStandardRuleCreatePayload | SecurityMonitoringSignalRuleCreatePayload | CloudConfigurationRuleCreatePayload) SecurityMonitoringRuleResponse

Create a detection rule.

Create a detection rule.

Return type:

SecurityMonitoringRuleResponse

delete_security_filter(security_filter_id: str) None

Delete a security filter.

Delete a specific security filter.

Parameters:

security_filter_id (str) – The ID of the security filter.

Return type:

None

delete_security_monitoring_rule(rule_id: str) None

Delete an existing rule.

Delete an existing rule. Default rules cannot be deleted.

Parameters:

rule_id (str) – The ID of the rule.

Return type:

None

edit_security_monitoring_signal_assignee(signal_id: str, body: SecurityMonitoringSignalAssigneeUpdateRequest) SecurityMonitoringSignalTriageUpdateResponse

Modify the triage assignee of a security signal.

Modify the triage assignee of a security signal.

Parameters:
Return type:

SecurityMonitoringSignalTriageUpdateResponse

edit_security_monitoring_signal_incidents(signal_id: str, body: SecurityMonitoringSignalIncidentsUpdateRequest) SecurityMonitoringSignalTriageUpdateResponse

Change the related incidents of a security signal.

Change the related incidents for a security signal.

Parameters:
Return type:

SecurityMonitoringSignalTriageUpdateResponse

edit_security_monitoring_signal_state(signal_id: str, body: SecurityMonitoringSignalStateUpdateRequest) SecurityMonitoringSignalTriageUpdateResponse

Change the triage state of a security signal.

Change the triage state of a security signal.

Parameters:
Return type:

SecurityMonitoringSignalTriageUpdateResponse

get_security_filter(security_filter_id: str) SecurityFilterResponse

Get a security filter.

Get the details of a specific security filter.

See the security filter guide for more examples.

Parameters:

security_filter_id (str) – The ID of the security filter.

Return type:

SecurityFilterResponse

get_security_monitoring_rule(rule_id: str) SecurityMonitoringRuleResponse

Get a rule’s details.

Get a rule’s details.

Parameters:

rule_id (str) – The ID of the rule.

Return type:

SecurityMonitoringRuleResponse

get_security_monitoring_signal(signal_id: str) SecurityMonitoringSignal

Get a signal’s details.

Get a signal’s details.

Parameters:

signal_id (str) – The ID of the signal.

Return type:

SecurityMonitoringSignal

list_security_filters() SecurityFiltersResponse

Get all security filters.

Get the list of configured security filters with their definitions.

Return type:

SecurityFiltersResponse

list_security_monitoring_rules(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset) SecurityMonitoringListRulesResponse

List rules.

List rules.

Parameters:
  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_number (int, optional) – Specific page number to return.

Return type:

SecurityMonitoringListRulesResponse

list_security_monitoring_signals(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: SecurityMonitoringSignalsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) SecurityMonitoringSignalsListResponse

Get a quick list of security signals.

The list endpoint returns security signals that match a search query. Both this endpoint and the POST endpoint can be used interchangeably when listing security signals.

Parameters:
  • filter_query (str, optional) – The search query for security signals.

  • filter_from (datetime, optional) – The minimum timestamp for requested security signals.

  • filter_to (datetime, optional) – The maximum timestamp for requested security signals.

  • sort (SecurityMonitoringSignalsSort, optional) – The order of the security signals in results.

  • page_cursor (str, optional) – A list of results using the cursor provided in the previous query.

  • page_limit (int, optional) – The maximum number of security signals in the response.

Return type:

SecurityMonitoringSignalsListResponse

list_security_monitoring_signals_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: SecurityMonitoringSignalsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[SecurityMonitoringSignal]

Get a quick list of security signals.

Provide a paginated version of list_security_monitoring_signals(), returning all items.

Parameters:
  • filter_query (str, optional) – The search query for security signals.

  • filter_from (datetime, optional) – The minimum timestamp for requested security signals.

  • filter_to (datetime, optional) – The maximum timestamp for requested security signals.

  • sort (SecurityMonitoringSignalsSort, optional) – The order of the security signals in results.

  • page_cursor (str, optional) – A list of results using the cursor provided in the previous query.

  • page_limit (int, optional) – The maximum number of security signals in the response.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[SecurityMonitoringSignal]

search_security_monitoring_signals(*, body: SecurityMonitoringSignalListRequest | UnsetType = UnsetType.unset) SecurityMonitoringSignalsListResponse

Get a list of security signals.

Returns security signals that match a search query. Both this endpoint and the GET endpoint can be used interchangeably for listing security signals.

Return type:

SecurityMonitoringSignalsListResponse

search_security_monitoring_signals_with_pagination(*, body: SecurityMonitoringSignalListRequest | UnsetType = UnsetType.unset) Iterable[SecurityMonitoringSignal]

Get a list of security signals.

Provide a paginated version of search_security_monitoring_signals(), returning all items.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[SecurityMonitoringSignal]

update_security_filter(security_filter_id: str, body: SecurityFilterUpdateRequest) SecurityFilterResponse

Update a security filter.

Update a specific security filter. Returns the security filter object when the request is successful.

Parameters:
  • security_filter_id (str) – The ID of the security filter.

  • body (SecurityFilterUpdateRequest) – New definition of the security filter.

Return type:

SecurityFilterResponse

update_security_monitoring_rule(rule_id: str, body: SecurityMonitoringRuleUpdatePayload) SecurityMonitoringRuleResponse

Update an existing rule.

Update an existing rule. When updating cases , queries or options , the whole field must be included. For example, when modifying a query all queries must be included. Default rules can only be updated to be enabled and to change notifications.

Parameters:

rule_id (str) – The ID of the rule.

Return type:

SecurityMonitoringRuleResponse

sensitive_data_scanner_api

class SensitiveDataScannerApi(api_client=None)

Bases: object

Create, update, delete, and retrieve sensitive data scanner groups and rules.

create_scanning_group(body: SensitiveDataScannerGroupCreateRequest) SensitiveDataScannerCreateGroupResponse

Create Scanning Group.

Create a scanning group. The request MAY include a configuration relationship. A rules relationship can be omitted entirely, but if it is included it MUST be null or an empty array (rules cannot be created at the same time). The new group will be ordered last within the configuration.

Return type:

SensitiveDataScannerCreateGroupResponse

create_scanning_rule(body: SensitiveDataScannerRuleCreateRequest) SensitiveDataScannerCreateRuleResponse

Create Scanning Rule.

Create a scanning rule in a sensitive data scanner group, ordered last. The posted rule MUST include a group relationship. It MUST include either a standard_pattern relationship or a regex attribute, but not both. If included_attributes is empty or missing, we will scan all attributes except excluded_attributes. If both are missing, we will scan the whole event.

Return type:

SensitiveDataScannerCreateRuleResponse

delete_scanning_group(group_id: str, body: SensitiveDataScannerGroupDeleteRequest) SensitiveDataScannerGroupDeleteResponse

Delete Scanning Group.

Delete a given group.

Parameters:

group_id (str) – The ID of a group of rules.

Return type:

SensitiveDataScannerGroupDeleteResponse

delete_scanning_rule(rule_id: str, body: SensitiveDataScannerRuleDeleteRequest) SensitiveDataScannerRuleDeleteResponse

Delete Scanning Rule.

Delete a given rule.

Parameters:

rule_id (str) – The ID of the rule.

Return type:

SensitiveDataScannerRuleDeleteResponse

list_scanning_groups() SensitiveDataScannerGetConfigResponse

List Scanning Groups.

List all the Scanning groups in your organization.

Return type:

SensitiveDataScannerGetConfigResponse

list_standard_patterns() SensitiveDataScannerStandardPatternsResponseData

List standard patterns.

Returns all standard patterns.

Return type:

SensitiveDataScannerStandardPatternsResponseData

reorder_scanning_groups(body: SensitiveDataScannerConfigRequest) SensitiveDataScannerReorderGroupsResponse

Reorder Groups.

Reorder the list of groups.

Return type:

SensitiveDataScannerReorderGroupsResponse

update_scanning_group(group_id: str, body: SensitiveDataScannerGroupUpdateRequest) SensitiveDataScannerGroupUpdateResponse

Update Scanning Group.

Update a group, including the order of the rules. Rules within the group are reordered by including a rules relationship. If the rules relationship is present, its data section MUST contain linkages for all of the rules currently in the group, and MUST NOT contain any others.

Parameters:

group_id (str) – The ID of a group of rules.

Return type:

SensitiveDataScannerGroupUpdateResponse

update_scanning_rule(rule_id: str, body: SensitiveDataScannerRuleUpdateRequest) SensitiveDataScannerRuleUpdateResponse

Update Scanning Rule.

Update a scanning rule. The request body MUST NOT include a standard_pattern relationship, as that relationship is non-editable. Trying to edit the regex attribute of a rule with a standard_pattern relationship will also result in an error.

Parameters:

rule_id (str) – The ID of the rule.

Return type:

SensitiveDataScannerRuleUpdateResponse

service_accounts_api

class ServiceAccountsApi(api_client=None)

Bases: object

Create, edit, and disable service accounts.

create_service_account_application_key(service_account_id: str, body: ApplicationKeyCreateRequest) ApplicationKeyResponse

Create an application key for this service account.

Create an application key for this service account.

Parameters:

service_account_id (str) – The ID of the service account.

Return type:

ApplicationKeyResponse

delete_service_account_application_key(service_account_id: str, app_key_id: str) None

Delete an application key for this service account.

Delete an application key owned by this service account.

Parameters:
  • service_account_id (str) – The ID of the service account.

  • app_key_id (str) – The ID of the application key.

Return type:

None

get_service_account_application_key(service_account_id: str, app_key_id: str) PartialApplicationKeyResponse

Get one application key for this service account.

Get an application key owned by this service account.

Parameters:
  • service_account_id (str) – The ID of the service account.

  • app_key_id (str) – The ID of the application key.

Return type:

PartialApplicationKeyResponse

list_service_account_application_keys(service_account_id: str, *, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: ApplicationKeysSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset, filter_created_at_start: str | UnsetType = UnsetType.unset, filter_created_at_end: str | UnsetType = UnsetType.unset) ListApplicationKeysResponse

List application keys for this service account.

List all application keys available for this service account.

Parameters:
  • service_account_id (str) – The ID of the service account.

  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_number (int, optional) – Specific page number to return.

  • sort (ApplicationKeysSort, optional) – Application key attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign.

  • filter (str, optional) – Filter application keys by the specified string.

  • filter_created_at_start (str, optional) – Only include application keys created on or after the specified date.

  • filter_created_at_end (str, optional) – Only include application keys created on or before the specified date.

Return type:

ListApplicationKeysResponse

update_service_account_application_key(service_account_id: str, app_key_id: str, body: ApplicationKeyUpdateRequest) PartialApplicationKeyResponse

Edit an application key for this service account.

Edit an application key owned by this service account.

Parameters:
  • service_account_id (str) – The ID of the service account.

  • app_key_id (str) – The ID of the application key.

Return type:

PartialApplicationKeyResponse

service_definition_api

class ServiceDefinitionApi(api_client=None)

Bases: object

API to create, update, retrieve and delete service definitions.

create_or_update_service_definitions(body: ServiceDefinitionsCreateRequest | ServiceDefinitionV2 | str) ServiceDefinitionCreateResponse

Create or update service definition.

Create or update service definition in the Datadog Service Catalog.

Parameters:

body (ServiceDefinitionsCreateRequest) – Service Definition YAML/JSON.

Return type:

ServiceDefinitionCreateResponse

delete_service_definition(service_name: str) None

Delete a single service definition.

Delete a single service definition in the Datadog Service Catalog.

Parameters:

service_name (str) – The name of the service.

Return type:

None

get_service_definition(service_name: str) ServiceDefinitionGetResponse

Get a single service definition.

Get a single service definition from the Datadog Service Catalog.

Parameters:

service_name (str) – The name of the service.

Return type:

ServiceDefinitionGetResponse

list_service_definitions() ServiceDefinitionsListResponse

Get all service definitions.

Get a list of all service definitions from the Datadog Service Catalog.

Return type:

ServiceDefinitionsListResponse

usage_metering_api

class UsageMeteringApi(api_client=None)

Bases: object

The usage metering API allows you to get hourly, daily, and monthly usage across multiple facets of Datadog. This API is available to all Pro and Enterprise customers. Usage is only accessible for parent-level organizations.

Note : Usage data is delayed by up to 72 hours from when it was incurred. It is retained for 15 months.

You can retrieve up to 24 hours of hourly usage data for multiple organizations, and up to two months of hourly usage data for a single organization in one request.

get_cost_by_org(start_month: datetime, *, end_month: datetime | UnsetType = UnsetType.unset) CostByOrgResponse

Get cost across multi-org account. Deprecated.

Get cost across multi-org account. Cost by org data for a given month becomes available no later than the 16th of the following month. Note: This endpoint has been deprecated. Please use the new endpoint ` /historical_cost <https://docs.datadoghq.com/api/latest/usage-metering/#get-historical-cost-across-your-account>`_ instead.

Parameters:
  • start_month (datetime) – Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost beginning this month.

  • end_month (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost ending this month.

Return type:

CostByOrgResponse

get_estimated_cost_by_org(*, view: str | UnsetType = UnsetType.unset, start_month: datetime | UnsetType = UnsetType.unset, end_month: datetime | UnsetType = UnsetType.unset, start_date: datetime | UnsetType = UnsetType.unset, end_date: datetime | UnsetType = UnsetType.unset) CostByOrgResponse

Get estimated cost across your account.

Get estimated cost across multi-org and single root-org accounts. Estimated cost data is only available for the current month and previous month and is delayed by up to 72 hours from when it was incurred. To access historical costs prior to this, use the /historical_cost endpoint.

Parameters:
  • view (str, optional) – String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are summary and sub-org. Defaults to summary.

  • start_month (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost beginning this month. Either start_month or start_date should be specified, but not both. (start_month cannot go beyond two months in the past)

  • end_month (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost ending this month.

  • start_date (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to day: [YYYY-MM-DD] for cost beginning this day. Either start_month or start_date should be specified, but not both. (start_date cannot go beyond two months in the past)

  • end_date (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to day: [YYYY-MM-DD] for cost ending this day.

Return type:

CostByOrgResponse

get_historical_cost_by_org(start_month: datetime, *, view: str | UnsetType = UnsetType.unset, end_month: datetime | UnsetType = UnsetType.unset) CostByOrgResponse

Get historical cost across your account.

Get historical cost across multi-org and single root-org accounts. Cost data for a given month becomes available no later than the 16th of the following month.

Parameters:
  • start_month (datetime) – Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost beginning this month.

  • view (str, optional) – String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are summary and sub-org. Defaults to summary.

  • end_month (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost ending this month.

Return type:

CostByOrgResponse

get_hourly_usage(filter_timestamp_start: datetime, filter_product_families: str, *, filter_timestamp_end: datetime | UnsetType = UnsetType.unset, filter_include_descendants: bool | UnsetType = UnsetType.unset, filter_versions: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset, page_next_record_id: str | UnsetType = UnsetType.unset) HourlyUsageResponse

Get hourly usage by product family.

Get hourly usage by product family.

Parameters:
  • filter_timestamp_start (datetime) – Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • filter_product_families (str) – Comma separated list of product families to retrieve. Available families are all , analyzed_logs , application_security , audit_logs , serverless , ci_app , cspm , custom_events , cws , dbm , fargate , infra_hosts , incident_management , indexed_logs , indexed_spans , ingested_spans , iot , lambda_traced_invocations , logs , network_flows , network_hosts , observability_pipelines , online_archive , profiling , rum , rum_browser_sessions , rum_mobile_sessions , sds , snmp , synthetics_api , synthetics_browser , synthetics_parallel_testing , and timeseries.

  • filter_timestamp_end (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

  • filter_include_descendants (bool, optional) – Include child org usage in the response. Defaults to false.

  • filter_versions (str, optional) – Comma separated list of product family versions to use in the format product_family:version. For example, infra_hosts:1.0.0. If this parameter is not used, the API will use the latest version of each requested product family. Currently all families have one version 1.0.0.

  • page_limit (int, optional) – Maximum number of results to return (between 1 and 500) - defaults to 500 if limit not specified.

  • page_next_record_id (str, optional) – List following results with a next_record_id provided in the previous query.

Return type:

HourlyUsageResponse

get_usage_application_security_monitoring(start_hr: datetime, *, end_hr: datetime | UnsetType = UnsetType.unset) UsageApplicationSecurityMonitoringResponse

Get hourly usage for application security.

Get hourly usage for application security . Note: hourly usage data for all products is now available in the Get hourly usage by product family API

Parameters:
  • start_hr (datetime) – Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • end_hr (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Return type:

UsageApplicationSecurityMonitoringResponse

get_usage_lambda_traced_invocations(start_hr: datetime, *, end_hr: datetime | UnsetType = UnsetType.unset) UsageLambdaTracedInvocationsResponse

Get hourly usage for lambda traced invocations.

Get hourly usage for lambda traced invocations. Note: hourly usage data for all products is now available in the Get hourly usage by product family API

Parameters:
  • start_hr (datetime) – Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • end_hr (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Return type:

UsageLambdaTracedInvocationsResponse

get_usage_observability_pipelines(start_hr: datetime, *, end_hr: datetime | UnsetType = UnsetType.unset) UsageObservabilityPipelinesResponse

Get hourly usage for observability pipelines.

Get hourly usage for observability pipelines. Note: hourly usage data for all products is now available in the Get hourly usage by product family API

Parameters:
  • start_hr (datetime) – Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • end_hr (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Return type:

UsageObservabilityPipelinesResponse

users_api

class UsersApi(api_client=None)

Bases: object

Create, edit, and disable users.

create_service_account(body: ServiceAccountCreateRequest) UserResponse

Create a service account.

Create a service account for your organization.

Return type:

UserResponse

create_user(body: UserCreateRequest) UserResponse

Create a user.

Create a user for your organization.

Return type:

UserResponse

disable_user(user_id: str) None

Disable a user.

Disable a user. Can only be used with an application key belonging to an administrator user.

Parameters:

user_id (str) – The ID of the user.

Return type:

None

get_invitation(user_invitation_uuid: str) UserInvitationResponse

Get a user invitation.

Returns a single user invitation by its UUID.

Parameters:

user_invitation_uuid (str) – The UUID of the user invitation.

Return type:

UserInvitationResponse

get_user(user_id: str) UserResponse

Get user details.

Get a user in the organization specified by the user’s user_id.

Parameters:

user_id (str) – The ID of the user.

Return type:

UserResponse

list_user_organizations(user_id: str) UserResponse

Get a user organization.

Get a user organization. Returns the user information and all organizations joined by this user.

Parameters:

user_id (str) – The ID of the user.

Return type:

UserResponse

list_user_permissions(user_id: str) PermissionsResponse

Get a user permissions.

Get a user permission set. Returns a list of the user’s permissions granted by the associated user’s roles.

Parameters:

user_id (str) – The ID of the user.

Return type:

PermissionsResponse

list_users(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: str | UnsetType = UnsetType.unset, sort_dir: QuerySortOrder | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset, filter_status: str | UnsetType = UnsetType.unset) UsersResponse

List all users.

Get the list of all users in the organization. This list includes all users even if they are deactivated or unverified.

Parameters:
  • page_size (int, optional) – Size for a given page. The maximum allowed value is 5000.

  • page_number (int, optional) – Specific page number to return.

  • sort (str, optional) – User attribute to order results by. Sort order is ascending by default. Sort order is descending if the field is prefixed by a negative sign, for example sort=-name. Options: name , modified_at , user_count.

  • sort_dir (QuerySortOrder, optional) – Direction of sort. Options: asc , desc.

  • filter (str, optional) – Filter all users by the given string. Defaults to no filtering.

  • filter_status (str, optional) – Filter on status attribute. Comma separated list, with possible values Active , Pending , and Disabled. Defaults to no filtering.

Return type:

UsersResponse

send_invitations(body: UserInvitationsRequest) UserInvitationsResponse

Send invitation emails.

Sends emails to one or more users inviting them to join the organization.

Return type:

UserInvitationsResponse

update_user(user_id: str, body: UserUpdateRequest) UserResponse

Update a user.

Edit a user. Can only be used with an application key belonging to an administrator user.

Parameters:

user_id (str) – The ID of the user.

Return type:

UserResponse