datadog_api_client.v2.api

api_management_api

class APIManagementApi(api_client=None)

Bases: object

Configure your API endpoints through the Datadog API.

create_open_api(*, openapi_spec_file: IOBase | UnsetType = UnsetType.unset) CreateOpenAPIResponse

Create a new API.

Create a new API from the OpenAPI specification given. It supports version 2.0 , 3.0 and 3.1 of the specification. A specific extension section, x-datadog , let you specify the teamHandle for your team responsible for the API in Datadog. It returns the created API ID.

Parameters:

openapi_spec_file (file_type, optional) – Binary OpenAPI spec file

Return type:

CreateOpenAPIResponse

delete_open_api(id: UUID) None

Delete an API.

Delete a specific API by ID.

Parameters:

id (UUID) – ID of the API to delete

Return type:

None

get_open_api(id: UUID) IOBase

Get an API.

Retrieve information about a specific API in OpenAPI format file.

Parameters:

id (UUID) – ID of the API to retrieve

Return type:

file_type

update_open_api(id: UUID, *, openapi_spec_file: IOBase | UnsetType = UnsetType.unset) UpdateOpenAPIResponse

Update an API.

Update information about a specific API. The given content will replace all API content of the given ID. The ID is returned by the create API, or can be found in the URL in the API catalog UI.

Parameters:
  • id (UUID) – ID of the API to modify

  • openapi_spec_file (file_type, optional) – Binary OpenAPI spec file

Return type:

UpdateOpenAPIResponse

apm_retention_filters_api

class APMRetentionFiltersApi(api_client=None)

Bases: object

Manage configuration of APM retention filters for your organization. You need an API and application key with Admin rights to interact with this endpoint. See retention filters on the Trace Retention page for more information.

create_apm_retention_filter(body: RetentionFilterCreateRequest) RetentionFilterResponse

Create a retention filter.

Create a retention filter to index spans in your organization. Returns the retention filter definition when the request is successful.

Parameters:

body (RetentionFilterCreateRequest) – The definition of the new retention filter.

Return type:

RetentionFilterResponse

delete_apm_retention_filter(filter_id: str) None

Delete a retention filter.

Delete a specific retention filter from your organization.

Parameters:

filter_id (str) – The ID of the retention filter.

Return type:

None

get_apm_retention_filter(filter_id: str) RetentionFilterResponse

Get a given APM retention filter.

Get an APM retention filter.

Parameters:

filter_id (str) – The ID of the retention filter.

Return type:

RetentionFilterResponse

list_apm_retention_filters() RetentionFiltersResponse

List all APM retention filters.

Get the list of APM retention filters.

Return type:

RetentionFiltersResponse

reorder_apm_retention_filters(body: ReorderRetentionFiltersRequest) None

Re-order retention filters.

Re-order the execution order of retention filters.

Parameters:

body (ReorderRetentionFiltersRequest) – The list of retention filters in the new order.

Return type:

None

update_apm_retention_filter(filter_id: str, body: RetentionFilterUpdateRequest) RetentionFilterResponse

Update a retention filter.

Update a retention filter from your organization.

Parameters:
  • filter_id (str) – The ID of the retention filter.

  • body (RetentionFilterUpdateRequest) – The updated definition of the retention filter.

Return type:

RetentionFilterResponse

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

The AuthN Mappings API is used to automatically map groups of users to roles in Datadog using attributes sent from Identity Providers. Use these endpoints to manage your AuthN Mappings.

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 100.

  • 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 and send them to your Datadog site over HTTP. See the CI Pipeline Visibility in Datadog page for more information.

aggregate_ci_app_pipeline_events(body: CIAppPipelinesAggregateRequest) CIAppPipelinesAnalyticsAggregateResponse

Aggregate pipelines events.

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

Return type:

CIAppPipelinesAnalyticsAggregateResponse

create_ci_app_pipeline_event(body: CIAppCreatePipelineEventRequest) dict

Send pipeline event.

Send your pipeline event to your Datadog platform over HTTP. For details about how pipeline executions are modeled and what execution types we support, see Pipeline Data Model And Execution Types.

Pipeline events can be submitted with a timestamp that is up to 18 hours in the past.

Return type:

dict

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 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 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. See the Test Visibility in Datadog page for more information.

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_cost_management_api

class CloudCostManagementApi(api_client=None)

Bases: object

The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS and Azure. See the Cloud Cost Management page for more information.

create_cost_awscur_config(body: AwsCURConfigPostRequest) AwsCURConfigResponse

Create Cloud Cost Management AWS CUR config.

Create a Cloud Cost Management account for an AWS CUR config.

Return type:

AwsCURConfigResponse

create_cost_azure_uc_configs(body: AzureUCConfigPostRequest) AzureUCConfigPairsResponse

Create Cloud Cost Management Azure configs.

Create a Cloud Cost Management account for an Azure config.

Return type:

AzureUCConfigPairsResponse

delete_cost_awscur_config(cloud_account_id: str) None

Delete Cloud Cost Management AWS CUR config.

Archive a Cloud Cost Management Account.

Parameters:

cloud_account_id (str) – Cloud Account id.

Return type:

None

delete_cost_azure_uc_config(cloud_account_id: str) None

Delete Cloud Cost Management Azure config.

Archive a Cloud Cost Management Account.

Parameters:

cloud_account_id (str) – Cloud Account id.

Return type:

None

get_cloud_cost_activity() CloudCostActivityResponse

Cloud Cost Enabled.

Get the Cloud Cost Management activity.

Return type:

CloudCostActivityResponse

List related AWS accounts.

List the AWS accounts in an organization by calling ‘organizations:ListAccounts’ from the specified management account.

Parameters:

filter_management_account_id (str) – The ID of the management account to filter by.

Return type:

AWSRelatedAccountsResponse

list_cost_awscur_configs() AwsCURConfigsResponse

List Cloud Cost Management AWS CUR configs.

List the AWS CUR configs.

Return type:

AwsCURConfigsResponse

list_cost_azure_uc_configs() AzureUCConfigsResponse

List Cloud Cost Management Azure configs.

List the Azure configs.

Return type:

AzureUCConfigsResponse

update_cost_awscur_config(cloud_account_id: str, body: AwsCURConfigPatchRequest) AwsCURConfigsResponse

Update Cloud Cost Management AWS CUR config.

Update the status of an AWS CUR config (active/archived).

Parameters:

cloud_account_id (str) – Cloud Account id.

Return type:

AwsCURConfigsResponse

update_cost_azure_uc_configs(cloud_account_id: str, body: AzureUCConfigPatchRequest) AzureUCConfigPairsResponse

Update Cloud Cost Management Azure config.

Update the status of an Azure config (active/archived).

Parameters:

cloud_account_id (str) – Cloud Account id.

Return type:

AzureUCConfigPairsResponse

cloud_workload_security_api

class CloudWorkloadSecurityApi(api_client=None)

Bases: object

Workload activity security rules for generating events using the Datadog security Agent. See the Setting up CSM Workload Security page for more information.

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

Manage your Datadog Cloudflare integration directly through the Datadog API. See the Cloudflare integration page for more information.

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

container_images_api

class ContainerImagesApi(api_client=None)

Bases: object

The Container Images API allows you to query Container Image data for your organization.

list_container_images(*, filter_tags: str | UnsetType = UnsetType.unset, group_by: str | UnsetType = UnsetType.unset, sort: str | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset) ContainerImagesResponse

Get all Container Images.

Get all Container Images for your organization.

Parameters:
  • filter_tags (str, optional) – Comma-separated list of tags to filter Container Images by.

  • group_by (str, optional) – Comma-separated list of tags to group Container Images by.

  • sort (str, optional) – Attribute to sort Container Images by.

  • page_size (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.pagination.next_cursor.

Return type:

ContainerImagesResponse

list_container_images_with_pagination(*, filter_tags: str | UnsetType = UnsetType.unset, group_by: str | UnsetType = UnsetType.unset, sort: str | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset) Iterable[ContainerImageItem]

Get all Container Images.

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

Parameters:
  • filter_tags (str, optional) – Comma-separated list of tags to filter Container Images by.

  • group_by (str, optional) – Comma-separated list of tags to group Container Images by.

  • sort (str, optional) – Attribute to sort Container Images by.

  • page_size (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.pagination.next_cursor.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[ContainerImageItem]

containers_api

class ContainersApi(api_client=None)

Bases: object

The Containers API allows you to query container data for your organization.

list_containers(*, filter_tags: str | UnsetType = UnsetType.unset, group_by: str | UnsetType = UnsetType.unset, sort: str | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset) ContainersResponse

Get All Containers.

Get all containers for your organization.

Parameters:
  • filter_tags (str, optional) – Comma-separated list of tags to filter containers by.

  • group_by (str, optional) – Comma-separated list of tags to group containers by.

  • sort (str, optional) – Attribute to sort containers by.

  • page_size (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.pagination.next_cursor.

Return type:

ContainersResponse

list_containers_with_pagination(*, filter_tags: str | UnsetType = UnsetType.unset, group_by: str | UnsetType = UnsetType.unset, sort: str | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset) Iterable[ContainerItem]

Get All Containers.

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

Parameters:
  • filter_tags (str, optional) – Comma-separated list of tags to filter containers by.

  • group_by (str, optional) – Comma-separated list of tags to group containers by.

  • sort (str, optional) – Attribute to sort containers by.

  • page_size (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.pagination.next_cursor.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[ContainerItem]

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

dora_metrics_api

class DORAMetricsApi(api_client=None)

Bases: object

Send events for DORA Metrics to measure and improve software delivery. See the DORA Metrics page for more information.

create_dora_deployment(body: DORADeploymentRequest) DORADeploymentResponse

Send a deployment event for DORA Metrics.

Use this API endpoint to provide data about deployments for DORA metrics.

This is necessary for:

  • Deployment Frequency

  • Change Lead Time

  • Change Failure Rate

Return type:

DORADeploymentResponse

create_dora_incident(body: DORAIncidentRequest) DORAIncidentResponse

Send an incident event for DORA Metrics.

Use this API endpoint to provide data about incidents for DORA metrics.

This is necessary for:

  • Change Failure Rate

  • Time to Restore

Return type:

DORAIncidentResponse

downtimes_api

class DowntimesApi(api_client=None)

Bases: object

Note : Downtime V2 is currently in private beta. To request access, contact Datadog support.

Downtiming gives you greater control over monitor notifications by allowing you to globally exclude scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags.

cancel_downtime(downtime_id: str) None

Cancel a downtime.

Cancel a downtime.

Parameters:

downtime_id (str) – ID of the downtime to cancel.

Return type:

None

create_downtime(body: DowntimeCreateRequest) DowntimeResponse

Schedule a downtime.

Schedule a downtime.

Parameters:

body (DowntimeCreateRequest) – Schedule a downtime request body.

Return type:

DowntimeResponse

get_downtime(downtime_id: str, *, include: str | UnsetType = UnsetType.unset) DowntimeResponse

Get a downtime.

Get downtime detail by downtime_id.

Parameters:
  • downtime_id (str) – ID of the downtime to fetch.

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

Return type:

DowntimeResponse

list_downtimes(*, current_only: bool | UnsetType = UnsetType.unset, include: str | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) ListDowntimesResponse

Get all downtimes.

Get all scheduled downtimes.

Parameters:
  • current_only (bool, optional) – Only return downtimes that are active when the request is made.

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

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

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

Return type:

ListDowntimesResponse

list_downtimes_with_pagination(*, current_only: bool | UnsetType = UnsetType.unset, include: str | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[DowntimeResponseData]

Get all downtimes.

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

Parameters:
  • current_only (bool, optional) – Only return downtimes that are active when the request is made.

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

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

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

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[DowntimeResponseData]

list_monitor_downtimes(monitor_id: int, *, page_offset: int | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) MonitorDowntimeMatchResponse

Get active downtimes for a monitor.

Get all active downtimes for the specified monitor.

Parameters:
  • monitor_id (int) – The id of the monitor.

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

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

Return type:

MonitorDowntimeMatchResponse

list_monitor_downtimes_with_pagination(monitor_id: int, *, page_offset: int | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[MonitorDowntimeMatchResponseData]

Get active downtimes for a monitor.

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

Parameters:
  • monitor_id (int) – The id of the monitor.

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

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

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[MonitorDowntimeMatchResponseData]

update_downtime(downtime_id: str, body: DowntimeUpdateRequest) DowntimeResponse

Update a downtime.

Update a downtime by downtime_id.

Parameters:
  • downtime_id (str) – ID of the downtime to update.

  • body (DowntimeUpdateRequest) – Update a downtime request body.

Return type:

DowntimeResponse

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

gcp_integration_api

class GCPIntegrationApi(api_client=None)

Bases: object

Configure your Datadog-Google Cloud Platform (GCP) integration directly through the Datadog API. Read more about the Datadog-Google Cloud Platform integration.

create_gcpsts_account(body: GCPSTSServiceAccountCreateRequest) GCPSTSServiceAccountResponse

Create a new entry for your service account.

Create a new entry within Datadog for your STS enabled service account.

Return type:

GCPSTSServiceAccountResponse

delete_gcpsts_account(account_id: str) None

Delete an STS enabled GCP Account.

Delete an STS enabled GCP account from within Datadog.

Parameters:

account_id (str) – Your GCP STS enabled service account’s unique ID.

Return type:

None

get_gcpsts_delegate() GCPSTSDelegateAccountResponse

List delegate account.

List your Datadog-GCP STS delegate account configured in your Datadog account.

Return type:

GCPSTSDelegateAccountResponse

list_gcpsts_accounts() GCPSTSServiceAccountsResponse

List all GCP STS-enabled service accounts.

List all GCP STS-enabled service accounts configured in your Datadog account.

Return type:

GCPSTSServiceAccountsResponse

make_gcpsts_delegate(*, body: dict | UnsetType = UnsetType.unset) GCPSTSDelegateAccountResponse

Create a Datadog GCP principal.

Create a Datadog GCP principal.

Parameters:

body (dict, optional) – Create a delegate service account within Datadog.

Return type:

GCPSTSDelegateAccountResponse

update_gcpsts_account(account_id: str, body: GCPSTSServiceAccountUpdateRequest) GCPSTSServiceAccountResponse

Update STS Service Account.

Update an STS enabled service account.

Parameters:

account_id (str) – Your GCP STS enabled service account’s unique ID.

Return type:

GCPSTSServiceAccountResponse

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 100.

  • 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

The Incident Teams endpoints are deprecated. See the Teams API endpoints to create, update, delete, and retrieve teams which can be associated with incidents.

create_incident_team(body: IncidentTeamCreateRequest) IncidentTeamResponse

Create a new incident team. Deprecated.

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. Deprecated.

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. Deprecated.

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. Deprecated.

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 100.

  • 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. Deprecated.

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

create_incident_integration(incident_id: str, body: IncidentIntegrationMetadataCreateRequest) IncidentIntegrationMetadataResponse

Create an incident integration metadata.

Create an incident integration metadata.

Parameters:
Return type:

IncidentIntegrationMetadataResponse

create_incident_todo(incident_id: str, body: IncidentTodoCreateRequest) IncidentTodoResponse

Create an incident todo.

Create an incident todo.

Parameters:
Return type:

IncidentTodoResponse

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

delete_incident_integration(incident_id: str, integration_metadata_id: str) None

Delete an incident integration metadata.

Delete an incident integration metadata.

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

  • integration_metadata_id (str) – The UUID of the incident integration metadata.

Return type:

None

delete_incident_todo(incident_id: str, todo_id: str) None

Delete an incident todo.

Delete an incident todo.

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

  • todo_id (str) – The UUID of the incident todo.

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

get_incident_integration(incident_id: str, integration_metadata_id: str) IncidentIntegrationMetadataResponse

Get incident integration metadata details.

Get incident integration metadata details.

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

  • integration_metadata_id (str) – The UUID of the incident integration metadata.

Return type:

IncidentIntegrationMetadataResponse

get_incident_todo(incident_id: str, todo_id: str) IncidentTodoResponse

Get incident todo details.

Get incident todo details.

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

  • todo_id (str) – The UUID of the incident todo.

Return type:

IncidentTodoResponse

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_incident_integrations(incident_id: str) IncidentIntegrationMetadataListResponse

Get a list of an incident’s integration metadata.

Get all integration metadata for an incident.

Parameters:

incident_id (str) – The UUID of the incident.

Return type:

IncidentIntegrationMetadataListResponse

list_incident_todos(incident_id: str) IncidentTodoListResponse

Get a list of an incident’s todos.

Get all todos for an incident.

Parameters:

incident_id (str) – The UUID of the incident.

Return type:

IncidentTodoListResponse

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 100.

  • 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 100.

  • 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, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset) IncidentSearchResponse

Search for incidents.

Search for incidents matching a certain query.

Parameters:
  • query (str) – Specifies which incidents should be returned. 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 example: 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.

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

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

Return type:

IncidentSearchResponse

search_incidents_with_pagination(query: str, *, include: IncidentRelatedObject | UnsetType = UnsetType.unset, sort: IncidentSearchSortOrder | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset) Iterable[IncidentSearchResponseIncidentsData]

Search for incidents.

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

Parameters:
  • query (str) – Specifies which incidents should be returned. 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 example: 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.

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

  • 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[IncidentSearchResponseIncidentsData]

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

update_incident_integration(incident_id: str, integration_metadata_id: str, body: IncidentIntegrationMetadataPatchRequest) IncidentIntegrationMetadataResponse

Update an existing incident integration metadata.

Update an existing incident integration metadata.

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

  • integration_metadata_id (str) – The UUID of the incident integration metadata.

  • body (IncidentIntegrationMetadataPatchRequest) – Incident integration metadata payload.

Return type:

IncidentIntegrationMetadataResponse

update_incident_todo(incident_id: str, todo_id: str, body: IncidentTodoPatchRequest) IncidentTodoResponse

Update an incident todo.

Update an incident todo.

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

  • todo_id (str) – The UUID of the incident todo.

  • body (IncidentTodoPatchRequest) – Incident todo payload.

Return type:

IncidentTodoResponse

ip_allowlist_api

class IPAllowlistApi(api_client=None)

Bases: object

The IP allowlist API is used to manage the IP addresses that can access the Datadog API and web UI. It does not block access to intake APIs or public dashboards.

This is an enterprise-only feature. Request access by contacting Datadog support.

get_ip_allowlist() IPAllowlistResponse

Get IP Allowlist.

Returns the IP allowlist and its enabled or disabled state.

Return type:

IPAllowlistResponse

update_ip_allowlist(body: IPAllowlistUpdateRequest) IPAllowlistResponse

Update IP Allowlist.

Edit the entries in the IP allowlist, and enable or disable it.

Return type:

IPAllowlistResponse

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, filter_remote_config_read_enabled: bool | UnsetType = UnsetType.unset, filter_category: 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 100.

  • 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.

  • filter_remote_config_read_enabled (bool, optional) – Filter API keys by remote config read enabled status.

  • filter_category (str, optional) – Filter API keys by category.

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, include: 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 100.

  • 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.

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

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, include: 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 100.

  • 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.

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

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_indexes: List[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_indexes ([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_indexes: List[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_indexes ([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. Log events can be submitted with a timestamp that is up to 18 hours in the past.

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. The exclude_tags_mode value will set all metrics that match the prefix to the same exclusion state, metric tag configurations do not support mixed inclusion and exclusion for tags on the same metric. 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. By setting exclude_tags_mode to true the behavior is changed from an allow-list to a deny-list, and tags in the defined list will not be queryable. 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

Delete 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) – (Beta) 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. Default value is 3600 (1 hour), maximum value is 2,592,000 (30 days).

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. By setting exclude_tags_mode to true the behavior is changed from an allow-list to a deny-list, and tags in the defined list will not be queryable. Can only be used with application keys from users with the Manage Tags for Metrics permission. This endpoint requires a tag configuration to be created first.

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

okta_integration_api

class OktaIntegrationApi(api_client=None)

Bases: object

Configure your Datadog Okta integration directly through the Datadog API.

create_okta_account(body: OktaAccountRequest) OktaAccountResponse

Add Okta account.

Create an Okta account.

Return type:

OktaAccountResponse

delete_okta_account(account_id: str) None

Delete Okta account.

Delete an Okta account.

Parameters:

account_id (str) – None

Return type:

None

get_okta_account(account_id: str) OktaAccountResponse

Get Okta account.

Get an Okta account.

Parameters:

account_id (str) – None

Return type:

OktaAccountResponse

list_okta_accounts() OktaAccountsResponse

List Okta accounts.

List Okta accounts.

Return type:

OktaAccountsResponse

update_okta_account(account_id: str, body: OktaAccountUpdateRequest) OktaAccountResponse

Update Okta account.

Update an Okta account.

Parameters:

account_id (str) – None

Return type:

OktaAccountResponse

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

powerpack_api

class PowerpackApi(api_client=None)

Bases: object

The powerpack endpoints allow you to:

  • Get a powerpack

  • Create a powerpack

  • Delete a powerpack

  • Get a list of all powerpacks

The Patch and Delete API methods can only be performed on a powerpack by a user who has the powerpack create permission for that specific powerpack.

create_powerpack(body: Powerpack) PowerpackResponse

Create a new powerpack.

Create a powerpack.

Parameters:

body (Powerpack) – Create a powerpack request body.

Return type:

PowerpackResponse

delete_powerpack(powerpack_id: str) None

Delete a powerpack.

Delete a powerpack.

Parameters:

powerpack_id (str) – Powerpack id

Return type:

None

get_powerpack(powerpack_id: str) PowerpackResponse

Get a Powerpack.

Get a powerpack.

Parameters:

powerpack_id (str) – ID of the powerpack.

Return type:

PowerpackResponse

list_powerpacks(*, page_limit: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset) ListPowerpacksResponse

Get all powerpacks.

Get a list of all powerpacks.

Parameters:
  • page_limit (int, optional) – Maximum number of powerpacks in the response.

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

Return type:

ListPowerpacksResponse

list_powerpacks_with_pagination(*, page_limit: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset) Iterable[PowerpackData]

Get all powerpacks.

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

Parameters:
  • page_limit (int, optional) – Maximum number of powerpacks in the response.

  • 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[PowerpackData]

update_powerpack(powerpack_id: str, body: Powerpack) PowerpackResponse

Update a powerpack.

Update a powerpack.

Parameters:
  • powerpack_id (str) – ID of the powerpack.

  • body (Powerpack) – Update a powerpack request body.

Return type:

PowerpackResponse

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]

restriction_policies_api

class RestrictionPoliciesApi(api_client=None)

Bases: object

A restriction policy defines the access control rules for a resource, mapping a set of relations (such as editor and viewer) to a set of allowed principals (such as roles, teams, or users). The restriction policy determines who is authorized to perform what actions on the resource.

delete_restriction_policy(resource_id: str) None

Delete a restriction policy.

Deletes the restriction policy associated with a specified resource.

Parameters:

resource_id (str) – Identifier, formatted as type:id. Supported types: connection , dashboard , notebook , security-rule , slo.

Return type:

None

get_restriction_policy(resource_id: str) RestrictionPolicyResponse

Get a restriction policy.

Retrieves the restriction policy associated with a specified resource.

Parameters:

resource_id (str) – Identifier, formatted as type:id. Supported types: connection , dashboard , notebook , security-rule , slo.

Return type:

RestrictionPolicyResponse

update_restriction_policy(resource_id: str, body: RestrictionPolicyUpdateRequest) RestrictionPolicyResponse

Update a restriction policy.

Updates the restriction policy associated with a resource.

Supported resources

Restriction policies can be applied to the following resources:

  • Connections: connection

  • Dashboards: dashboard

  • Notebooks: notebook

  • Security Rules: security-rule

  • Service Level Objectives: slo

Supported relations for resources

Resource Type

Supported Relations

Connections

viewer , editor , resolver

Dashboards

viewer , editor

Notebooks

viewer , editor

Security Rules

viewer , editor

Service Level Objectives

viewer , editor

Parameters:
  • resource_id (str) – Identifier, formatted as type:id. Supported types: connection , dashboard , notebook , security-rule , slo.

  • body (RestrictionPolicyUpdateRequest) – Restriction policy payload

Return type:

RestrictionPolicyResponse

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 100.

  • 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, filter_id: 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 100.

  • 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.

  • filter_id (str, optional) – Filter all roles by the given list of role IDs.

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

create_security_monitoring_suppression(body: SecurityMonitoringSuppressionCreateRequest) SecurityMonitoringSuppressionResponse

Create a suppression rule.

Create a new suppression rule.

Parameters:

body (SecurityMonitoringSuppressionCreateRequest) – The definition of the new suppression rule.

Return type:

SecurityMonitoringSuppressionResponse

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

delete_security_monitoring_suppression(suppression_id: str) None

Delete a suppression rule.

Delete a specific suppression rule.

Parameters:

suppression_id (str) – The ID of the suppression 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_finding(finding_id: str, *, snapshot_timestamp: int | UnsetType = UnsetType.unset) GetFindingResponse

Get a finding.

Returns a single finding with message and resource configuration.

Parameters:
  • finding_id (str) – The ID of the finding.

  • snapshot_timestamp (int, optional) – Return the finding for a given snapshot of time (Unix ms).

Return type:

GetFindingResponse

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) SecurityMonitoringSignalResponse

Get a signal’s details.

Get a signal’s details.

Parameters:

signal_id (str) – The ID of the signal.

Return type:

SecurityMonitoringSignalResponse

get_security_monitoring_suppression(suppression_id: str) SecurityMonitoringSuppressionResponse

Get a suppression rule.

Get the details of a specific suppression rule.

Parameters:

suppression_id (str) – The ID of the suppression rule

Return type:

SecurityMonitoringSuppressionResponse

list_findings(*, page_limit: int | UnsetType = UnsetType.unset, snapshot_timestamp: int | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, filter_tags: str | UnsetType = UnsetType.unset, filter_evaluation_changed_at: str | UnsetType = UnsetType.unset, filter_muted: bool | UnsetType = UnsetType.unset, filter_rule_id: str | UnsetType = UnsetType.unset, filter_rule_name: str | UnsetType = UnsetType.unset, filter_resource_type: str | UnsetType = UnsetType.unset, filter_discovery_timestamp: str | UnsetType = UnsetType.unset, filter_evaluation: FindingEvaluation | UnsetType = UnsetType.unset, filter_status: FindingStatus | UnsetType = UnsetType.unset) ListFindingsResponse

List findings.

Get a list of CSPM findings.

Filtering

Filters can be applied by appending query parameters to the URL.

  • Using a single filter: ?filter[attribute_key]=attribute_value

  • Chaining filters: ?filter[attribute_key]=attribute_value&filter[attribute_key]=attribute_value...

  • Filtering on tags: ?filter[tags]=tag_key:tag_value&filter[tags]=tag_key_2:tag_value_2

Here, attribute_key can be any of the filter keys described further below.

Query parameters of type integer support comparison operators ( > , >= , < , <= ). This is particularly useful when filtering by evaluation_changed_at or resource_discovery_timestamp. For example: ?filter[evaluation_changed_at]=>20123123121.

You can also use the negation operator on strings. For example, use filter[resource_type]=-aws* to filter for any non-AWS resources.

The operator must come after the equal sign. For example, to filter with the >= operator, add the operator after the equal sign: filter[evaluation_changed_at]=>=1678809373257.

Query parameters must be only among the documented ones and with values of correct types. Duplicated query parameters (e.g. filter[status]=low&filter[status]=info ) are not allowed.

Response

The response includes an array of finding objects, pagination metadata, and a count of items that match the query.

Each finding object contains the following:

  • The finding ID that can be used in a GetFinding request to retrieve the full finding details.

  • Core attributes, including status, evaluation, high-level resource details, muted state, and rule details.

  • evaluation_changed_at and resource_discovery_date time stamps.

  • An array of associated tags.

Parameters:
  • page_limit (int, optional) – Limit the number of findings returned. Must be <= 1000.

  • snapshot_timestamp (int, optional) – Return findings for a given snapshot of time (Unix ms).

  • page_cursor (str, optional) – Return the next page of findings pointed to by the cursor.

  • filter_tags (str, optional) – Return findings that have these associated tags (repeatable).

  • filter_evaluation_changed_at (str, optional) – Return findings that have changed from pass to fail or vice versa on a specified date (Unix ms) or date range (using comparison operators).

  • filter_muted (bool, optional) – Set to true to return findings that are muted. Set to false to return unmuted findings.

  • filter_rule_id (str, optional) – Return findings for the specified rule ID.

  • filter_rule_name (str, optional) – Return findings for the specified rule.

  • filter_resource_type (str, optional) – Return only findings for the specified resource type.

  • filter_discovery_timestamp (str, optional) – Return findings that were found on a specified date (Unix ms) or date range (using comparison operators).

  • filter_evaluation (FindingEvaluation, optional) – Return only pass or fail findings.

  • filter_status (FindingStatus, optional) – Return only findings with the specified status.

Return type:

ListFindingsResponse

list_findings_with_pagination(*, page_limit: int | UnsetType = UnsetType.unset, snapshot_timestamp: int | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, filter_tags: str | UnsetType = UnsetType.unset, filter_evaluation_changed_at: str | UnsetType = UnsetType.unset, filter_muted: bool | UnsetType = UnsetType.unset, filter_rule_id: str | UnsetType = UnsetType.unset, filter_rule_name: str | UnsetType = UnsetType.unset, filter_resource_type: str | UnsetType = UnsetType.unset, filter_discovery_timestamp: str | UnsetType = UnsetType.unset, filter_evaluation: FindingEvaluation | UnsetType = UnsetType.unset, filter_status: FindingStatus | UnsetType = UnsetType.unset) Iterable[Finding]

List findings.

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

Parameters:
  • page_limit (int, optional) – Limit the number of findings returned. Must be <= 1000.

  • snapshot_timestamp (int, optional) – Return findings for a given snapshot of time (Unix ms).

  • page_cursor (str, optional) – Return the next page of findings pointed to by the cursor.

  • filter_tags (str, optional) – Return findings that have these associated tags (repeatable).

  • filter_evaluation_changed_at (str, optional) – Return findings that have changed from pass to fail or vice versa on a specified date (Unix ms) or date range (using comparison operators).

  • filter_muted (bool, optional) – Set to true to return findings that are muted. Set to false to return unmuted findings.

  • filter_rule_id (str, optional) – Return findings for the specified rule ID.

  • filter_rule_name (str, optional) – Return findings for the specified rule.

  • filter_resource_type (str, optional) – Return only findings for the specified resource type.

  • filter_discovery_timestamp (str, optional) – Return findings that were found on a specified date (Unix ms) or date range (using comparison operators).

  • filter_evaluation (FindingEvaluation, optional) – Return only pass or fail findings.

  • filter_status (FindingStatus, optional) – Return only findings with the specified status.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[Finding]

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 100.

  • 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]

list_security_monitoring_suppressions() SecurityMonitoringSuppressionsResponse

Get all suppression rules.

Get the list of all suppression rules.

Return type:

SecurityMonitoringSuppressionsResponse

mute_findings(body: BulkMuteFindingsRequest) BulkMuteFindingsResponse

Mute or unmute a batch of findings.

Mute or unmute findings.

Parameters:

body (BulkMuteFindingsRequest) –

Attributes

All findings are updated with the same attributes. The request body must include at least two attributes: muted and reason. The allowed reasons depend on whether the finding is being muted or unmuted:

  • To mute a finding: PENDING_FIX , FALSE_POSITIVE , ACCEPTED_RISK , OTHER.

  • To unmute a finding : NO_PENDING_FIX , HUMAN_ERROR , NO_LONGER_ACCEPTED_RISK , OTHER.

Meta

The request body must include a list of the finding IDs to be updated.

Return type:

BulkMuteFindingsResponse

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

update_security_monitoring_suppression(suppression_id: str, body: SecurityMonitoringSuppressionUpdateRequest) SecurityMonitoringSuppressionResponse

Update a suppression rule.

Update a specific suppression rule.

Parameters:
Return type:

SecurityMonitoringSuppressionResponse

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(body: ServiceAccountCreateRequest) UserResponse

Create a service account.

Create a service account for your organization.

Return type:

UserResponse

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 100.

  • 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 | ServiceDefinitionV2Dot2 | ServiceDefinitionV2Dot1 | 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, *, schema_version: ServiceDefinitionSchemaVersions | UnsetType = UnsetType.unset) 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.

  • schema_version (ServiceDefinitionSchemaVersions, optional) – The schema version desired in the response.

Return type:

ServiceDefinitionGetResponse

list_service_definitions(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, schema_version: ServiceDefinitionSchemaVersions | UnsetType = UnsetType.unset) ServiceDefinitionsListResponse

Get all service definitions.

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

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

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

  • schema_version (ServiceDefinitionSchemaVersions, optional) – The schema version desired in the response.

Return type:

ServiceDefinitionsListResponse

list_service_definitions_with_pagination(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, schema_version: ServiceDefinitionSchemaVersions | UnsetType = UnsetType.unset) Iterable[ServiceDefinitionData]

Get all service definitions.

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

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

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

  • schema_version (ServiceDefinitionSchemaVersions, optional) – The schema version desired in the response.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[ServiceDefinitionData]

service_scorecards_api

class ServiceScorecardsApi(api_client=None)

Bases: object

API to create, update scorecard rules and outcomes.

This feature is currently in BETA. If you have any feedback, contact Datadog support.

create_scorecard_outcomes_batch(body: OutcomesBatchRequest) OutcomesBatchResponse

Create outcomes batch.

Sets multiple service-rule outcomes in a single batched request.

Parameters:

body (OutcomesBatchRequest) – Set of scorecard outcomes.

Return type:

OutcomesBatchResponse

create_scorecard_rule(body: CreateRuleRequest) CreateRuleResponse

Create a new rule.

Creates a new rule.

Parameters:

body (CreateRuleRequest) – Rule attributes.

Return type:

CreateRuleResponse

delete_scorecard_rule(rule_id: str) None

Delete a rule.

Deletes a single rule.

Parameters:

rule_id (str) – The ID of the rule/scorecard.

Return type:

None

list_scorecard_outcomes(*, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset, include: str | UnsetType = UnsetType.unset, fields_outcome: str | UnsetType = UnsetType.unset, fields_rule: str | UnsetType = UnsetType.unset, filter_outcome_service_name: str | UnsetType = UnsetType.unset, filter_outcome_state: str | UnsetType = UnsetType.unset, filter_rule_enabled: bool | UnsetType = UnsetType.unset, filter_rule_id: str | UnsetType = UnsetType.unset, filter_rule_name: str | UnsetType = UnsetType.unset) OutcomesResponse

List all rule outcomes.

Fetches all rule outcomes.

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

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

  • include (str, optional) – Include related rule details in the response.

  • fields_outcome (str, optional) – Return only specified values in the outcome attributes.

  • fields_rule (str, optional) – Return only specified values in the included rule details.

  • filter_outcome_service_name (str, optional) – Filter the outcomes on a specific service name.

  • filter_outcome_state (str, optional) – Filter the outcomes by a specific state.

  • filter_rule_enabled (bool, optional) – Filter outcomes on whether a rule is enabled/disabled.

  • filter_rule_id (str, optional) – Filter outcomes based on rule ID.

  • filter_rule_name (str, optional) – Filter outcomes based on rule name.

Return type:

OutcomesResponse

list_scorecard_outcomes_with_pagination(*, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset, include: str | UnsetType = UnsetType.unset, fields_outcome: str | UnsetType = UnsetType.unset, fields_rule: str | UnsetType = UnsetType.unset, filter_outcome_service_name: str | UnsetType = UnsetType.unset, filter_outcome_state: str | UnsetType = UnsetType.unset, filter_rule_enabled: bool | UnsetType = UnsetType.unset, filter_rule_id: str | UnsetType = UnsetType.unset, filter_rule_name: str | UnsetType = UnsetType.unset) Iterable[OutcomesResponseDataItem]

List all rule outcomes.

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

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

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

  • include (str, optional) – Include related rule details in the response.

  • fields_outcome (str, optional) – Return only specified values in the outcome attributes.

  • fields_rule (str, optional) – Return only specified values in the included rule details.

  • filter_outcome_service_name (str, optional) – Filter the outcomes on a specific service name.

  • filter_outcome_state (str, optional) – Filter the outcomes by a specific state.

  • filter_rule_enabled (bool, optional) – Filter outcomes on whether a rule is enabled/disabled.

  • filter_rule_id (str, optional) – Filter outcomes based on rule ID.

  • filter_rule_name (str, optional) – Filter outcomes based on rule name.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[OutcomesResponseDataItem]

list_scorecard_rules(*, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset, include: str | UnsetType = UnsetType.unset, filter_rule_id: str | UnsetType = UnsetType.unset, filter_rule_enabled: bool | UnsetType = UnsetType.unset, filter_rule_custom: bool | UnsetType = UnsetType.unset, filter_rule_name: str | UnsetType = UnsetType.unset, filter_rule_description: str | UnsetType = UnsetType.unset, fields_rule: str | UnsetType = UnsetType.unset, fields_scorecard: str | UnsetType = UnsetType.unset) ListRulesResponse

List all rules.

Fetch all rules.

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

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

  • include (str, optional) – Include related scorecard details in the response.

  • filter_rule_id (str, optional) – Filter the rules on a rule ID.

  • filter_rule_enabled (bool, optional) – Filter for enabled rules only.

  • filter_rule_custom (bool, optional) – Filter for custom rules only.

  • filter_rule_name (str, optional) – Filter rules on the rule name.

  • filter_rule_description (str, optional) – Filter rules on the rule description.

  • fields_rule (str, optional) – Return only specific fields in the response for rule attributes.

  • fields_scorecard (str, optional) – Return only specific fields in the included response for scorecard attributes.

Return type:

ListRulesResponse

list_scorecard_rules_with_pagination(*, page_size: int | UnsetType = UnsetType.unset, page_offset: int | UnsetType = UnsetType.unset, include: str | UnsetType = UnsetType.unset, filter_rule_id: str | UnsetType = UnsetType.unset, filter_rule_enabled: bool | UnsetType = UnsetType.unset, filter_rule_custom: bool | UnsetType = UnsetType.unset, filter_rule_name: str | UnsetType = UnsetType.unset, filter_rule_description: str | UnsetType = UnsetType.unset, fields_rule: str | UnsetType = UnsetType.unset, fields_scorecard: str | UnsetType = UnsetType.unset) Iterable[ListRulesResponseDataItem]

List all rules.

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

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

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

  • include (str, optional) – Include related scorecard details in the response.

  • filter_rule_id (str, optional) – Filter the rules on a rule ID.

  • filter_rule_enabled (bool, optional) – Filter for enabled rules only.

  • filter_rule_custom (bool, optional) – Filter for custom rules only.

  • filter_rule_name (str, optional) – Filter rules on the rule name.

  • filter_rule_description (str, optional) – Filter rules on the rule description.

  • fields_rule (str, optional) – Return only specific fields in the response for rule attributes.

  • fields_scorecard (str, optional) – Return only specific fields in the included response for scorecard attributes.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[ListRulesResponseDataItem]

spans_api

class SpansApi(api_client=None)

Bases: object

Search and aggregate your spans from your Datadog platform over HTTP.

aggregate_spans(body: SpansAggregateRequest) SpansAggregateResponse

Aggregate spans.

The API endpoint to aggregate spans into buckets and compute metrics and timeseries. This endpoint is rate limited to 300 requests per hour.

Return type:

SpansAggregateResponse

list_spans(body: SpansListRequest) SpansListResponse

Search spans.

List endpoint returns spans that match a span search query. Results are paginated.

Use this endpoint to build complex spans filtering and search. This endpoint is rate limited to 300 requests per hour.

Return type:

SpansListResponse

list_spans_get(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: str | UnsetType = UnsetType.unset, filter_to: str | UnsetType = UnsetType.unset, sort: SpansSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) SpansListResponse

Get a list of spans.

List endpoint returns spans that match a span search query. Results are paginated.

Use this endpoint to see your latest spans. This endpoint is rate limited to 300 requests per hour.

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

  • filter_from (str, optional) – Minimum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds).

  • filter_to (str, optional) – Maximum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds).

  • sort (SpansSort, optional) – Order of spans in results.

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

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

Return type:

SpansListResponse

list_spans_get_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: str | UnsetType = UnsetType.unset, filter_to: str | UnsetType = UnsetType.unset, sort: SpansSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[Span]

Get a list of spans.

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

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

  • filter_from (str, optional) – Minimum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds).

  • filter_to (str, optional) – Maximum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds).

  • sort (SpansSort, optional) – Order of spans in results.

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

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

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[Span]

list_spans_with_pagination(body: SpansListRequest) Iterable[Span]

Search spans.

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

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[Span]

spans_metrics_api

class SpansMetricsApi(api_client=None)

Bases: object

Manage configuration of span-based metrics for your organization.

create_spans_metric(body: SpansMetricCreateRequest) SpansMetricResponse

Create a span-based metric.

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

Parameters:

body (SpansMetricCreateRequest) – The definition of the new span-based metric.

Return type:

SpansMetricResponse

delete_spans_metric(metric_id: str) None

Delete a span-based metric.

Delete a specific span-based metric from your organization.

Parameters:

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

Return type:

None

get_spans_metric(metric_id: str) SpansMetricResponse

Get a span-based metric.

Get a specific span-based metric from your organization.

Parameters:

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

Return type:

SpansMetricResponse

list_spans_metrics() SpansMetricsResponse

Get all span-based metrics.

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

Return type:

SpansMetricsResponse

update_spans_metric(metric_id: str, body: SpansMetricUpdateRequest) SpansMetricResponse

Update a span-based metric.

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

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

  • body (SpansMetricUpdateRequest) – New definition of the span-based metric.

Return type:

SpansMetricResponse

synthetics_api

class SyntheticsApi(api_client=None)

Bases: object

Datadog Synthetics uses simulated user requests and browser rendering to help you ensure uptime, identify regional issues, and track your application performance. Datadog Synthetics tests come in two different flavors, API tests and browser tests. You can use Datadog’s API to manage both test types programmatically.

For more information about Synthetics, see the Synthetics overview.

get_on_demand_concurrency_cap() OnDemandConcurrencyCapResponse

Get the on-demand concurrency cap.

Get the on-demand concurrency cap.

Return type:

OnDemandConcurrencyCapResponse

set_on_demand_concurrency_cap(body: OnDemandConcurrencyCapAttributes) OnDemandConcurrencyCapResponse

Save new value for on-demand concurrency cap.

Save new value for on-demand concurrency cap.

Parameters:

body (OnDemandConcurrencyCapAttributes) –

.

Return type:

OnDemandConcurrencyCapResponse

teams_api

class TeamsApi(api_client=None)

Bases: object

View and manage teams within Datadog.

create_team(body: TeamCreateRequest) TeamResponse

Create a team.

Create a new team. User IDs passed through the users relationship field are added to the team.

Return type:

TeamResponse

Create a team link.

Add a new link to a team.

Parameters:

team_id (str) – None

Return type:

TeamLinkResponse

create_team_membership(team_id: str, body: UserTeamRequest) UserTeamResponse

Add a user to a team.

Add a user to a team.

Parameters:

team_id (str) – None

Return type:

UserTeamResponse

delete_team(team_id: str) None

Remove a team.

Remove a team using the team’s id.

Parameters:

team_id (str) – None

Return type:

None

Remove a team link.

Remove a link from a team.

Parameters:
  • team_id (str) – None

  • link_id (str) – None

Return type:

None

delete_team_membership(team_id: str, user_id: str) None

Remove a user from a team.

Remove a user from a team.

Parameters:
  • team_id (str) – None

  • user_id (str) – None

Return type:

None

get_team(team_id: str) TeamResponse

Get a team.

Get a single team using the team’s id.

Parameters:

team_id (str) – None

Return type:

TeamResponse

Get a team link.

Get a single link for a team.

Parameters:
  • team_id (str) – None

  • link_id (str) – None

Return type:

TeamLinkResponse

Get links for a team.

Get all links for a given team.

Parameters:

team_id (str) – None

Return type:

TeamLinksResponse

get_team_memberships(team_id: str, *, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: GetTeamMembershipsSort | UnsetType = UnsetType.unset, filter_keyword: str | UnsetType = UnsetType.unset) UserTeamsResponse

Get team memberships.

Get a paginated list of members for a team

Parameters:
  • team_id (str) – None

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

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

  • sort (GetTeamMembershipsSort, optional) – Specifies the order of returned team memberships

  • filter_keyword (str, optional) – Search query, can be user email or name

Return type:

UserTeamsResponse

get_team_memberships_with_pagination(team_id: str, *, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: GetTeamMembershipsSort | UnsetType = UnsetType.unset, filter_keyword: str | UnsetType = UnsetType.unset) Iterable[UserTeam]

Get team memberships.

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

Parameters:
  • team_id (str) – None

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

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

  • sort (GetTeamMembershipsSort, optional) – Specifies the order of returned team memberships

  • filter_keyword (str, optional) – Search query, can be user email or name

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[UserTeam]

get_team_permission_settings(team_id: str) TeamPermissionSettingsResponse

Get permission settings for a team.

Get all permission settings for a given team.

Parameters:

team_id (str) – None

Return type:

TeamPermissionSettingsResponse

get_user_memberships(user_uuid: str) UserTeamsResponse

Get user memberships.

Get a list of memberships for a user

Parameters:

user_uuid (str) – None

Return type:

UserTeamsResponse

list_teams(*, page_number: int | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, sort: ListTeamsSort | UnsetType = UnsetType.unset, include: List[ListTeamsInclude] | UnsetType = UnsetType.unset, filter_keyword: str | UnsetType = UnsetType.unset, filter_me: bool | UnsetType = UnsetType.unset, fields_team: List[TeamsField] | UnsetType = UnsetType.unset) TeamsResponse

Get all teams.

Get all teams. Can be used to search for teams using the filter[keyword] and filter[me] query parameters.

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

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

  • sort (ListTeamsSort, optional) – Specifies the order of the returned teams

  • include ([ListTeamsInclude], optional) – Included related resources optionally requested. Allowed enum values: team_links, user_team_permissions

  • filter_keyword (str, optional) – Search query. Can be team name, team handle, or email of team member

  • filter_me (bool, optional) – When true, only returns teams the current user belongs to

  • fields_team ([TeamsField], optional) – List of fields that need to be fetched.

Return type:

TeamsResponse

list_teams_with_pagination(*, page_number: int | UnsetType = UnsetType.unset, page_size: int | UnsetType = UnsetType.unset, sort: ListTeamsSort | UnsetType = UnsetType.unset, include: List[ListTeamsInclude] | UnsetType = UnsetType.unset, filter_keyword: str | UnsetType = UnsetType.unset, filter_me: bool | UnsetType = UnsetType.unset, fields_team: List[TeamsField] | UnsetType = UnsetType.unset) Iterable[Team]

Get all teams.

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

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

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

  • sort (ListTeamsSort, optional) – Specifies the order of the returned teams

  • include ([ListTeamsInclude], optional) – Included related resources optionally requested. Allowed enum values: team_links, user_team_permissions

  • filter_keyword (str, optional) – Search query. Can be team name, team handle, or email of team member

  • filter_me (bool, optional) – When true, only returns teams the current user belongs to

  • fields_team ([TeamsField], optional) – List of fields that need to be fetched.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[Team]

update_team(team_id: str, body: TeamUpdateRequest) TeamResponse

Update a team.

Update a team using the team’s id. If the team_links relationship is present, the associated links are updated to be in the order they appear in the array, and any existing team links not present are removed.

Parameters:

team_id (str) – None

Return type:

TeamResponse

Update a team link.

Update a team link.

Parameters:
  • team_id (str) – None

  • link_id (str) – None

Return type:

TeamLinkResponse

update_team_membership(team_id: str, user_id: str, body: UserTeamUpdateRequest) UserTeamResponse

Update a user’s membership attributes on a team.

Update a user’s membership attributes on a team.

Parameters:
  • team_id (str) – None

  • user_id (str) – None

Return type:

UserTeamResponse

update_team_permission_setting(team_id: str, action: str, body: TeamPermissionSettingUpdateRequest) TeamPermissionSettingResponse

Update permission setting for team.

Update a team permission setting for a given team.

Parameters:
  • team_id (str) – None

  • action (str) – None

Return type:

TeamPermissionSettingResponse

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. Learn more on the usage details documentation.

get_active_billing_dimensions() ActiveBillingDimensionsResponse

Get active billing dimensions for cost attribution.

Get active billing dimensions for cost attribution. Cost data for a given month becomes available no later than the 17th of the following month.

Return type:

ActiveBillingDimensionsResponse

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). Provide an end_month to view month-over-month cost.

  • 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). Provide an end_date to view day-over-day cumulative cost.

  • 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_include_breakdown: 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_trail , serverless , ci_app , cloud_cost_management , csm_container_enterprise , csm_host_enterprise , 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 , netflow_monitoring , observability_pipelines , online_archive , profiling , rum , rum_browser_sessions , rum_mobile_sessions , sds , snmp , synthetics_api , synthetics_browser , synthetics_mobile , synthetics_parallel_testing , and timeseries. The following product family has been deprecated : audit_logs.

  • 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_include_breakdown (bool, optional) – Include breakdown of usage by subcategories where applicable (for product family logs only). 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_monthly_cost_attribution(start_month: datetime, end_month: datetime, fields: str, *, sort_direction: SortDirection | UnsetType = UnsetType.unset, sort_name: str | UnsetType = UnsetType.unset, tag_breakdown_keys: str | UnsetType = UnsetType.unset, next_record_id: str | UnsetType = UnsetType.unset, include_descendants: bool | UnsetType = UnsetType.unset) MonthlyCostAttributionResponse

Get Monthly Cost Attribution.

Get monthly cost attribution by tag across multi-org and single root-org accounts. Cost Attribution data for a given month becomes available no later than the 17th of the following month. This API endpoint is paginated. To make sure you receive all records, check if the value of next_record_id is set in the response. If it is, make another request and pass next_record_id as a parameter. Pseudo code example:

response := GetMonthlyCostAttribution(start_month, end_month)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
  sleep(5 seconds)  # Avoid running into rate limit
  response := GetMonthlyCostAttribution(start_month, end_month, next_record_id=cursor)
  cursor := response.metadata.pagination.next_record_id
END
Parameters:
  • start_month (datetime) – Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost beginning in this month.

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

  • fields (str) – Comma-separated list specifying cost types (e.g., <billing_dimension>_on_demand_cost , <billing_dimension>_committed_cost , <billing_dimension>_total_cost ) and the proportions ( <billing_dimension>_percentage_in_org , <billing_dimension>_percentage_in_account ). Use * to retrieve all fields. Example: infra_host_on_demand_cost,infra_host_percentage_in_account To obtain the complete list of active billing dimensions that can be used to replace <billing_dimension> in the field names, make a request to the Get active billing dimensions API.

  • sort_direction (SortDirection, optional) – The direction to sort by: [desc, asc].

  • sort_name (str, optional) – The billing dimension to sort by. Always sorted by total cost. Example: infra_host.

  • tag_breakdown_keys (str, optional) – Comma separated list of tag keys used to group cost. If no value is provided the cost will not be broken down by tags. To see which tags are available, look for the value of tag_config_source in the API response.

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

  • include_descendants (bool, optional) – Include child org cost in the response. Defaults to true.

Return type:

MonthlyCostAttributionResponse

get_projected_cost(*, view: str | UnsetType = UnsetType.unset) ProjectedCostResponse

Get projected cost across your account.

Get projected cost across multi-org and single root-org accounts. Projected cost data is only available for the current month and becomes available around the 12th of the month. This endpoint requires the usage_read authorization scope.

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.

Return type:

ProjectedCostResponse

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_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 100.

  • 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

list_users_with_pagination(*, 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) Iterable[User]

List all users.

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

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

  • 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.

Returns:

A generator of paginated results.

Return type:

collections.abc.Iterable[User]

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