datadog_api_client.v2.api¶
audit_api¶
- class AuditApi(api_client=None)¶
Bases:
object
Search your Audit Logs events over HTTP.
- list_audit_logs(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: AuditLogsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) AuditLogsEventsResponse ¶
Get a list of Audit Logs events.
List endpoint returns events that match a Audit Logs search query. Results are paginated.
Use this endpoint to see your latest Audit Logs events.
- Parameters:
filter_query (str, optional) – Search query following Audit Logs syntax.
filter_from (datetime, optional) – Minimum timestamp for requested events.
filter_to (datetime, optional) – Maximum timestamp for requested events.
sort (AuditLogsSort, optional) – Order of events in results.
page_cursor (str, optional) – List following results with a cursor provided in the previous query.
page_limit (int, optional) – Maximum number of events in the response.
- Return type:
- 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:
- search_audit_logs_with_pagination(*, body: AuditLogsSearchEventsRequest | UnsetType = UnsetType.unset) Iterable[AuditLogsEvent] ¶
Search Audit Logs events.
Provide a paginated version of
search_audit_logs()
, returning all items.- Returns:
A generator of paginated results.
- Return type:
collections.abc.Iterable[AuditLogsEvent]
authn_mappings_api¶
- class AuthNMappingsApi(api_client=None)¶
Bases:
object
AuthN Mappings API is used to automatically map group of users to roles in Datadog using attributes sent from Identity Providers.
- create_authn_mapping(body: AuthNMappingCreateRequest) AuthNMappingResponse ¶
Create an AuthN Mapping.
Create an AuthN Mapping.
- Return type:
- 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:
- 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:
- 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:
ci_visibility_pipelines_api¶
- class CIVisibilityPipelinesApi(api_client=None)¶
Bases:
object
Search or aggregate your CI Visibility pipeline events over HTTP.
- aggregate_ci_app_pipeline_events(body: CIAppPipelinesAggregateRequest) CIAppPipelinesAnalyticsAggregateResponse ¶
Aggregate pipelines events.
The API endpoint to aggregate CI Visibility pipeline events into buckets of computed metrics and timeseries.
- Return type:
- list_ci_app_pipeline_events(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: CIAppSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) CIAppPipelineEventsResponse ¶
Get a list of pipelines events.
List endpoint returns CI Visibility pipeline events that match a log search query. Results are paginated similarly to logs.
Use this endpoint to see your latest pipeline events.
- Parameters:
filter_query (str, optional) – Search query following log syntax.
filter_from (datetime, optional) – Minimum timestamp for requested events.
filter_to (datetime, optional) – Maximum timestamp for requested events.
sort (CIAppSort, optional) – Order of events in results.
page_cursor (str, optional) – List following results with a cursor provided in the previous query.
page_limit (int, optional) – Maximum number of events in the response.
- Return type:
- list_ci_app_pipeline_events_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: CIAppSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[CIAppPipelineEvent] ¶
Get a list of pipelines events.
Provide a paginated version of
list_ci_app_pipeline_events()
, returning all items.- Parameters:
filter_query (str, optional) – Search query following log syntax.
filter_from (datetime, optional) – Minimum timestamp for requested events.
filter_to (datetime, optional) – Maximum timestamp for requested events.
sort (CIAppSort, optional) – Order of events in results.
page_cursor (str, optional) – List following results with a cursor provided in the previous query.
page_limit (int, optional) – Maximum number of events in the response.
- Returns:
A generator of paginated results.
- Return type:
collections.abc.Iterable[CIAppPipelineEvent]
- search_ci_app_pipeline_events(*, body: CIAppPipelineEventsRequest | UnsetType = UnsetType.unset) CIAppPipelineEventsResponse ¶
Search pipelines events.
List endpoint returns CI Visibility pipeline events that match a log search query. Results are paginated similarly to logs.
Use this endpoint to build complex events filtering and search.
- Return type:
- search_ci_app_pipeline_events_with_pagination(*, body: CIAppPipelineEventsRequest | UnsetType = UnsetType.unset) Iterable[CIAppPipelineEvent] ¶
Search pipelines events.
Provide a paginated version of
search_ci_app_pipeline_events()
, returning all items.- Returns:
A generator of paginated results.
- Return type:
collections.abc.Iterable[CIAppPipelineEvent]
ci_visibility_tests_api¶
- class CIVisibilityTestsApi(api_client=None)¶
Bases:
object
Search or aggregate your CI Visibility test events over HTTP.
- aggregate_ci_app_test_events(body: CIAppTestsAggregateRequest) CIAppTestsAnalyticsAggregateResponse ¶
Aggregate tests events.
The API endpoint to aggregate CI Visibility test events into buckets of computed metrics and timeseries.
- Return type:
- 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:
- 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:
- search_ci_app_test_events_with_pagination(*, body: CIAppTestEventsRequest | UnsetType = UnsetType.unset) Iterable[CIAppTestEvent] ¶
Search tests events.
Provide a paginated version of
search_ci_app_test_events()
, returning all items.- Returns:
A generator of paginated results.
- Return type:
collections.abc.Iterable[CIAppTestEvent]
cloud_workload_security_api¶
- class CloudWorkloadSecurityApi(api_client=None)¶
Bases:
object
Workload activity security rules for generating events using the Datadog security Agent.
- create_cloud_workload_security_agent_rule(body: CloudWorkloadSecurityAgentRuleCreateRequest) CloudWorkloadSecurityAgentRuleResponse ¶
Create a Cloud Workload Security Agent rule.
Create a new Agent rule with the given parameters.
- Parameters:
body (CloudWorkloadSecurityAgentRuleCreateRequest) – The definition of the new Agent rule.
- Return type:
- 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:
- list_cloud_workload_security_agent_rules() CloudWorkloadSecurityAgentRulesListResponse ¶
Get all Cloud Workload Security Agent rules.
Get the list of Agent rules.
- Return type:
- 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:
agent_rule_id (str) – The ID of the Agent rule.
body (CloudWorkloadSecurityAgentRuleUpdateRequest) – New definition of the Agent rule.
- Return type:
cloudflare_integration_api¶
- class CloudflareIntegrationApi(api_client=None)¶
Bases:
object
Configure your Datadog Cloudflare integration directly through the Datadog API.
- create_cloudflare_account(body: CloudflareAccountCreateRequest) CloudflareAccountResponse ¶
Add Cloudflare account.
Create a Cloudflare account.
- Return type:
- 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:
- list_cloudflare_accounts() CloudflareAccountsResponse ¶
List Cloudflare accounts.
List Cloudflare accounts.
- Return type:
- update_cloudflare_account(account_id: str, body: CloudflareAccountUpdateRequest) CloudflareAccountResponse ¶
Update Cloudflare account.
Update a Cloudflare account.
- Parameters:
account_id (str) – None
- Return type:
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:
- 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:
account_id (str) – Confluent Account id.
body (ConfluentResourceRequest) – Confluent payload
- Return type:
- 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:
- 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:
- list_confluent_account() ConfluentAccountsResponse ¶
List Confluent accounts.
List Confluent accounts.
- Return type:
- 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:
- update_confluent_account(account_id: str, body: ConfluentAccountUpdateRequest) ConfluentAccountResponse ¶
Update Confluent account.
Update the Confluent account with the provided account ID.
- Parameters:
account_id (str) – Confluent Account id.
body (ConfluentAccountUpdateRequest) – Confluent payload
- Return type:
- 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:
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:
- 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:
- 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:
- 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:
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:
- 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:
- 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:
- 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:
- 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:
- 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:
- list_fastly_accounts() FastlyAccountsResponse ¶
List Fastly accounts.
List Fastly accounts.
- Return type:
- 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:
- 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:
- 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:
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:
- 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:
- 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:
- 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:
- 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:
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:
- 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:
- 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:
- 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:
service_id (str) – The ID of the incident service.
body (IncidentServiceUpdateRequest) – Incident Service Payload.
- Return type:
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:
- 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:
- 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:
- 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:
team_id (str) – The ID of the incident team.
body (IncidentTeamUpdateRequest) – Incident Team Payload.
- Return type:
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:
- create_incident_integration(incident_id: str, body: IncidentIntegrationMetadataCreateRequest) IncidentIntegrationMetadataResponse ¶
Create an incident integration metadata.
Create an incident integration metadata.
- Parameters:
incident_id (str) – The UUID of the incident.
body (IncidentIntegrationMetadataCreateRequest) – Incident integration metadata payload.
- Return type:
- create_incident_todo(incident_id: str, body: IncidentTodoCreateRequest) IncidentTodoResponse ¶
Create an incident todo.
Create an incident todo.
- Parameters:
incident_id (str) – The UUID of the incident.
body (IncidentTodoCreateRequest) – Incident todo payload.
- Return type:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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. After entering a search query in your Incidents page , use the query parameter value in the URL of the page as the value for this parameter.
The query can contain any number of incident facets joined by
ANDs
, along with multiple values for each of those facets joined byOR
s, for instance:query="state:active AND severity:(SEV-2 OR SEV-1)"
.include (IncidentRelatedObject, optional) – Specifies which types of related objects should be included in the response.
sort (IncidentSearchSortOrder, optional) – Specifies the order of returned incidents.
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:
- 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. After entering a search query in your Incidents page , use the query parameter value in the URL of the page as the value for this parameter.
The query can contain any number of incident facets joined by
ANDs
, along with multiple values for each of those facets joined byOR
s, for instance:query="state:active AND severity:(SEV-2 OR SEV-1)"
.include (IncidentRelatedObject, optional) – Specifies which types of related objects should be included in the response.
sort (IncidentSearchSortOrder, optional) – Specifies the order of returned incidents.
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:
- 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:
incident_id (str) – The UUID of the incident.
body (IncidentAttachmentUpdateRequest) – Incident Attachment Payload.
include ([IncidentAttachmentRelatedObject], optional) – Specifies which types of related objects are included in the response.
- Return type:
- 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:
- 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:
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:
- update_ip_allowlist(body: IPAllowlistUpdateRequest) IPAllowlistResponse ¶
Update IP Allowlist.
Edit the entries in the IP allowlist, and enable or disable it.
- Return type:
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:
- create_current_user_application_key(body: ApplicationKeyCreateRequest) ApplicationKeyResponse ¶
Create an application key for current user.
Create an application key for current user
- Return type:
- 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
andmodified_by
.
- Return type:
- 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:
- 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:
- list_api_keys(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: APIKeysSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset, filter_created_at_start: str | UnsetType = UnsetType.unset, filter_created_at_end: str | UnsetType = UnsetType.unset, filter_modified_at_start: str | UnsetType = UnsetType.unset, filter_modified_at_end: str | UnsetType = UnsetType.unset, include: str | UnsetType = UnsetType.unset) APIKeysResponse ¶
Get all API keys.
List all API keys available for your account.
- Parameters:
page_size (int, optional) – Size for a given page. The maximum allowed value is 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
andmodified_by
.
- Return type:
- list_application_keys(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: ApplicationKeysSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset, filter_created_at_start: str | UnsetType = UnsetType.unset, filter_created_at_end: str | UnsetType = UnsetType.unset) ListApplicationKeysResponse ¶
Get all application keys.
List all application keys available for your org
- Parameters:
page_size (int, optional) – Size for a given page. The maximum allowed value is 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:
- list_current_user_application_keys(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: ApplicationKeysSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset, filter_created_at_start: str | UnsetType = UnsetType.unset, filter_created_at_end: str | UnsetType = UnsetType.unset) ListApplicationKeysResponse ¶
Get all application keys owned by current user.
List all application keys available for current user
- Parameters:
page_size (int, optional) – Size for a given page. The maximum allowed value is 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:
- 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:
- 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:
- 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:
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:
- 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:
- list_logs_get(*, filter_query: str | UnsetType = UnsetType.unset, filter_index: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, filter_storage_tier: LogsStorageTier | UnsetType = UnsetType.unset, sort: LogsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) LogsListResponse ¶
Get a list of logs.
List endpoint returns logs that match a log search query. Results are paginated.
Use this endpoint to see your latest logs.
If you are considering archiving logs for your organization, consider use of the Datadog archive capabilities instead of the log list API. See Datadog Logs Archive documentation.
- Parameters:
filter_query (str, optional) – Search query following logs syntax.
filter_index (str, optional) – For customers with multiple indexes, the indexes to search Defaults to ‘*’ which means all indexes
filter_from (datetime, optional) – Minimum timestamp for requested logs.
filter_to (datetime, optional) – Maximum timestamp for requested logs.
filter_storage_tier (LogsStorageTier, optional) – Specifies the storage type to be used
sort (LogsSort, optional) – Order of logs in results.
page_cursor (str, optional) – List following results with a cursor provided in the previous query.
page_limit (int, optional) – Maximum number of logs in the response.
- Return type:
- list_logs_get_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_index: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, filter_storage_tier: LogsStorageTier | UnsetType = UnsetType.unset, sort: LogsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[Log] ¶
Get a list of logs.
Provide a paginated version of
list_logs_get()
, returning all items.- Parameters:
filter_query (str, optional) – Search query following logs syntax.
filter_index (str, optional) – For customers with multiple indexes, the indexes to search Defaults to ‘*’ which means all indexes
filter_from (datetime, optional) – Minimum timestamp for requested logs.
filter_to (datetime, optional) – Maximum timestamp for requested logs.
filter_storage_tier (LogsStorageTier, optional) – Specifies the storage type to be used
sort (LogsSort, optional) – Order of logs in results.
page_cursor (str, optional) – List following results with a cursor provided in the previous query.
page_limit (int, optional) – Maximum number of logs in the response.
- Returns:
A generator of paginated results.
- Return type:
collections.abc.Iterable[Log]
- list_logs_with_pagination(*, body: LogsListRequest | UnsetType = UnsetType.unset) Iterable[Log] ¶
Search logs.
Provide a paginated version of
list_logs()
, returning all items.- Returns:
A generator of paginated results.
- Return type:
collections.abc.Iterable[Log]
- submit_log(body: HTTPLog, *, content_encoding: ContentEncoding | UnsetType = UnsetType.unset, ddtags: str | UnsetType = UnsetType.unset) dict ¶
Send logs.
Send your logs to your Datadog platform over HTTP. Limits per HTTP request are:
Maximum content size per payload (uncompressed): 5MB
Maximum size for a single log: 1MB
Maximum array size if sending multiple logs in an array: 1000 entries
Any log exceeding 1MB is accepted and truncated by Datadog:
For a single log request, the API truncates the log at 1MB and returns a 2xx.
For a multi-logs request, the API processes all logs, truncates only logs larger than 1MB, and returns a 2xx.
Datadog recommends sending your logs compressed. Add the
Content-Encoding: gzip
header to the request when sending compressed logs. 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:
- 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:
- get_logs_archive_order() LogsArchiveOrder ¶
Get archive order.
Get the current order of your archives. This endpoint takes no JSON arguments.
- Return type:
- 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:
- list_logs_archives() LogsArchives ¶
Get all archives.
Get the list of configured logs archives with their definitions.
- Return type:
- 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:
archive_id (str) – The ID of the archive.
body (LogsArchiveCreateRequest) – New definition of the archive.
- Return type:
- 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:
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:
- 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:
- list_logs_metrics() LogsMetricsResponse ¶
Get all log-based metrics.
Get the list of configured log-based metrics with their definitions.
- Return type:
- 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:
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 theManage Tags for Metrics
permission.- create_bulk_tags_metrics_configuration(body: MetricBulkTagConfigCreateRequest) MetricBulkTagConfigResponse ¶
Configure tags for multiple metrics.
Create and define a list of queryable tag keys for a set of existing count, gauge, rate, and distribution metrics. Metrics are selected by passing a metric name prefix. Use the Delete method of this API path to remove tag configurations. Results can be sent to a set of account email addresses, just like the same operation in the Datadog web app. If multiple calls include the same metric, the last configuration applied (not by submit order) is used, do not expect deterministic ordering of concurrent calls. Can only be used with application keys of users with the
Manage Tags for Metrics
permission.- Return type:
- create_tag_configuration(metric_name: str, body: MetricTagConfigurationCreateRequest) MetricTagConfigurationResponse ¶
Create a tag configuration.
Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric. Optionally, include percentile aggregations on any distribution metric or configure custom aggregations on any count, rate, or gauge metric. Can only be used with application keys of users with the
Manage Tags for Metrics
permission.- Parameters:
metric_name (str) – The name of the metric.
- Return type:
- 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:
- 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
, orgauge
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:
- 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:
- 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:
- list_tag_configurations(*, filter_configured: bool | UnsetType = UnsetType.unset, filter_tags_configured: str | UnsetType = UnsetType.unset, filter_metric_type: MetricTagConfigurationMetricTypes | UnsetType = UnsetType.unset, filter_include_percentiles: bool | UnsetType = UnsetType.unset, filter_queried: bool | UnsetType = UnsetType.unset, filter_tags: str | UnsetType = UnsetType.unset, window_seconds: int | UnsetType = UnsetType.unset) MetricsAndMetricTagConfigurationsResponse ¶
Get a list of metrics.
Returns all metrics that can be configured in the Metrics Summary page or with Metrics without Limits™ (matching additional filters if specified).
- Parameters:
filter_configured (bool, optional) – Filter custom metrics that have configured tags.
filter_tags_configured (str, optional) – Filter tag configurations by configured tags.
filter_metric_type (MetricTagConfigurationMetricTypes, optional) – Filter metrics by metric type.
filter_include_percentiles (bool, optional) – Filter distributions with additional percentile aggregations enabled or disabled.
filter_queried (bool, optional) – Filter custom metrics that have or have not been queried in the specified window[seconds]. If no window is provided or the window is less than 2 hours, a default of 2 hours will be applied.
filter_tags (str, optional) – Filter metrics that have been submitted with the given tags. Supports boolean and wildcard expressions. Can only be combined with the filter[queried] filter.
window_seconds (int, optional) – The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query. Defaults value is 3600 (1 hour), maximum value is 1,209,600 (2 weeks).
- Return type:
- 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:
- 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:
- 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:
- 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:
- 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:
- update_tag_configuration(metric_name: str, body: MetricTagConfigurationUpdateRequest) MetricTagConfigurationResponse ¶
Update a tag configuration.
Update the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations of a count, rate, or gauge metric. Can only be used with application keys from users with the
Manage Tags for Metrics
permission.- Parameters:
metric_name (str) – The name of the metric.
- Return type:
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:
- 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:
- list_monitor_config_policies() MonitorConfigPolicyListResponse ¶
Get all monitor configuration policies.
Get all monitor configuration policies.
- Return type:
- update_monitor_config_policy(policy_id: str, body: MonitorConfigPolicyEditRequest) MonitorConfigPolicyResponse ¶
Edit a monitor configuration policy.
Edit a monitor configuration policy.
- Parameters:
policy_id (str) – ID of the monitor configuration policy.
body (MonitorConfigPolicyEditRequest) – Description of the update.
- Return type:
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:
- 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:
- list_opsgenie_services() OpsgenieServicesResponse ¶
Get all service objects.
Get a list of all services from the Datadog Opsgenie integration.
- Return type:
- 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:
integration_service_id (str) – The UUID of the service.
body (OpsgenieServiceUpdateRequest) – Opsgenie service payload.
- Return type:
organizations_api¶
- class OrganizationsApi(api_client=None)¶
Bases:
object
Create, edit, and manage your organizations. Read more about multi-org accounts.
- upload_idp_metadata(*, idp_file: IOBase | UnsetType = UnsetType.unset) None ¶
Upload IdP metadata.
Endpoint for uploading IdP metadata for SAML setup.
Use this endpoint to upload or replace IdP metadata for SAML login configuration.
- Parameters:
idp_file (file_type, optional) – The IdP metadata XML file
- Return type:
None
processes_api¶
- class ProcessesApi(api_client=None)¶
Bases:
object
The processes API allows you to query processes data for your organization.
- list_processes(*, search: str | UnsetType = UnsetType.unset, tags: str | UnsetType = UnsetType.unset, _from: int | UnsetType = UnsetType.unset, to: int | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset) ProcessSummariesResponse ¶
Get all processes.
Get all processes for your organization.
- Parameters:
search (str, optional) – String to search processes by.
tags (str, optional) – Comma-separated list of tags to filter processes by.
_from (int, optional) – Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window will be 15 minutes before the
to
timestamp. If neitherfrom
norto
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 neitherfrom
norto
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:
- 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 neitherfrom
norto
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 neitherfrom
norto
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). 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:
- 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:
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:
- 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:
- 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:
- create_role(body: RoleCreateRequest) RoleCreateResponse ¶
Create role.
Create a new role for your organization.
- Return type:
- 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:
- list_permissions() PermissionsResponse ¶
List permissions.
Returns a list of all permissions, including name, description, and ID.
- Return type:
- 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:
- 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:
- list_roles(*, page_size: int | UnsetType = UnsetType.unset, page_number: int | UnsetType = UnsetType.unset, sort: RolesSort | UnsetType = UnsetType.unset, filter: str | UnsetType = UnsetType.unset) RolesResponse ¶
List roles.
Returns all roles, including their names and their unique identifiers.
- Parameters:
page_size (int, optional) – Size for a given page. The maximum allowed value is 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.
- Return type:
- 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:
- 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:
- 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:
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:
- create_rum_application(body: RUMApplicationCreateRequest) RUMApplicationResponse ¶
Create a new RUM application.
Create a new RUM application in your organization.
- Return type:
- 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:
- get_rum_applications() RUMApplicationsResponse ¶
List all the RUM applications.
List all the RUM applications in your organization.
- Return type:
- 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:
- 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:
- 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:
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:
- create_security_monitoring_rule(body: SecurityMonitoringRuleCreatePayload | SecurityMonitoringStandardRuleCreatePayload | SecurityMonitoringSignalRuleCreatePayload | CloudConfigurationRuleCreatePayload) SecurityMonitoringRuleResponse ¶
Create a detection rule.
Create a detection rule.
- Return type:
- delete_security_filter(security_filter_id: str) None ¶
Delete a security filter.
Delete a specific security filter.
- Parameters:
security_filter_id (str) – The ID of the security filter.
- Return type:
None
- delete_security_monitoring_rule(rule_id: str) None ¶
Delete an existing rule.
Delete an existing rule. Default rules cannot be deleted.
- Parameters:
rule_id (str) – The ID of the rule.
- Return type:
None
- edit_security_monitoring_signal_assignee(signal_id: str, body: SecurityMonitoringSignalAssigneeUpdateRequest) SecurityMonitoringSignalTriageUpdateResponse ¶
Modify the triage assignee of a security signal.
Modify the triage assignee of a security signal.
- Parameters:
signal_id (str) – The ID of the signal.
body (SecurityMonitoringSignalAssigneeUpdateRequest) – Attributes describing the signal update.
- Return type:
- 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:
signal_id (str) – The ID of the signal.
body (SecurityMonitoringSignalIncidentsUpdateRequest) – Attributes describing the signal update.
- Return type:
- 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:
signal_id (str) – The ID of the signal.
body (SecurityMonitoringSignalStateUpdateRequest) – Attributes describing the signal update.
- Return type:
- 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:
- 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:
- 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:
- get_security_monitoring_signal(signal_id: str) SecurityMonitoringSignal ¶
Get a signal’s details.
Get a signal’s details.
- Parameters:
signal_id (str) – The ID of the signal.
- Return type:
- 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 byevaluation_changed_at
orresource_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
.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
andresource_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 tofalse
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
orfail
findings.filter_status (FindingStatus, optional) – Return only findings with the specified status.
- Return type:
- 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 tofalse
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
orfail
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:
- 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:
- 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:
- list_security_monitoring_signals_with_pagination(*, filter_query: str | UnsetType = UnsetType.unset, filter_from: datetime | UnsetType = UnsetType.unset, filter_to: datetime | UnsetType = UnsetType.unset, sort: SecurityMonitoringSignalsSort | UnsetType = UnsetType.unset, page_cursor: str | UnsetType = UnsetType.unset, page_limit: int | UnsetType = UnsetType.unset) Iterable[SecurityMonitoringSignal] ¶
Get a quick list of security signals.
Provide a paginated version of
list_security_monitoring_signals()
, returning all items.- Parameters:
filter_query (str, optional) – The search query for security signals.
filter_from (datetime, optional) – The minimum timestamp for requested security signals.
filter_to (datetime, optional) – The maximum timestamp for requested security signals.
sort (SecurityMonitoringSignalsSort, optional) – The order of the security signals in results.
page_cursor (str, optional) – A list of results using the cursor provided in the previous query.
page_limit (int, optional) – The maximum number of security signals in the response.
- Returns:
A generator of paginated results.
- Return type:
collections.abc.Iterable[SecurityMonitoringSignal]
- search_security_monitoring_signals(*, body: SecurityMonitoringSignalListRequest | UnsetType = UnsetType.unset) SecurityMonitoringSignalsListResponse ¶
Get a list of security signals.
Returns security signals that match a search query. Both this endpoint and the GET endpoint can be used interchangeably for listing security signals.
- Return type:
- 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_finding(finding_id: str, body: MuteFindingRequest) MuteFindingResponse ¶
Mute or unmute a finding.
Mute or unmute a specific finding. The API returns the updated finding object when the request is successful.
- Parameters:
finding_id (str) – The ID of the finding.
body (MuteFindingRequest) –
To mute or unmute a finding, the request body should include at least two attributes:
muted
andreason
. 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
.
- Return type:
- 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:
- update_security_monitoring_rule(rule_id: str, body: SecurityMonitoringRuleUpdatePayload) SecurityMonitoringRuleResponse ¶
Update an existing rule.
Update an existing rule. When updating
cases
,queries
oroptions
, 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:
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:
- 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:
- 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:
- 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:
- list_scanning_groups() SensitiveDataScannerGetConfigResponse ¶
List Scanning Groups.
List all the Scanning groups in your organization.
- Return type:
- list_standard_patterns() SensitiveDataScannerStandardPatternsResponseData ¶
List standard patterns.
Returns all standard patterns.
- Return type:
- reorder_scanning_groups(body: SensitiveDataScannerConfigRequest) SensitiveDataScannerReorderGroupsResponse ¶
Reorder Groups.
Reorder the list of groups.
- Return type:
- 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:
- 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:
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:
- 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:
- 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:
- 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:
- 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:
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 | 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:
- 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:
- 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:
- 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]
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:
- 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:
- list_spans_metrics() SpansMetricsResponse ¶
Get all span-based metrics.
Get the list of configured span-based metrics with their definitions.
- Return type:
- 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:
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:
- 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:
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:
- create_team_link(team_id: str, body: TeamLinkCreateRequest) TeamLinkResponse ¶
Create a team link.
Add a new link to a team.
- Parameters:
team_id (str) – None
- Return type:
- 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:
- 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
- delete_team_link(team_id: str, link_id: str) 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:
- get_team_link(team_id: str, link_id: str) TeamLinkResponse ¶
Get a team link.
Get a single link for a team.
- Parameters:
team_id (str) – None
link_id (str) – None
- Return type:
- get_team_links(team_id: str) TeamLinksResponse ¶
Get links for a team.
Get all links for a given team.
- Parameters:
team_id (str) – None
- Return type:
- 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:
- 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:
- 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) TeamsResponse ¶
Get all teams.
Get all teams. Can be used to search for teams using the
filter[keyword]
andfilter[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
- Return type:
- update_team(team_id: str, body: TeamUpdateRequest) TeamResponse ¶
Update a team.
Update a team using the team’s
id
. If theteam_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:
- update_team_link(team_id: str, link_id: str, body: TeamLinkCreateRequest) TeamLinkResponse ¶
Update a team link.
Update a team link.
- Parameters:
team_id (str) – None
link_id (str) – None
- Return type:
- 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:
- 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:
usage_metering_api¶
- class UsageMeteringApi(api_client=None)¶
Bases:
object
The usage metering API allows you to get hourly, daily, and monthly usage across multiple facets of Datadog. This API is available to all Pro and Enterprise customers. Usage is only accessible for parent-level organizations.
Note : Usage data is delayed by up to 72 hours from when it was incurred. It is retained for 15 months.
You can retrieve up to 24 hours of hourly usage data for multiple organizations, and up to two months of hourly usage data for a single organization in one request.
- get_cost_by_org(start_month: datetime, *, end_month: datetime | UnsetType = UnsetType.unset) CostByOrgResponse ¶
Get cost across multi-org account. Deprecated.
Get cost across multi-org account. Cost by org data for a given month becomes available no later than the 16th of the following month. Note: This endpoint has been deprecated. Please use the new endpoint `
/historical_cost
<https://docs.datadoghq.com/api/latest/usage-metering/#get-historical-cost-across-your-account>`_ instead.- Parameters:
start_month (datetime) – Datetime in ISO-8601 format, UTC, precise to month:
[YYYY-MM]
for cost beginning this month.end_month (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to month:
[YYYY-MM]
for cost ending this month.
- Return type:
- 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
andsub-org
. Defaults tosummary
.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 anend_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 anend_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:
- 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
andsub-org
. Defaults tosummary
.end_month (datetime, optional) – Datetime in ISO-8601 format, UTC, precise to month:
[YYYY-MM]
for cost ending this month.
- Return type:
- 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
,cspm
,custom_events
,cws
,dbm
,fargate
,infra_hosts
,incident_management
,indexed_logs
,indexed_spans
,ingested_spans
,iot
,lambda_traced_invocations
,logs
,network_flows
,network_hosts
,observability_pipelines
,online_archive
,profiling
,rum
,rum_browser_sessions
,rum_mobile_sessions
,sds
,snmp
,synthetics_api
,synthetics_browser
,synthetics_parallel_testing
, andtimeseries
. 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 version1.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:
- 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:
- 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:
- 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:
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:
- 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:
- 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:
- 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:
- 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:
- 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
, andDisabled
. Defaults to no filtering.
- Return type:
- send_invitations(body: UserInvitationsRequest) UserInvitationsResponse ¶
Send invitation emails.
Sends emails to one or more users inviting them to join the organization.