From 2079b4e78b885fec875ceac8d76520c678af1fda Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 5 Mar 2026 17:38:41 +0000 Subject: [PATCH] Regenerate client from commit b5e5ace of spec repo --- .generator/schemas/v1/openapi.yaml | 54 ++++++----- .generator/schemas/v2/openapi.yaml | 93 +++++++++++++++++-- docs/datadog_api_client.v2.model.rst | 28 ++++++ .../GetUsageAttributionTypes.py | 13 +++ .../v1/api/usage_metering_api.py | 22 +++-- .../v1/model/hourly_usage_attribution_body.py | 4 +- .../hourly_usage_attribution_usage_type.py | 4 +- .../model/monthly_usage_attribution_body.py | 1 - ...hly_usage_attribution_supported_metrics.py | 3 +- .../model/monthly_usage_attribution_values.py | 1 - src/datadog_api_client/v2/api/metrics_api.py | 6 +- .../v2/api/usage_metering_api.py | 29 ++++++ .../usage_attribution_types_attributes.py | 36 +++++++ .../v2/model/usage_attribution_types_body.py | 64 +++++++++++++ .../model/usage_attribution_types_response.py | 42 +++++++++ .../v2/model/usage_attribution_types_type.py | 35 +++++++ src/datadog_api_client/v2/models/__init__.py | 8 ++ tests/v2/features/undo.json | 6 ++ tests/v2/features/usage_metering.feature | 6 ++ 19 files changed, 405 insertions(+), 50 deletions(-) create mode 100644 examples/v2/usage-metering/GetUsageAttributionTypes.py create mode 100644 src/datadog_api_client/v2/model/usage_attribution_types_attributes.py create mode 100644 src/datadog_api_client/v2/model/usage_attribution_types_body.py create mode 100644 src/datadog_api_client/v2/model/usage_attribution_types_response.py create mode 100644 src/datadog_api_client/v2/model/usage_attribution_types_type.py diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 14469bd701..86bd8fc351 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4608,10 +4608,11 @@ components: type: array type: object HourlyUsageAttributionUsageType: - description: 'Supported products for hourly usage attribution requests. + description: 'Supported products for hourly usage attribution requests. Usage + types are in the format `_usage`. - The following values have been **deprecated**: `estimated_indexed_spans_usage`, - `estimated_ingested_spans_usage`.' + To obtain the complete list of valid usage types, make a request to the [Get + usage attribution types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' enum: - api_usage - apm_fargate_usage @@ -9161,7 +9162,11 @@ components: type: array type: object MonthlyUsageAttributionSupportedMetrics: - description: Supported metrics for monthly usage attribution requests. + description: 'Supported metrics for monthly usage attribution requests. Usage + types are in the format `_usage`. + + To obtain the complete list of valid usage types, make a request to the [Get + usage attribution types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' enum: - api_usage - api_percentage @@ -9492,10 +9497,7 @@ components: - SCA_FARGATE_PERCENTAGE - ALL MonthlyUsageAttributionValues: - description: 'Fields in Usage Summary by tag(s). - - The following values have been **deprecated**: `estimated_indexed_spans_usage`, - `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`.' + description: Fields in Usage Summary by tag(s). properties: api_percentage: description: The percentage of synthetic API test usage by tag(s). @@ -37493,10 +37495,7 @@ paths: code example:\n\n```\nresponse := GetHourlyUsageAttribution(start_month)\ncursor := response.metadata.pagination.next_record_id\nWHILE cursor != null BEGIN\n \ sleep(5 seconds) # Avoid running into rate limit\n response := GetHourlyUsageAttribution(start_month, - next_record_id=cursor)\n cursor := response.metadata.pagination.next_record_id\nEND\n```\nThe - following values have been **deprecated**:\n `estimated_indexed_spans_usage`, - `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`, - `llm_observability_usage`, `llm_observability_percentage`." + next_record_id=cursor)\n cursor := response.metadata.pagination.next_record_id\nEND\n```" operationId: GetHourlyUsageAttribution parameters: - description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` @@ -37517,9 +37516,14 @@ paths: schema: format: date-time type: string - - description: 'Usage type to retrieve. The following values have been **deprecated**: + - description: 'Usage type to retrieve. Usage types are in the format `_usage`. + + Example: `infra_host_usage` - `estimated_indexed_spans_usage`, `estimated_ingested_spans_usage`.' + To obtain the complete list of active usage types that can be used to replace + + `` in the field names, make a request to the [Get usage attribution + types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' in: query name: usage_type required: true @@ -38072,10 +38076,15 @@ paths: - description: 'Comma-separated list of usage types to return, or `*` for all usage types. - The following values have been **deprecated**: + Usage types are in the format `_usage` and `_percentage`. + + Example: `infra_host_usage,infra_host_percentage` - `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, - `estimated_ingested_spans_percentage`, `llm_observability_usage`, `llm_observability_percentage`.' + To obtain the complete list of usage attribution types that can be used + to replace + + `` in the field names, make a request to the [Get usage attribution + types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' in: query name: fields required: true @@ -38087,12 +38096,15 @@ paths: required: false schema: $ref: '#/components/schemas/UsageSortDirection' - - description: 'The field to sort by. + - description: 'The field to sort by. Sort fields are in the format `_usage`. + + Example: `infra_host_usage` - The following values have been **deprecated**: + To obtain the complete list of usage attribution types that can be used + to replace - `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, - `estimated_ingested_spans_percentage`.' + `` in the field names, make a request to the [Get usage attribution + types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' in: query name: sort_name required: false diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a9872daf02..3c804abe22 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -70690,6 +70690,42 @@ components: usage_type: $ref: '#/components/schemas/HourlyUsageType' type: object + UsageAttributionTypesAttributes: + description: List of usage attribution types. + properties: + values: + description: List of usage attribution types. + items: + description: A given usage type in a list. + example: infra_host + type: string + type: array + type: object + UsageAttributionTypesBody: + description: Usage attribution types data. + properties: + attributes: + $ref: '#/components/schemas/UsageAttributionTypesAttributes' + id: + description: Unique ID of the response. + type: string + type: + $ref: '#/components/schemas/UsageAttributionTypesType' + type: object + UsageAttributionTypesResponse: + description: Usage attribution types response. + properties: + data: + $ref: '#/components/schemas/UsageAttributionTypesBody' + type: object + UsageAttributionTypesType: + default: usage_attribution_types + description: Type of usage attribution types data. + enum: + - usage_attribution_types + type: string + x-enum-varnames: + - USAGE_ATTRIBUTION_TYPES UsageDataObject: description: Usage data. properties: @@ -91067,14 +91103,18 @@ paths: - logs_read_data /api/v2/metrics: get: - description: "Returns all metrics that can be configured in the Metrics Summary - page or with Metrics without Limits\u2122 (matching additional filters if - specified).\nOptionally, paginate by using the `page[cursor]` and/or `page[size]` - query parameters.\nTo fetch the first page, pass in a query parameter with - either a valid `page[size]` or an empty cursor like `page[cursor]=`. To fetch - the next page, pass in the `next_cursor` value from the response as the new - `page[cursor]` value.\nOnce the `meta.pagination.next_cursor` value is null, - all pages have been retrieved." + description: 'Returns all metrics for your organization that match the given + filter parameters. + + Optionally, paginate by using the `page[cursor]` and/or `page[size]` query + parameters. + + To fetch the first page, pass in a query parameter with either a valid `page[size]` + or an empty cursor like `page[cursor]=`. To fetch the next page, pass in the + `next_cursor` value from the response as the new `page[cursor]` value. + + Once the `meta.pagination.next_cursor` value is null, all pages have been + retrieved.' operationId: ListTagConfigurations parameters: - description: Filter custom metrics that have configured tags. @@ -91159,7 +91199,7 @@ paths: - description: 'The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query. - Default value is 3600 (1 hour), maximum value is 2,592,000 (30 days).' + Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days).' example: 3600 in: query name: window[seconds] @@ -109760,6 +109800,41 @@ paths: permissions: - usage_read - billing_read + /api/v2/usage/usage-attribution-types: + get: + description: Get usage attribution types. + operationId: GetUsageAttributionTypes + responses: + '200': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/UsageAttributionTypesResponse' + description: OK + '403': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden - User is not authorized + '429': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - usage_read + summary: Get usage attribution types + tags: + - Usage Metering + x-permission: + operator: OR + permissions: + - usage_read /api/v2/user_invitations: post: description: Sends emails to one or more users inviting them to join the organization. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index ffa6905cdf..e2c6c0447f 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -31077,6 +31077,34 @@ datadog\_api\_client.v2.model.usage\_attributes\_object module :members: :show-inheritance: +datadog\_api\_client.v2.model.usage\_attribution\_types\_attributes module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.usage_attribution_types_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.usage\_attribution\_types\_body module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.usage_attribution_types_body + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.usage\_attribution\_types\_response module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.usage_attribution_types_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.usage\_attribution\_types\_type module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.usage_attribution_types_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.usage\_data\_object module -------------------------------------------------------- diff --git a/examples/v2/usage-metering/GetUsageAttributionTypes.py b/examples/v2/usage-metering/GetUsageAttributionTypes.py new file mode 100644 index 0000000000..bdcf611ae5 --- /dev/null +++ b/examples/v2/usage-metering/GetUsageAttributionTypes.py @@ -0,0 +1,13 @@ +""" +Get usage attribution types returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = UsageMeteringApi(api_client) + response = api_instance.get_usage_attribution_types() + + print(response) diff --git a/src/datadog_api_client/v1/api/usage_metering_api.py b/src/datadog_api_client/v1/api/usage_metering_api.py index df3fded8ae..d5c043c634 100644 --- a/src/datadog_api_client/v1/api/usage_metering_api.py +++ b/src/datadog_api_client/v1/api/usage_metering_api.py @@ -1280,13 +1280,12 @@ def get_hourly_usage_attribution( cursor := response.metadata.pagination.next_record_id END - The following values have been **deprecated** : - ``estimated_indexed_spans_usage`` , ``estimated_indexed_spans_percentage`` , ``estimated_ingested_spans_usage`` , ``estimated_ingested_spans_percentage`` , ``llm_observability_usage`` , ``llm_observability_percentage``. - :param start_hr: Datetime in ISO-8601 format, UTC, precise to hour: ``[YYYY-MM-DDThh]`` for usage beginning at this hour. :type start_hr: datetime - :param usage_type: Usage type to retrieve. The following values have been **deprecated** : - ``estimated_indexed_spans_usage`` , ``estimated_ingested_spans_usage``. + :param usage_type: Usage type to retrieve. Usage types are in the format ``_usage``. + Example: ``infra_host_usage`` + To obtain the complete list of active usage types that can be used to replace + ```` in the field names, make a request to the `Get usage attribution types API `_. :type usage_type: HourlyUsageAttributionUsageType :param end_hr: Datetime in ISO-8601 format, UTC, precise to hour: ``[YYYY-MM-DDThh]`` for usage ending **before** this hour. @@ -1448,16 +1447,19 @@ def get_monthly_usage_attribution( Maximum of 15 months ago. :type start_month: datetime :param fields: Comma-separated list of usage types to return, or ``*`` for all usage types. - The following values have been **deprecated** : - ``estimated_indexed_spans_usage`` , ``estimated_indexed_spans_percentage`` , ``estimated_ingested_spans_usage`` , ``estimated_ingested_spans_percentage`` , ``llm_observability_usage`` , ``llm_observability_percentage``. + Usage types are in the format ``_usage`` and ``_percentage``. + Example: ``infra_host_usage,infra_host_percentage`` + To obtain the complete list of usage attribution types that can be used to replace + ```` in the field names, make a request to the `Get usage attribution types API `_. :type fields: MonthlyUsageAttributionSupportedMetrics :param end_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for usage ending this month. :type end_month: datetime, optional :param sort_direction: The direction to sort by: ``[desc, asc]``. :type sort_direction: UsageSortDirection, optional - :param sort_name: The field to sort by. - The following values have been **deprecated** : - ``estimated_indexed_spans_usage`` , ``estimated_indexed_spans_percentage`` , ``estimated_ingested_spans_usage`` , ``estimated_ingested_spans_percentage``. + :param sort_name: The field to sort by. Sort fields are in the format ``_usage``. + Example: ``infra_host_usage`` + To obtain the complete list of usage attribution types that can be used to replace + ```` in the field names, make a request to the `Get usage attribution types API `_. :type sort_name: MonthlyUsageAttributionSupportedMetrics, optional :param tag_breakdown_keys: Comma separated list of tag keys used to group usage. If no value is provided the usage will not be broken down by tags. diff --git a/src/datadog_api_client/v1/model/hourly_usage_attribution_body.py b/src/datadog_api_client/v1/model/hourly_usage_attribution_body.py index f17bea7994..04284f584b 100644 --- a/src/datadog_api_client/v1/model/hourly_usage_attribution_body.py +++ b/src/datadog_api_client/v1/model/hourly_usage_attribution_body.py @@ -94,8 +94,8 @@ def __init__( :param updated_at: Shows the most recent hour in the current month for all organizations where usages are calculated. :type updated_at: str, optional - :param usage_type: Supported products for hourly usage attribution requests. - The following values have been **deprecated** : ``estimated_indexed_spans_usage`` , ``estimated_ingested_spans_usage``. + :param usage_type: Supported products for hourly usage attribution requests. Usage types are in the format ``_usage``. + To obtain the complete list of valid usage types, make a request to the `Get usage attribution types API `_. :type usage_type: HourlyUsageAttributionUsageType, optional """ if hour is not unset: diff --git a/src/datadog_api_client/v1/model/hourly_usage_attribution_usage_type.py b/src/datadog_api_client/v1/model/hourly_usage_attribution_usage_type.py index b677750209..c235d890ce 100644 --- a/src/datadog_api_client/v1/model/hourly_usage_attribution_usage_type.py +++ b/src/datadog_api_client/v1/model/hourly_usage_attribution_usage_type.py @@ -14,8 +14,8 @@ class HourlyUsageAttributionUsageType(ModelSimple): """ - Supported products for hourly usage attribution requests. - The following values have been **deprecated**: `estimated_indexed_spans_usage`, `estimated_ingested_spans_usage`. + Supported products for hourly usage attribution requests. Usage types are in the format `_usage`. + To obtain the complete list of valid usage types, make a request to the [Get usage attribution types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types). :param value: Must be one of ["api_usage", "apm_fargate_usage", "apm_host_usage", "apm_usm_usage", "appsec_fargate_usage", "appsec_usage", "asm_serverless_traced_invocations_usage", "asm_serverless_traced_invocations_percentage", "bits_ai_investigations_usage", "browser_usage", "ci_pipeline_indexed_spans_usage", "ci_test_indexed_spans_usage", "ci_visibility_itr_usage", "cloud_siem_usage", "code_security_host_usage", "container_excl_agent_usage", "container_usage", "cspm_containers_usage", "cspm_hosts_usage", "custom_event_usage", "custom_ingested_timeseries_usage", "custom_timeseries_usage", "cws_containers_usage", "cws_fargate_task_usage", "cws_hosts_usage", "data_jobs_monitoring_usage", "data_stream_monitoring_usage", "dbm_hosts_usage", "dbm_queries_usage", "error_tracking_usage", "error_tracking_percentage", "estimated_indexed_spans_usage", "estimated_ingested_spans_usage", "fargate_usage", "flex_logs_starter", "flex_stored_logs", "functions_usage", "incident_management_monthly_active_users_usage", "indexed_spans_usage", "infra_host_usage", "ingested_logs_bytes_usage", "ingested_spans_bytes_usage", "invocations_usage", "lambda_traced_invocations_usage", "llm_observability_usage", "llm_spans_usage", "logs_indexed_15day_usage", "logs_indexed_180day_usage", "logs_indexed_1day_usage", "logs_indexed_30day_usage", "logs_indexed_360day_usage", "logs_indexed_3day_usage", "logs_indexed_45day_usage", "logs_indexed_60day_usage", "logs_indexed_7day_usage", "logs_indexed_90day_usage", "logs_indexed_custom_retention_usage", "mobile_app_testing_usage", "ndm_netflow_usage", "npm_host_usage", "network_device_wireless_usage", "obs_pipeline_bytes_usage", "obs_pipelines_vcpu_usage", "online_archive_usage", "product_analytics_session_usage", "profiled_container_usage", "profiled_fargate_usage", "profiled_host_usage", "published_app", "rum_browser_mobile_sessions_usage", "rum_ingested_usage", "rum_investigate_usage", "rum_replay_sessions_usage", "rum_session_replay_add_on_usage", "sca_fargate_usage", "sds_scanned_bytes_usage", "serverless_apps_usage", "siem_analyzed_logs_add_on_usage", "siem_ingested_bytes_usage", "snmp_usage", "universal_service_monitoring_usage", "vuln_management_hosts_usage", "workflow_executions_usage"]. :type value: str diff --git a/src/datadog_api_client/v1/model/monthly_usage_attribution_body.py b/src/datadog_api_client/v1/model/monthly_usage_attribution_body.py index fa69f895e9..bf17cf0da2 100644 --- a/src/datadog_api_client/v1/model/monthly_usage_attribution_body.py +++ b/src/datadog_api_client/v1/model/monthly_usage_attribution_body.py @@ -89,7 +89,6 @@ def __init__( :type updated_at: datetime, optional :param values: Fields in Usage Summary by tag(s). - The following values have been **deprecated** : ``estimated_indexed_spans_usage`` , ``estimated_indexed_spans_percentage`` , ``estimated_ingested_spans_usage`` , ``estimated_ingested_spans_percentage``. :type values: MonthlyUsageAttributionValues, optional """ if month is not unset: diff --git a/src/datadog_api_client/v1/model/monthly_usage_attribution_supported_metrics.py b/src/datadog_api_client/v1/model/monthly_usage_attribution_supported_metrics.py index 81c06cb090..413b578e8c 100644 --- a/src/datadog_api_client/v1/model/monthly_usage_attribution_supported_metrics.py +++ b/src/datadog_api_client/v1/model/monthly_usage_attribution_supported_metrics.py @@ -14,7 +14,8 @@ class MonthlyUsageAttributionSupportedMetrics(ModelSimple): """ - Supported metrics for monthly usage attribution requests. + Supported metrics for monthly usage attribution requests. Usage types are in the format `_usage`. + To obtain the complete list of valid usage types, make a request to the [Get usage attribution types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types). :param value: Must be one of ["api_usage", "api_percentage", "apm_fargate_usage", "apm_fargate_percentage", "appsec_fargate_usage", "appsec_fargate_percentage", "apm_host_usage", "apm_host_percentage", "apm_usm_usage", "apm_usm_percentage", "appsec_usage", "appsec_percentage", "asm_serverless_traced_invocations_usage", "asm_serverless_traced_invocations_percentage", "bits_ai_investigations_usage", "bits_ai_investigations_percentage", "browser_usage", "browser_percentage", "ci_visibility_itr_usage", "ci_visibility_itr_percentage", "cloud_siem_usage", "cloud_siem_percentage", "code_security_host_usage", "code_security_host_percentage", "container_excl_agent_usage", "container_excl_agent_percentage", "container_usage", "container_percentage", "cspm_containers_percentage", "cspm_containers_usage", "cspm_hosts_percentage", "cspm_hosts_usage", "custom_timeseries_usage", "custom_timeseries_percentage", "custom_ingested_timeseries_usage", "custom_ingested_timeseries_percentage", "cws_containers_percentage", "cws_containers_usage", "cws_fargate_task_percentage", "cws_fargate_task_usage", "cws_hosts_percentage", "cws_hosts_usage", "data_jobs_monitoring_usage", "data_jobs_monitoring_percentage", "data_stream_monitoring_usage", "data_stream_monitoring_percentage", "dbm_hosts_percentage", "dbm_hosts_usage", "dbm_queries_percentage", "dbm_queries_usage", "error_tracking_usage", "error_tracking_percentage", "estimated_indexed_spans_usage", "estimated_indexed_spans_percentage", "estimated_ingested_spans_usage", "estimated_ingested_spans_percentage", "fargate_usage", "fargate_percentage", "flex_logs_starter_usage", "flex_logs_starter_percentage", "flex_stored_logs_usage", "flex_stored_logs_percentage", "functions_usage", "functions_percentage", "incident_management_monthly_active_users_usage", "incident_management_monthly_active_users_percentage", "infra_host_usage", "infra_host_percentage", "invocations_usage", "invocations_percentage", "lambda_traced_invocations_usage", "lambda_traced_invocations_percentage", "llm_observability_usage", "llm_observability_percentage", "llm_spans_usage", "llm_spans_percentage", "mobile_app_testing_percentage", "mobile_app_testing_usage", "ndm_netflow_usage", "ndm_netflow_percentage", "network_device_wireless_usage", "network_device_wireless_percentage", "npm_host_usage", "npm_host_percentage", "obs_pipeline_bytes_usage", "obs_pipeline_bytes_percentage", "obs_pipelines_vcpu_usage", "obs_pipelines_vcpu_percentage", "online_archive_usage", "online_archive_percentage", "product_analytics_session_usage", "product_analytics_session_percentage", "profiled_container_usage", "profiled_container_percentage", "profiled_fargate_usage", "profiled_fargate_percentage", "profiled_host_usage", "profiled_host_percentage", "published_app_usage", "published_app_percentage", "serverless_apps_usage", "serverless_apps_percentage", "snmp_usage", "snmp_percentage", "universal_service_monitoring_usage", "universal_service_monitoring_percentage", "vuln_management_hosts_usage", "vuln_management_hosts_percentage", "sds_scanned_bytes_usage", "sds_scanned_bytes_percentage", "ci_test_indexed_spans_usage", "ci_test_indexed_spans_percentage", "ingested_logs_bytes_usage", "ingested_logs_bytes_percentage", "ci_pipeline_indexed_spans_usage", "ci_pipeline_indexed_spans_percentage", "indexed_spans_usage", "indexed_spans_percentage", "custom_event_usage", "custom_event_percentage", "logs_indexed_custom_retention_usage", "logs_indexed_custom_retention_percentage", "logs_indexed_360day_usage", "logs_indexed_360day_percentage", "logs_indexed_180day_usage", "logs_indexed_180day_percentage", "logs_indexed_90day_usage", "logs_indexed_90day_percentage", "logs_indexed_60day_usage", "logs_indexed_60day_percentage", "logs_indexed_45day_usage", "logs_indexed_45day_percentage", "logs_indexed_30day_usage", "logs_indexed_30day_percentage", "logs_indexed_15day_usage", "logs_indexed_15day_percentage", "logs_indexed_7day_usage", "logs_indexed_7day_percentage", "logs_indexed_3day_usage", "logs_indexed_3day_percentage", "logs_indexed_1day_usage", "logs_indexed_1day_percentage", "rum_ingested_usage", "rum_ingested_percentage", "rum_investigate_usage", "rum_investigate_percentage", "rum_replay_sessions_usage", "rum_replay_sessions_percentage", "rum_session_replay_add_on_usage", "rum_session_replay_add_on_percentage", "rum_browser_mobile_sessions_usage", "rum_browser_mobile_sessions_percentage", "ingested_spans_bytes_usage", "ingested_spans_bytes_percentage", "siem_analyzed_logs_add_on_usage", "siem_analyzed_logs_add_on_percentage", "siem_ingested_bytes_usage", "siem_ingested_bytes_percentage", "workflow_executions_usage", "workflow_executions_percentage", "sca_fargate_usage", "sca_fargate_percentage", "*"]. :type value: str diff --git a/src/datadog_api_client/v1/model/monthly_usage_attribution_values.py b/src/datadog_api_client/v1/model/monthly_usage_attribution_values.py index cf65ce5fb6..bd010033c8 100644 --- a/src/datadog_api_client/v1/model/monthly_usage_attribution_values.py +++ b/src/datadog_api_client/v1/model/monthly_usage_attribution_values.py @@ -508,7 +508,6 @@ def __init__( ): """ Fields in Usage Summary by tag(s). - The following values have been **deprecated** : ``estimated_indexed_spans_usage`` , ``estimated_indexed_spans_percentage`` , ``estimated_ingested_spans_usage`` , ``estimated_ingested_spans_percentage``. :param api_percentage: The percentage of synthetic API test usage by tag(s). :type api_percentage: float, optional diff --git a/src/datadog_api_client/v2/api/metrics_api.py b/src/datadog_api_client/v2/api/metrics_api.py index 9f357c1e4b..95d7e0b53c 100644 --- a/src/datadog_api_client/v2/api/metrics_api.py +++ b/src/datadog_api_client/v2/api/metrics_api.py @@ -788,7 +788,7 @@ def list_tag_configurations( ) -> 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). + Returns all metrics for your organization that match the given filter parameters. Optionally, paginate by using the ``page[cursor]`` and/or ``page[size]`` query parameters. To fetch the first page, pass in a query parameter with either a valid ``page[size]`` or an empty cursor like ``page[cursor]=``. To fetch the next page, pass in the ``next_cursor`` value from the response as the new ``page[cursor]`` value. Once the ``meta.pagination.next_cursor`` value is null, all pages have been retrieved. @@ -817,7 +817,7 @@ def list_tag_configurations( :param filter_related_assets: (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs. :type filter_related_assets: bool, optional :param window_seconds: The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query. - Default value is 3600 (1 hour), maximum value is 2,592,000 (30 days). + Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days). :type window_seconds: int, optional :param page_size: Maximum number of results returned. :type page_size: int, optional @@ -906,7 +906,7 @@ def list_tag_configurations_with_pagination( :param filter_related_assets: (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs. :type filter_related_assets: bool, optional :param window_seconds: The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query. - Default value is 3600 (1 hour), maximum value is 2,592,000 (30 days). + Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days). :type window_seconds: int, optional :param page_size: Maximum number of results returned. :type page_size: int, optional diff --git a/src/datadog_api_client/v2/api/usage_metering_api.py b/src/datadog_api_client/v2/api/usage_metering_api.py index f3db12dca4..098e2ef701 100644 --- a/src/datadog_api_client/v2/api/usage_metering_api.py +++ b/src/datadog_api_client/v2/api/usage_metering_api.py @@ -25,6 +25,7 @@ from datadog_api_client.v2.model.usage_lambda_traced_invocations_response import UsageLambdaTracedInvocationsResponse from datadog_api_client.v2.model.usage_observability_pipelines_response import UsageObservabilityPipelinesResponse from datadog_api_client.v2.model.projected_cost_response import ProjectedCostResponse +from datadog_api_client.v2.model.usage_attribution_types_response import UsageAttributionTypesResponse class UsageMeteringApi: @@ -384,6 +385,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_usage_attribution_types_endpoint = _Endpoint( + settings={ + "response_type": (UsageAttributionTypesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/usage/usage-attribution-types", + "operation_id": "get_usage_attribution_types", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json;datetime-format=rfc3339"], + }, + api_client=api_client, + ) + self._get_usage_lambda_traced_invocations_endpoint = _Endpoint( settings={ "response_type": (UsageLambdaTracedInvocationsResponse,), @@ -814,6 +831,18 @@ def get_usage_application_security_monitoring( warnings.warn("get_usage_application_security_monitoring is deprecated", DeprecationWarning, stacklevel=2) return self._get_usage_application_security_monitoring_endpoint.call_with_http_info(**kwargs) + def get_usage_attribution_types( + self, + ) -> UsageAttributionTypesResponse: + """Get usage attribution types. + + Get usage attribution types. + + :rtype: UsageAttributionTypesResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_usage_attribution_types_endpoint.call_with_http_info(**kwargs) + def get_usage_lambda_traced_invocations( self, start_hr: datetime, diff --git a/src/datadog_api_client/v2/model/usage_attribution_types_attributes.py b/src/datadog_api_client/v2/model/usage_attribution_types_attributes.py new file mode 100644 index 0000000000..51000a83e8 --- /dev/null +++ b/src/datadog_api_client/v2/model/usage_attribution_types_attributes.py @@ -0,0 +1,36 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class UsageAttributionTypesAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "values": ([str],), + } + + attribute_map = { + "values": "values", + } + + def __init__(self_, values: Union[List[str], UnsetType] = unset, **kwargs): + """ + List of usage attribution types. + + :param values: List of usage attribution types. + :type values: [str], optional + """ + if values is not unset: + kwargs["values"] = values + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/usage_attribution_types_body.py b/src/datadog_api_client/v2/model/usage_attribution_types_body.py new file mode 100644 index 0000000000..f73e7de6a5 --- /dev/null +++ b/src/datadog_api_client/v2/model/usage_attribution_types_body.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.usage_attribution_types_attributes import UsageAttributionTypesAttributes + from datadog_api_client.v2.model.usage_attribution_types_type import UsageAttributionTypesType + + +class UsageAttributionTypesBody(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.usage_attribution_types_attributes import UsageAttributionTypesAttributes + from datadog_api_client.v2.model.usage_attribution_types_type import UsageAttributionTypesType + + return { + "attributes": (UsageAttributionTypesAttributes,), + "id": (str,), + "type": (UsageAttributionTypesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[UsageAttributionTypesAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[UsageAttributionTypesType, UnsetType] = unset, + **kwargs, + ): + """ + Usage attribution types data. + + :param attributes: List of usage attribution types. + :type attributes: UsageAttributionTypesAttributes, optional + + :param id: Unique ID of the response. + :type id: str, optional + + :param type: Type of usage attribution types data. + :type type: UsageAttributionTypesType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/usage_attribution_types_response.py b/src/datadog_api_client/v2/model/usage_attribution_types_response.py new file mode 100644 index 0000000000..b11e4e3ae7 --- /dev/null +++ b/src/datadog_api_client/v2/model/usage_attribution_types_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.usage_attribution_types_body import UsageAttributionTypesBody + + +class UsageAttributionTypesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.usage_attribution_types_body import UsageAttributionTypesBody + + return { + "data": (UsageAttributionTypesBody,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[UsageAttributionTypesBody, UnsetType] = unset, **kwargs): + """ + Usage attribution types response. + + :param data: Usage attribution types data. + :type data: UsageAttributionTypesBody, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/usage_attribution_types_type.py b/src/datadog_api_client/v2/model/usage_attribution_types_type.py new file mode 100644 index 0000000000..06ebaab81d --- /dev/null +++ b/src/datadog_api_client/v2/model/usage_attribution_types_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UsageAttributionTypesType(ModelSimple): + """ + Type of usage attribution types data. + + :param value: If omitted defaults to "usage_attribution_types". Must be one of ["usage_attribution_types"]. + :type value: str + """ + + allowed_values = { + "usage_attribution_types", + } + USAGE_ATTRIBUTION_TYPES: ClassVar["UsageAttributionTypesType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UsageAttributionTypesType.USAGE_ATTRIBUTION_TYPES = UsageAttributionTypesType("usage_attribution_types") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 01343a9576..6b9a7bec23 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -6302,6 +6302,10 @@ UsageApplicationSecurityMonitoringResponse, ) from datadog_api_client.v2.model.usage_attributes_object import UsageAttributesObject +from datadog_api_client.v2.model.usage_attribution_types_attributes import UsageAttributionTypesAttributes +from datadog_api_client.v2.model.usage_attribution_types_body import UsageAttributionTypesBody +from datadog_api_client.v2.model.usage_attribution_types_response import UsageAttributionTypesResponse +from datadog_api_client.v2.model.usage_attribution_types_type import UsageAttributionTypesType from datadog_api_client.v2.model.usage_data_object import UsageDataObject from datadog_api_client.v2.model.usage_lambda_traced_invocations_response import UsageLambdaTracedInvocationsResponse from datadog_api_client.v2.model.usage_observability_pipelines_response import UsageObservabilityPipelinesResponse @@ -10882,6 +10886,10 @@ "UrlParamUpdate", "UsageApplicationSecurityMonitoringResponse", "UsageAttributesObject", + "UsageAttributionTypesAttributes", + "UsageAttributionTypesBody", + "UsageAttributionTypesResponse", + "UsageAttributionTypesType", "UsageDataObject", "UsageLambdaTracedInvocationsResponse", "UsageObservabilityPipelinesResponse", diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index ffa1a5844a..3dc80275cf 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -6104,6 +6104,12 @@ "type": "safe" } }, + "GetUsageAttributionTypes": { + "tag": "Usage Metering", + "undo": { + "type": "safe" + } + }, "SendInvitations": { "tag": "Users", "undo": { diff --git a/tests/v2/features/usage_metering.feature b/tests/v2/features/usage_metering.feature index 715f443eee..d953a11c08 100644 --- a/tests/v2/features/usage_metering.feature +++ b/tests/v2/features/usage_metering.feature @@ -197,6 +197,12 @@ Feature: Usage Metering When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/revenue-query + Scenario: Get usage attribution types returns "OK" response + Given new "GetUsageAttributionTypes" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/revenue-query Scenario: GetEstimatedCostByOrg with both start_month and start_date returns "Bad Request" response Given new "GetEstimatedCostByOrg" request