diff --git a/.apigentools-info b/.apigentools-info index 5e7523582de..4b7316c2c1d 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2022-01-11 14:01:20.740441", - "spec_repo_commit": "0468fdc" + "regenerated": "2022-01-11 16:18:48.666159", + "spec_repo_commit": "cc7ebbe" }, "v2": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2022-01-11 14:01:20.772245", - "spec_repo_commit": "0468fdc" + "regenerated": "2022-01-11 16:18:48.699271", + "spec_repo_commit": "cc7ebbe" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 91a40ed7367..62f8cd7cae3 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -6465,6 +6465,239 @@ components: type: $ref: '#/components/schemas/MonitorType' type: object + MonthlyUsageAttributionBody: + description: Usage Summary by tag for a given organization. + properties: + month: + description: 'Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM].' + format: date-time + type: string + org_name: + description: The name of the organization. + type: string + public_id: + description: The organization public ID. + type: string + tag_config_source: + description: The source of the usage attribution tag configuration and the + selected tags in the format `://////`. + type: string + tags: + $ref: '#/components/schemas/UsageAttributionTagNames' + updated_at: + description: Datetime of the most recent update to the usage values. + format: date-time + type: string + values: + $ref: '#/components/schemas/MonthlyUsageAttributionValues' + type: object + MonthlyUsageAttributionMetadata: + description: The object containing document metadata. + properties: + aggregates: + $ref: '#/components/schemas/UsageAttributionAggregates' + pagination: + $ref: '#/components/schemas/MonthlyUsageAttributionPagination' + type: object + MonthlyUsageAttributionPagination: + description: The metadata for the current pagination. + properties: + next_record_id: + description: The cursor to use to get the next results, if any. To make + the next request, use the same parameters with the addition of the `next_record_id`. + type: string + type: object + MonthlyUsageAttributionResponse: + description: Response containing the monthly Usage Summary by tag(s). + properties: + metadata: + $ref: '#/components/schemas/MonthlyUsageAttributionMetadata' + usage: + description: Get Usage Summary by tag(s). + items: + $ref: '#/components/schemas/MonthlyUsageAttributionBody' + type: array + type: object + MonthlyUsageAttributionSupportedMetrics: + description: Supported metrics for monthly usage attribution requests. + enum: + - api_usage + - api_percentage + - apm_host_usage + - apm_host_percentage + - browser_usage + - browser_percentage + - container_usage + - container_percentage + - custom_timeseries_usage + - custom_timeseries_percentage + - fargate_usage + - fargate_percentage + - functions_usage + - functions_percentage + - indexed_logs_usage + - indexed_logs_percentage + - infra_host_usage + - infra_host_percentage + - invocations_usage + - invocations_percentage + - npm_host_usage + - npm_host_percentage + - profiled_container_usage + - profiled_container_percentage + - profiled_host_usage + - profiled_host_percentage + - snmp_usage + - snmp_percentage + - '*' + type: string + x-enum-varnames: + - API_USAGE + - API_PERCENTAGE + - APM_HOST_USAGE + - APM_HOST_PERCENTAGE + - BROWSER_USAGE + - BROWSER_PERCENTAGE + - CONTAINER_USAGE + - CONTAINER_PERCENTAGE + - CUSTOM_TIMESERIES_USAGE + - CUSTOM_TIMESERIES_PERCENTAGE + - FARGATE_USAGE + - FARGATE_PERCENTAGE + - FUNCTIONS_USAGE + - FUNCTIONS_PERCENTAGE + - INDEXED_LOGS_USAGE + - INDEXED_LOGS_PERCENTAGE + - INFRA_HOST_USAGE + - INFRA_HOST_PERCENTAGE + - INVOCATIONS_USAGE + - INVOCATIONS_PERCENTAGE + - NPM_HOST_USAGE + - NPM_HOST_PERCENTAGE + - PROFILED_CONTAINER_USAGE + - PROFILED_CONTAINER_PERCENTAGE + - PROFILED_HOST_USAGE + - PROFILED_HOST_PERCENTAGE + - SNMP_USAGE + - SNMP_PERCENTAGE + - ALL + MonthlyUsageAttributionValues: + description: Fields in Usage Summary by tag(s). + properties: + api_percentage: + description: The percentage of synthetic API test usage by tag(s). + format: double + type: number + api_usage: + description: The synthetic API test usage by tag(s). + format: double + type: number + apm_host_percentage: + description: The percentage of APM host usage by tag(s). + format: double + type: number + apm_host_usage: + description: The APM host usage by tag(s). + format: double + type: number + browser_percentage: + description: The percentage of synthetic browser test usage by tag(s). + format: double + type: number + browser_usage: + description: The synthetic browser test usage by tag(s). + format: double + type: number + container_percentage: + description: The percentage of container usage by tag(s). + format: double + type: number + container_usage: + description: The container usage by tag(s). + format: double + type: number + custom_timeseries_percentage: + description: The percentage of custom metrics usage by tag(s). + format: double + type: number + custom_timeseries_usage: + description: The custom metrics usage by tag(s). + format: double + type: number + fargate_percentage: + description: The percentage of Fargate usage by tags. + format: double + type: number + fargate_usage: + description: The Fargate usage by tags. + format: double + type: number + functions_percentage: + description: The percentage of Lambda function usage by tag(s). + format: double + type: number + functions_usage: + description: The Lambda function usage by tag(s). + format: double + type: number + indexed_logs_percentage: + description: The percentage of indexed logs usage by tags. + format: double + type: number + indexed_logs_usage: + description: The indexed logs usage by tags. + format: double + type: number + infra_host_percentage: + description: The percentage of infrastructure host usage by tag(s). + format: double + type: number + infra_host_usage: + description: The infrastructure host usage by tag(s). + format: double + type: number + invocations_percentage: + description: The percentage of Lambda invocation usage by tag(s). + format: double + type: number + invocations_usage: + description: The Lambda invocation usage by tag(s). + format: double + type: number + npm_host_percentage: + description: The percentage of network host usage by tag(s). + format: double + type: number + npm_host_usage: + description: The network host usage by tag(s). + format: double + type: number + profiled_container_percentage: + description: The percentage of profiled container usage by tag(s). + format: double + type: number + profiled_container_usage: + description: The profiled container usage by tag(s). + format: double + type: number + profiled_host_percentage: + description: The percentage of profiled hosts usage by tag(s). + format: double + type: number + profiled_host_usage: + description: The profiled hosts usage by tag(s). + format: double + type: number + snmp_percentage: + description: The percentage of network device usage by tag(s). + format: double + type: number + snmp_usage: + description: The network device usage by tag(s). + format: double + type: number + type: object NoteWidgetDefinition: description: The notes and links widget is similar to free text widget, but allows for more formatting options. @@ -16088,7 +16321,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests summary: Get the list of available daily custom reports tags: - Usage Metering @@ -16129,7 +16366,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Not Found '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests summary: Get specified daily custom reports tags: - Usage Metering @@ -21088,7 +21329,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests summary: Get the list of available monthly custom reports tags: - Usage Metering @@ -21135,7 +21380,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Not Found '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests summary: Get specified monthly custom reports tags: - Usage Metering @@ -24347,7 +24596,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -24422,7 +24675,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -24480,11 +24737,15 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests summary: Get hourly usage for audit logs tags: - Usage Metering - x-menu-order: 32 + x-menu-order: 33 x-undo: type: safe /api/v1/usage/aws_lambda: @@ -24528,7 +24789,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -24573,7 +24838,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -24628,11 +24897,15 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests summary: Get hourly usage for CSPM tags: - Usage Metering - x-menu-order: 31 + x-menu-order: 32 x-undo: type: safe /api/v1/usage/cws: @@ -24678,7 +24951,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -24687,7 +24964,7 @@ paths: summary: Get hourly usage for Cloud Workload Security tags: - Usage Metering - x-menu-order: 33 + x-menu-order: 34 x-undo: type: safe /api/v1/usage/dbm: @@ -24733,11 +25010,15 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests summary: Get hourly usage for Database Monitoring tags: - Usage Metering - x-menu-order: 34 + x-menu-order: 35 x-undo: type: safe /api/v1/usage/fargate: @@ -24781,7 +25062,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -24834,7 +25119,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -24903,7 +25192,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -24961,7 +25254,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25014,7 +25311,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25069,7 +25370,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25124,7 +25429,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25177,7 +25486,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25232,7 +25545,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests summary: Get hourly logs usage by retention tags: - Usage Metering @@ -25287,7 +25604,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25299,6 +25620,95 @@ paths: x-menu-order: 3 x-undo: type: safe + /api/v1/usage/monthly-attribution: + get: + description: Get Monthly Usage Attribution. + operationId: GetMonthlyUsageAttribution + parameters: + - description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` + for usage beginning in this month. + + Maximum of 15 months ago.' + in: query + name: start_month + required: true + schema: + format: date-time + type: string + - description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` + for usage ending this month.' + in: query + name: end_month + required: false + schema: + format: date-time + type: string + - description: Comma-separated list of usage types to return, or `*` for all + usage types. + in: query + name: fields + required: true + schema: + $ref: '#/components/schemas/MonthlyUsageAttributionSupportedMetrics' + - description: 'The direction to sort by: `[desc, asc]`.' + in: query + name: sort_direction + required: false + schema: + $ref: '#/components/schemas/UsageSortDirection' + - description: The field to sort by. + in: query + name: sort_name + required: false + schema: + $ref: '#/components/schemas/MonthlyUsageAttributionSupportedMetrics' + - description: Comma separated list of tags used to group usage. If no value + is provided the usage will not be broken down by tags. + in: query + name: tag_breakdown_keys + required: false + schema: + type: string + - description: List following results with a next_record_id provided in the + previous query. + in: query + name: next_record_id + required: false + schema: + type: string + responses: + '200': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/MonthlyUsageAttributionResponse' + 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 Monthly Usage Attribution + tags: + - Usage Metering + x-menu-order: 31 + x-undo: + type: safe + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v1/usage/network_flows: get: description: Get hourly usage for network flows. @@ -25342,7 +25752,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25395,7 +25809,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25450,7 +25868,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25504,7 +25926,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25513,7 +25939,7 @@ paths: summary: Get hourly usage for RUM Units tags: - Usage Metering - x-menu-order: 36 + x-menu-order: 37 x-undo: type: safe /api/v1/usage/rum_sessions: @@ -25564,7 +25990,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25619,11 +26049,15 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests summary: Get hourly usage for Sensitive Data Scanner tags: - Usage Metering - x-menu-order: 35 + x-menu-order: 36 x-undo: type: safe /api/v1/usage/snmp: @@ -25669,7 +26103,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25731,7 +26169,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25785,7 +26227,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25838,7 +26284,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25891,7 +26341,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -25944,7 +26398,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] @@ -26026,7 +26484,11 @@ paths: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden - User is not authorized '429': - $ref: '#/components/responses/TooManyRequestsResponse' + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests security: - apiKeyAuth: [] appKeyAuth: [] diff --git a/cassettes/v1/Usage-Metering_938753175/Get-Hourly-Usage-Attribution-returns-OK-response_2500460008/frozen.json b/cassettes/v1/Usage-Metering_938753175/Get-Hourly-Usage-Attribution-returns-OK-response_2500460008/frozen.json index 1b3f4121433..3910ec001b5 100644 --- a/cassettes/v1/Usage-Metering_938753175/Get-Hourly-Usage-Attribution-returns-OK-response_2500460008/frozen.json +++ b/cassettes/v1/Usage-Metering_938753175/Get-Hourly-Usage-Attribution-returns-OK-response_2500460008/frozen.json @@ -1 +1 @@ -"2022-01-06T00:51:20.232Z" +"2022-01-11T15:25:15.014Z" diff --git a/cassettes/v1/Usage-Metering_938753175/Get-Hourly-Usage-Attribution-returns-OK-response_2500460008/recording.har b/cassettes/v1/Usage-Metering_938753175/Get-Hourly-Usage-Attribution-returns-OK-response_2500460008/recording.har index 1f5c4799700..5a1eadbc902 100644 --- a/cassettes/v1/Usage-Metering_938753175/Get-Hourly-Usage-Attribution-returns-OK-response_2500460008/recording.har +++ b/cassettes/v1/Usage-Metering_938753175/Get-Hourly-Usage-Attribution-returns-OK-response_2500460008/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "d680705c6ab614d3c9466f7aa6d8db2d", + "_id": "07e863ecbe9a115fe1d72baed8adcd7d", "_order": 0, "cache": {}, "request": { @@ -27,21 +27,21 @@ "queryString": [ { "name": "start_hr", - "value": "2022-01-03T00:51:20.232Z" + "value": "2022-01-08T15:25:15.014Z" }, { "name": "usage_type", "value": "infra_host_usage" } ], - "url": "https://api.datadoghq.com/api/v1/usage/hourly-attribution?start_hr=2022-01-03T00%3A51%3A20.232Z&usage_type=infra_host_usage" + "url": "https://api.datadoghq.com/api/v1/usage/hourly-attribution?start_hr=2022-01-08T15%3A25%3A15.014Z&usage_type=infra_host_usage" }, "response": { - "bodySize": 6469, + "bodySize": 2464, "content": { "mimeType": "application/json", - "size": 6469, - "text": "{\"usage\":[{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T00:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T15\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T01:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T15\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T02:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T15\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T03:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T15\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T04:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T16\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T05:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T16\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T06:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T16\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T07:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T16\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T08:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T23\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T09:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T23\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T10:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T23\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T11:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-03T23\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T12:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T01\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T13:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T01\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T14:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T01\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T15:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T01\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T16:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T05\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T17:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T05\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T18:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T05\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T19:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T05\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T20:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T10\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T21:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T10\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T22:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T10\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-03T23:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-04T10\",\"usage_type\":\"infra_host_usage\"}],\"metadata\":{\"pagination\":{\"next_record_id\":null}}}" + "size": 2464, + "text": "{\"usage\":[{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-08T15:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-09T04\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-08T16:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-09T10\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-08T17:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-09T10\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-08T18:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-09T10\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-08T19:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-09T10\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-08T20:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-09T16\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-08T21:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-09T16\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-08T22:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-09T16\",\"usage_type\":\"infra_host_usage\"},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"hour\":\"2022-01-08T23:00:00+00:00\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"total_usage_sum\":17,\"updated_at\":\"2022-01-09T16\",\"usage_type\":\"infra_host_usage\"}],\"metadata\":{\"pagination\":{\"next_record_id\":null}}}" }, "cookies": [], "headers": [ @@ -56,8 +56,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:51:20.236Z", - "time": 333 + "startedDateTime": "2022-01-11T15:25:15.038Z", + "time": 374 } ], "pages": [], diff --git a/cassettes/v1/Usage-Metering_938753175/Get-Monthly-Usage-Attribution-returns-OK-response_2297145442/frozen.json b/cassettes/v1/Usage-Metering_938753175/Get-Monthly-Usage-Attribution-returns-OK-response_2297145442/frozen.json new file mode 100644 index 00000000000..f49b194d864 --- /dev/null +++ b/cassettes/v1/Usage-Metering_938753175/Get-Monthly-Usage-Attribution-returns-OK-response_2297145442/frozen.json @@ -0,0 +1 @@ +"2022-01-11T16:02:34.958Z" diff --git a/cassettes/v1/Usage-Metering_938753175/Get-Monthly-Usage-Attribution-returns-OK-response_2297145442/recording.har b/cassettes/v1/Usage-Metering_938753175/Get-Monthly-Usage-Attribution-returns-OK-response_2297145442/recording.har new file mode 100644 index 00000000000..9c0ca606813 --- /dev/null +++ b/cassettes/v1/Usage-Metering_938753175/Get-Monthly-Usage-Attribution-returns-OK-response_2297145442/recording.har @@ -0,0 +1,66 @@ +{ + "log": { + "_recordingName": "Usage Metering/Get Monthly Usage Attribution returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.1.1" + }, + "entries": [ + { + "_id": "120f11a486470e0e5665be9b1ea080bf", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json;datetime-format=rfc3339" + } + ], + "headersSize": 537, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "start_month", + "value": "2022-01-08T16:02:34.958Z" + }, + { + "name": "fields", + "value": "infra_host_usage" + } + ], + "url": "https://api.datadoghq.com/api/v1/usage/monthly-attribution?start_month=2022-01-08T16%3A02%3A34.958Z&fields=infra_host_usage" + }, + "response": { + "bodySize": 390, + "content": { + "mimeType": "application/json", + "size": 390, + "text": "{\"usage\":[{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":null,\"updated_at\":\"2022-01-11T14:35:29Z\",\"month\":\"2022-01-01T00:00:00+00:00\",\"values\":{\"infra_host_usage\":18}}],\"metadata\":{\"pagination\":{\"next_record_id\":null},\"aggregates\":[{\"field\":\"infra_host_usage\",\"value\":18.0,\"agg_type\":\"sum\"}]}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-01-11T16:02:34.983Z", + "time": 240 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/docs/v1/UsageMeteringApi.md b/docs/v1/UsageMeteringApi.md index 98e18690a37..35c4ace4aad 100644 --- a/docs/v1/UsageMeteringApi.md +++ b/docs/v1/UsageMeteringApi.md @@ -9,6 +9,7 @@ All URIs are relative to *https://api.datadoghq.com* | [**getIncidentManagement**](UsageMeteringApi.md#getIncidentManagement) | **GET** /api/v1/usage/incident-management | Get hourly usage for incident management | | [**getIngestedSpans**](UsageMeteringApi.md#getIngestedSpans) | **GET** /api/v1/usage/ingested-spans | Get hourly usage for ingested spans | | [**getMonthlyCustomReports**](UsageMeteringApi.md#getMonthlyCustomReports) | **GET** /api/v1/monthly_custom_reports | Get the list of available monthly custom reports | +| [**getMonthlyUsageAttribution**](UsageMeteringApi.md#getMonthlyUsageAttribution) | **GET** /api/v1/usage/monthly-attribution | Get Monthly Usage Attribution | | [**getSpecifiedDailyCustomReports**](UsageMeteringApi.md#getSpecifiedDailyCustomReports) | **GET** /api/v1/daily_custom_reports/{report_id} | Get specified daily custom reports | | [**getSpecifiedMonthlyCustomReports**](UsageMeteringApi.md#getSpecifiedMonthlyCustomReports) | **GET** /api/v1/monthly_custom_reports/{report_id} | Get specified monthly custom reports | | [**getUsageAnalyzedLogs**](UsageMeteringApi.md#getUsageAnalyzedLogs) | **GET** /api/v1/usage/analyzed_logs | Get hourly usage for analyzed logs | @@ -96,7 +97,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -167,7 +168,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -229,7 +230,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -292,7 +293,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -361,7 +362,84 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ---------------------------------- | ---------------- | +| **200** | OK | - | +| **403** | Forbidden - User is not authorized | - | +| **429** | Too many requests | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +## **getMonthlyUsageAttribution** + +> MonthlyUsageAttributionResponse getMonthlyUsageAttribution() + +Get Monthly Usage Attribution. + +### Example + +```typescript +import { v1 } from "@datadog/datadog-api-client"; +import * as fs from "fs"; + +const configuration = v1.createConfiguration(); +const apiInstance = new v1.UsageMeteringApi(configuration); + +let params: v1.UsageMeteringApiGetMonthlyUsageAttributionRequest = { + // Date | Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month. Maximum of 15 months ago. + startMonth: new Date("1970-01-01T00:00:00.00Z"), + // MonthlyUsageAttributionSupportedMetrics | Comma-separated list of usage types to return, or `*` for all usage types. + fields: "api_usage", + // Date | Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. (optional) + endMonth: new Date("1970-01-01T00:00:00.00Z"), + // UsageSortDirection | The direction to sort by: `[desc, asc]`. (optional) + sortDirection: "desc", + // MonthlyUsageAttributionSupportedMetrics | The field to sort by. (optional) + sortName: "api_usage", + // string | Comma separated list of tags used to group usage. If no value is provided the usage will not be broken down by tags. (optional) + tagBreakdownKeys: "tag_breakdown_keys_example", + // string | List following results with a next_record_id provided in the previous query. (optional) + nextRecordId: "next_record_id_example", +}; + +apiInstance + .getMonthlyUsageAttribution(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | +| **startMonth** | [**Date**] | Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month. Maximum of 15 months ago. | defaults to undefined | +| **fields** | **MonthlyUsageAttributionSupportedMetrics** | Comma-separated list of usage types to return, or `\*` for all usage types. | defaults to undefined | +| **endMonth** | [**Date**] | Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. | (optional) defaults to undefined | +| **sortDirection** | **UsageSortDirection** | The direction to sort by: `[desc, asc]`. | (optional) defaults to undefined | +| **sortName** | **MonthlyUsageAttributionSupportedMetrics** | The field to sort by. | (optional) defaults to undefined | +| **tagBreakdownKeys** | [**string**] | Comma separated list of tags used to group usage. If no value is provided the usage will not be broken down by tags. | (optional) defaults to undefined | +| **nextRecordId** | [**string**] | List following results with a next_record_id provided in the previous query. | (optional) defaults to undefined | + +### Return type + +**MonthlyUsageAttributionResponse** + +### Authorization + +[AuthZ](README.md#AuthZ), [apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -420,7 +498,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -480,7 +558,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -544,7 +622,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -619,7 +697,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -681,7 +759,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -741,7 +819,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -804,7 +882,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -867,7 +945,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -930,7 +1008,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -993,7 +1071,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1056,7 +1134,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1119,7 +1197,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1182,7 +1260,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1245,7 +1323,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1308,7 +1386,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1374,7 +1452,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1437,7 +1515,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1500,7 +1578,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1563,7 +1641,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1626,7 +1704,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1692,7 +1770,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1755,7 +1833,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1818,7 +1896,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1881,7 +1959,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -1947,7 +2025,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -2010,7 +2088,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -2073,7 +2151,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -2136,7 +2214,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -2199,7 +2277,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details @@ -2271,7 +2349,7 @@ apiInstance ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json;datetime-format=rfc3339, application/json +- **Accept**: application/json;datetime-format=rfc3339 ### HTTP response details diff --git a/examples/v1/usage-metering/GetMonthlyUsageAttribution.ts b/examples/v1/usage-metering/GetMonthlyUsageAttribution.ts new file mode 100644 index 00000000000..e1161200a0a --- /dev/null +++ b/examples/v1/usage-metering/GetMonthlyUsageAttribution.ts @@ -0,0 +1,23 @@ +/** + * Get Monthly Usage Attribution returns "OK" response + */ + +import { v1 } from "@datadog/datadog-api-client"; + +const configuration = v1.createConfiguration(); +configuration.unstableOperations["getMonthlyUsageAttribution"] = true; +const apiInstance = new v1.UsageMeteringApi(configuration); + +let params: v1.UsageMeteringApiGetMonthlyUsageAttributionRequest = { + startMonth: new Date(new Date().getTime() / 1000 + -3 * 86400), + fields: "infra_host_usage", +}; + +apiInstance + .getMonthlyUsageAttribution(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v1/undo.json b/features/v1/undo.json index 9db6aacbddb..6422231f86a 100644 --- a/features/v1/undo.json +++ b/features/v1/undo.json @@ -1272,6 +1272,12 @@ "type": "safe" } }, + "GetMonthlyUsageAttribution": { + "tag": "Usage Metering", + "undo": { + "type": "safe" + } + }, "GetUsageNetworkFlows": { "tag": "Usage Metering", "undo": { diff --git a/features/v1/usage_metering.feature b/features/v1/usage_metering.feature index f7ed361a2b4..a00986c132b 100644 --- a/features/v1/usage_metering.feature +++ b/features/v1/usage_metering.feature @@ -32,6 +32,24 @@ Feature: Usage Metering When the request is sent Then the response status is 200 OK + @skip @team:DataDog/red-zone-revenue-query + Scenario: Get Monthly Usage Attribution returns "Bad Request" response + Given operation "GetMonthlyUsageAttribution" enabled + And new "GetMonthlyUsageAttribution" request + And request contains "start_month" parameter with value "{{ timeISO('now - 3d') }}" + And request contains "fields" parameter with value "not_a_product" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/red-zone-revenue-query + Scenario: Get Monthly Usage Attribution returns "OK" response + Given operation "GetMonthlyUsageAttribution" enabled + And new "GetMonthlyUsageAttribution" request + And request contains "start_month" parameter with value "{{ timeISO('now - 3d') }}" + And request contains "fields" parameter with value "infra_host_usage" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/red-zone-revenue-query Scenario: Get Usage Attribution returns "OK" response Given operation "GetUsageAttribution" enabled diff --git a/packages/datadog-api-client-v1/.openapi-generator/FILES b/packages/datadog-api-client-v1/.openapi-generator/FILES index 81769456fa5..4ccb7f43c48 100644 --- a/packages/datadog-api-client-v1/.openapi-generator/FILES +++ b/packages/datadog-api-client-v1/.openapi-generator/FILES @@ -329,6 +329,12 @@ models/MonitorThresholdWindowOptions.ts models/MonitorThresholds.ts models/MonitorType.ts models/MonitorUpdateRequest.ts +models/MonthlyUsageAttributionBody.ts +models/MonthlyUsageAttributionMetadata.ts +models/MonthlyUsageAttributionPagination.ts +models/MonthlyUsageAttributionResponse.ts +models/MonthlyUsageAttributionSupportedMetrics.ts +models/MonthlyUsageAttributionValues.ts models/NoteWidgetDefinition.ts models/NoteWidgetDefinitionType.ts models/NotebookAbsoluteTime.ts diff --git a/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts b/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts index 06f7405a7cf..c3d6406bbee 100644 --- a/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts +++ b/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts @@ -10,6 +10,8 @@ import { isCodeInRange } from "../util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { HourlyUsageAttributionResponse } from "../models/HourlyUsageAttributionResponse"; import { HourlyUsageAttributionUsageType } from "../models/HourlyUsageAttributionUsageType"; +import { MonthlyUsageAttributionResponse } from "../models/MonthlyUsageAttributionResponse"; +import { MonthlyUsageAttributionSupportedMetrics } from "../models/MonthlyUsageAttributionSupportedMetrics"; import { UsageAnalyzedLogsResponse } from "../models/UsageAnalyzedLogsResponse"; import { UsageAttributionResponse } from "../models/UsageAttributionResponse"; import { UsageAttributionSort } from "../models/UsageAttributionSort"; @@ -85,7 +87,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -181,7 +182,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -272,7 +272,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -341,7 +340,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -414,7 +412,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -458,6 +455,136 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + /** + * Get Monthly Usage Attribution. + * Get Monthly Usage Attribution + * @param startMonth Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month. Maximum of 15 months ago. + * @param fields Comma-separated list of usage types to return, or `*` for all usage types. + * @param endMonth Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. + * @param sortDirection The direction to sort by: `[desc, asc]`. + * @param sortName The field to sort by. + * @param tagBreakdownKeys Comma separated list of tags used to group usage. If no value is provided the usage will not be broken down by tags. + * @param nextRecordId List following results with a next_record_id provided in the previous query. + */ + public async getMonthlyUsageAttribution( + startMonth: Date, + fields: MonthlyUsageAttributionSupportedMetrics, + endMonth?: Date, + sortDirection?: UsageSortDirection, + sortName?: MonthlyUsageAttributionSupportedMetrics, + tagBreakdownKeys?: string, + nextRecordId?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getMonthlyUsageAttribution'"); + if (!_config.unstableOperations["getMonthlyUsageAttribution"]) { + throw new Error( + "Unstable operation 'getMonthlyUsageAttribution' is disabled" + ); + } + + // verify required parameter 'startMonth' is not null or undefined + if (startMonth === null || startMonth === undefined) { + throw new RequiredError( + "Required parameter startMonth was null or undefined when calling getMonthlyUsageAttribution." + ); + } + + // verify required parameter 'fields' is not null or undefined + if (fields === null || fields === undefined) { + throw new RequiredError( + "Required parameter fields was null or undefined when calling getMonthlyUsageAttribution." + ); + } + + // Path Params + const localVarPath = "/api/v1/usage/monthly-attribution"; + + // Make Request Context + const requestContext = getServer( + _config, + "UsageMeteringApi.getMonthlyUsageAttribution" + ).makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam( + "Accept", + "application/json;datetime-format=rfc3339" + ); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (startMonth !== undefined) { + requestContext.setQueryParam( + "start_month", + ObjectSerializer.serialize(startMonth, "Date", "date-time") + ); + } + if (endMonth !== undefined) { + requestContext.setQueryParam( + "end_month", + ObjectSerializer.serialize(endMonth, "Date", "date-time") + ); + } + if (fields !== undefined) { + requestContext.setQueryParam( + "fields", + ObjectSerializer.serialize( + fields, + "MonthlyUsageAttributionSupportedMetrics", + "" + ) + ); + } + if (sortDirection !== undefined) { + requestContext.setQueryParam( + "sort_direction", + ObjectSerializer.serialize(sortDirection, "UsageSortDirection", "") + ); + } + if (sortName !== undefined) { + requestContext.setQueryParam( + "sort_name", + ObjectSerializer.serialize( + sortName, + "MonthlyUsageAttributionSupportedMetrics", + "" + ) + ); + } + if (tagBreakdownKeys !== undefined) { + requestContext.setQueryParam( + "tag_breakdown_keys", + ObjectSerializer.serialize(tagBreakdownKeys, "string", "") + ); + } + if (nextRecordId !== undefined) { + requestContext.setQueryParam( + "next_record_id", + ObjectSerializer.serialize(nextRecordId, "string", "") + ); + } + + let authMethod = null; + // Apply auth methods + authMethod = _config.authMethods["AuthZ"]; + if (authMethod) { + await authMethod.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["apiKeyAuth"]; + if (authMethod) { + await authMethod.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["appKeyAuth"]; + if (authMethod) { + await authMethod.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + /** * Get specified daily custom reports. * Get specified daily custom reports @@ -498,7 +625,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); let authMethod = null; @@ -556,7 +682,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); let authMethod = null; @@ -606,7 +731,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -695,7 +819,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -792,7 +915,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -847,7 +969,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -910,7 +1031,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -979,7 +1099,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1043,7 +1162,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1107,7 +1225,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1176,7 +1293,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1245,7 +1361,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1314,7 +1429,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1383,7 +1497,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1452,7 +1565,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1523,7 +1635,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1598,7 +1709,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1662,7 +1772,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1731,7 +1840,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1800,7 +1908,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1871,7 +1978,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -1946,7 +2052,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -2015,7 +2120,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -2079,7 +2183,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -2150,7 +2253,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -2225,7 +2327,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -2294,7 +2395,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -2363,7 +2463,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -2432,7 +2531,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -2500,7 +2598,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { "Accept", "application/json;datetime-format=rfc3339" ); - requestContext.setHttpConfig(_config.httpConfig); // Query Params @@ -2850,6 +2947,63 @@ export class UsageMeteringApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getMonthlyUsageAttribution + * @throws ApiException if the response code was not in [200, 299] + */ + public async getMonthlyUsageAttribution( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: MonthlyUsageAttributionResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonthlyUsageAttributionResponse", + "" + ) as MonthlyUsageAttributionResponse; + return body; + } + if (isCodeInRange("403", response.httpStatusCode)) { + const body: APIErrorResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "APIErrorResponse", + "" + ) as APIErrorResponse; + throw new ApiException(403, body); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const body: APIErrorResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "APIErrorResponse", + "" + ) as APIErrorResponse; + throw new ApiException(429, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: MonthlyUsageAttributionResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonthlyUsageAttributionResponse", + "" + ) as MonthlyUsageAttributionResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects diff --git a/packages/datadog-api-client-v1/configuration.ts b/packages/datadog-api-client-v1/configuration.ts index abc52e6728e..0291ce8f196 100644 --- a/packages/datadog-api-client-v1/configuration.ts +++ b/packages/datadog-api-client-v1/configuration.ts @@ -124,6 +124,7 @@ export function createConfiguration( getDailyCustomReports: false, getHourlyUsageAttribution: false, getMonthlyCustomReports: false, + getMonthlyUsageAttribution: false, getSpecifiedDailyCustomReports: false, getSpecifiedMonthlyCustomReports: false, getUsageAttribution: false, diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 424a7d1e1db..f4049861700 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -182,6 +182,7 @@ export { UsageMeteringApiGetIncidentManagementRequest, UsageMeteringApiGetIngestedSpansRequest, UsageMeteringApiGetMonthlyCustomReportsRequest, + UsageMeteringApiGetMonthlyUsageAttributionRequest, UsageMeteringApiGetSpecifiedDailyCustomReportsRequest, UsageMeteringApiGetSpecifiedMonthlyCustomReportsRequest, UsageMeteringApiGetUsageAnalyzedLogsRequest, diff --git a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionBody.ts b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionBody.ts new file mode 100644 index 00000000000..fed554f01b6 --- /dev/null +++ b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionBody.ts @@ -0,0 +1,85 @@ +/** + * 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 2020-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MonthlyUsageAttributionValues } from "./MonthlyUsageAttributionValues"; +import { AttributeTypeMap } from "./ObjectSerializer"; + +/** + * Usage Summary by tag for a given organization. + */ + +export class MonthlyUsageAttributionBody { + /** + * Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM]. + */ + "month"?: Date; + /** + * The name of the organization. + */ + "orgName"?: string; + /** + * The organization public ID. + */ + "publicId"?: string; + /** + * The source of the usage attribution tag configuration and the selected tags in the format `://////`. + */ + "tagConfigSource"?: string; + /** + * Usage Summary by tag name. + */ + "tags"?: { [key: string]: Array }; + /** + * Datetime of the most recent update to the usage values. + */ + "updatedAt"?: Date; + "values"?: MonthlyUsageAttributionValues; + + "unparsedObject"?: any; + + static readonly attributeTypeMap: AttributeTypeMap = { + month: { + baseName: "month", + type: "Date", + format: "date-time", + }, + orgName: { + baseName: "org_name", + type: "string", + }, + publicId: { + baseName: "public_id", + type: "string", + }, + tagConfigSource: { + baseName: "tag_config_source", + type: "string", + }, + tags: { + baseName: "tags", + type: "{ [key: string]: Array; }", + }, + updatedAt: { + baseName: "updated_at", + type: "Date", + format: "date-time", + }, + values: { + baseName: "values", + type: "MonthlyUsageAttributionValues", + }, + }; + + static getAttributeTypeMap(): AttributeTypeMap { + return MonthlyUsageAttributionBody.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionMetadata.ts b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionMetadata.ts new file mode 100644 index 00000000000..340506df123 --- /dev/null +++ b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionMetadata.ts @@ -0,0 +1,44 @@ +/** + * 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 2020-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MonthlyUsageAttributionPagination } from "./MonthlyUsageAttributionPagination"; +import { UsageAttributionAggregatesBody } from "./UsageAttributionAggregatesBody"; +import { AttributeTypeMap } from "./ObjectSerializer"; + +/** + * The object containing document metadata. + */ + +export class MonthlyUsageAttributionMetadata { + /** + * An array of available aggregates. + */ + "aggregates"?: Array; + "pagination"?: MonthlyUsageAttributionPagination; + + "unparsedObject"?: any; + + static readonly attributeTypeMap: AttributeTypeMap = { + aggregates: { + baseName: "aggregates", + type: "Array", + }, + pagination: { + baseName: "pagination", + type: "MonthlyUsageAttributionPagination", + }, + }; + + static getAttributeTypeMap(): AttributeTypeMap { + return MonthlyUsageAttributionMetadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionPagination.ts b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionPagination.ts new file mode 100644 index 00000000000..816b7a8346c --- /dev/null +++ b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionPagination.ts @@ -0,0 +1,37 @@ +/** + * 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 2020-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AttributeTypeMap } from "./ObjectSerializer"; + +/** + * The metadata for the current pagination. + */ + +export class MonthlyUsageAttributionPagination { + /** + * The cursor to use to get the next results, if any. To make the next request, use the same parameters with the addition of the `next_record_id`. + */ + "nextRecordId"?: string; + + "unparsedObject"?: any; + + static readonly attributeTypeMap: AttributeTypeMap = { + nextRecordId: { + baseName: "next_record_id", + type: "string", + }, + }; + + static getAttributeTypeMap(): AttributeTypeMap { + return MonthlyUsageAttributionPagination.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionResponse.ts b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionResponse.ts new file mode 100644 index 00000000000..d0a40d3ae1c --- /dev/null +++ b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionResponse.ts @@ -0,0 +1,44 @@ +/** + * 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 2020-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MonthlyUsageAttributionBody } from "./MonthlyUsageAttributionBody"; +import { MonthlyUsageAttributionMetadata } from "./MonthlyUsageAttributionMetadata"; +import { AttributeTypeMap } from "./ObjectSerializer"; + +/** + * Response containing the monthly Usage Summary by tag(s). + */ + +export class MonthlyUsageAttributionResponse { + "metadata"?: MonthlyUsageAttributionMetadata; + /** + * Get Usage Summary by tag(s). + */ + "usage"?: Array; + + "unparsedObject"?: any; + + static readonly attributeTypeMap: AttributeTypeMap = { + metadata: { + baseName: "metadata", + type: "MonthlyUsageAttributionMetadata", + }, + usage: { + baseName: "usage", + type: "Array", + }, + }; + + static getAttributeTypeMap(): AttributeTypeMap { + return MonthlyUsageAttributionResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionSupportedMetrics.ts b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionSupportedMetrics.ts new file mode 100644 index 00000000000..0bda1322f22 --- /dev/null +++ b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionSupportedMetrics.ts @@ -0,0 +1,69 @@ +/** + * 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 2020-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export type MonthlyUsageAttributionSupportedMetrics = + | typeof API_USAGE + | typeof API_PERCENTAGE + | typeof APM_HOST_USAGE + | typeof APM_HOST_PERCENTAGE + | typeof BROWSER_USAGE + | typeof BROWSER_PERCENTAGE + | typeof CONTAINER_USAGE + | typeof CONTAINER_PERCENTAGE + | typeof CUSTOM_TIMESERIES_USAGE + | typeof CUSTOM_TIMESERIES_PERCENTAGE + | typeof FARGATE_USAGE + | typeof FARGATE_PERCENTAGE + | typeof FUNCTIONS_USAGE + | typeof FUNCTIONS_PERCENTAGE + | typeof INDEXED_LOGS_USAGE + | typeof INDEXED_LOGS_PERCENTAGE + | typeof INFRA_HOST_USAGE + | typeof INFRA_HOST_PERCENTAGE + | typeof INVOCATIONS_USAGE + | typeof INVOCATIONS_PERCENTAGE + | typeof NPM_HOST_USAGE + | typeof NPM_HOST_PERCENTAGE + | typeof PROFILED_CONTAINER_USAGE + | typeof PROFILED_CONTAINER_PERCENTAGE + | typeof PROFILED_HOST_USAGE + | typeof PROFILED_HOST_PERCENTAGE + | typeof SNMP_USAGE + | typeof SNMP_PERCENTAGE + | typeof ALL; +export const API_USAGE = "api_usage"; +export const API_PERCENTAGE = "api_percentage"; +export const APM_HOST_USAGE = "apm_host_usage"; +export const APM_HOST_PERCENTAGE = "apm_host_percentage"; +export const BROWSER_USAGE = "browser_usage"; +export const BROWSER_PERCENTAGE = "browser_percentage"; +export const CONTAINER_USAGE = "container_usage"; +export const CONTAINER_PERCENTAGE = "container_percentage"; +export const CUSTOM_TIMESERIES_USAGE = "custom_timeseries_usage"; +export const CUSTOM_TIMESERIES_PERCENTAGE = "custom_timeseries_percentage"; +export const FARGATE_USAGE = "fargate_usage"; +export const FARGATE_PERCENTAGE = "fargate_percentage"; +export const FUNCTIONS_USAGE = "functions_usage"; +export const FUNCTIONS_PERCENTAGE = "functions_percentage"; +export const INDEXED_LOGS_USAGE = "indexed_logs_usage"; +export const INDEXED_LOGS_PERCENTAGE = "indexed_logs_percentage"; +export const INFRA_HOST_USAGE = "infra_host_usage"; +export const INFRA_HOST_PERCENTAGE = "infra_host_percentage"; +export const INVOCATIONS_USAGE = "invocations_usage"; +export const INVOCATIONS_PERCENTAGE = "invocations_percentage"; +export const NPM_HOST_USAGE = "npm_host_usage"; +export const NPM_HOST_PERCENTAGE = "npm_host_percentage"; +export const PROFILED_CONTAINER_USAGE = "profiled_container_usage"; +export const PROFILED_CONTAINER_PERCENTAGE = "profiled_container_percentage"; +export const PROFILED_HOST_USAGE = "profiled_host_usage"; +export const PROFILED_HOST_PERCENTAGE = "profiled_host_percentage"; +export const SNMP_USAGE = "snmp_usage"; +export const SNMP_PERCENTAGE = "snmp_percentage"; +export const ALL = "*"; diff --git a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionValues.ts b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionValues.ts new file mode 100644 index 00000000000..3336355d683 --- /dev/null +++ b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionValues.ts @@ -0,0 +1,281 @@ +/** + * 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 2020-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AttributeTypeMap } from "./ObjectSerializer"; + +/** + * Fields in Usage Summary by tag(s). + */ + +export class MonthlyUsageAttributionValues { + /** + * The percentage of synthetic API test usage by tag(s). + */ + "apiPercentage"?: number; + /** + * The synthetic API test usage by tag(s). + */ + "apiUsage"?: number; + /** + * The percentage of APM host usage by tag(s). + */ + "apmHostPercentage"?: number; + /** + * The APM host usage by tag(s). + */ + "apmHostUsage"?: number; + /** + * The percentage of synthetic browser test usage by tag(s). + */ + "browserPercentage"?: number; + /** + * The synthetic browser test usage by tag(s). + */ + "browserUsage"?: number; + /** + * The percentage of container usage by tag(s). + */ + "containerPercentage"?: number; + /** + * The container usage by tag(s). + */ + "containerUsage"?: number; + /** + * The percentage of custom metrics usage by tag(s). + */ + "customTimeseriesPercentage"?: number; + /** + * The custom metrics usage by tag(s). + */ + "customTimeseriesUsage"?: number; + /** + * The percentage of Fargate usage by tags. + */ + "fargatePercentage"?: number; + /** + * The Fargate usage by tags. + */ + "fargateUsage"?: number; + /** + * The percentage of Lambda function usage by tag(s). + */ + "functionsPercentage"?: number; + /** + * The Lambda function usage by tag(s). + */ + "functionsUsage"?: number; + /** + * The percentage of indexed logs usage by tags. + */ + "indexedLogsPercentage"?: number; + /** + * The indexed logs usage by tags. + */ + "indexedLogsUsage"?: number; + /** + * The percentage of infrastructure host usage by tag(s). + */ + "infraHostPercentage"?: number; + /** + * The infrastructure host usage by tag(s). + */ + "infraHostUsage"?: number; + /** + * The percentage of Lambda invocation usage by tag(s). + */ + "invocationsPercentage"?: number; + /** + * The Lambda invocation usage by tag(s). + */ + "invocationsUsage"?: number; + /** + * The percentage of network host usage by tag(s). + */ + "npmHostPercentage"?: number; + /** + * The network host usage by tag(s). + */ + "npmHostUsage"?: number; + /** + * The percentage of profiled container usage by tag(s). + */ + "profiledContainerPercentage"?: number; + /** + * The profiled container usage by tag(s). + */ + "profiledContainerUsage"?: number; + /** + * The percentage of profiled hosts usage by tag(s). + */ + "profiledHostPercentage"?: number; + /** + * The profiled hosts usage by tag(s). + */ + "profiledHostUsage"?: number; + /** + * The percentage of network device usage by tag(s). + */ + "snmpPercentage"?: number; + /** + * The network device usage by tag(s). + */ + "snmpUsage"?: number; + + "unparsedObject"?: any; + + static readonly attributeTypeMap: AttributeTypeMap = { + apiPercentage: { + baseName: "api_percentage", + type: "number", + format: "double", + }, + apiUsage: { + baseName: "api_usage", + type: "number", + format: "double", + }, + apmHostPercentage: { + baseName: "apm_host_percentage", + type: "number", + format: "double", + }, + apmHostUsage: { + baseName: "apm_host_usage", + type: "number", + format: "double", + }, + browserPercentage: { + baseName: "browser_percentage", + type: "number", + format: "double", + }, + browserUsage: { + baseName: "browser_usage", + type: "number", + format: "double", + }, + containerPercentage: { + baseName: "container_percentage", + type: "number", + format: "double", + }, + containerUsage: { + baseName: "container_usage", + type: "number", + format: "double", + }, + customTimeseriesPercentage: { + baseName: "custom_timeseries_percentage", + type: "number", + format: "double", + }, + customTimeseriesUsage: { + baseName: "custom_timeseries_usage", + type: "number", + format: "double", + }, + fargatePercentage: { + baseName: "fargate_percentage", + type: "number", + format: "double", + }, + fargateUsage: { + baseName: "fargate_usage", + type: "number", + format: "double", + }, + functionsPercentage: { + baseName: "functions_percentage", + type: "number", + format: "double", + }, + functionsUsage: { + baseName: "functions_usage", + type: "number", + format: "double", + }, + indexedLogsPercentage: { + baseName: "indexed_logs_percentage", + type: "number", + format: "double", + }, + indexedLogsUsage: { + baseName: "indexed_logs_usage", + type: "number", + format: "double", + }, + infraHostPercentage: { + baseName: "infra_host_percentage", + type: "number", + format: "double", + }, + infraHostUsage: { + baseName: "infra_host_usage", + type: "number", + format: "double", + }, + invocationsPercentage: { + baseName: "invocations_percentage", + type: "number", + format: "double", + }, + invocationsUsage: { + baseName: "invocations_usage", + type: "number", + format: "double", + }, + npmHostPercentage: { + baseName: "npm_host_percentage", + type: "number", + format: "double", + }, + npmHostUsage: { + baseName: "npm_host_usage", + type: "number", + format: "double", + }, + profiledContainerPercentage: { + baseName: "profiled_container_percentage", + type: "number", + format: "double", + }, + profiledContainerUsage: { + baseName: "profiled_container_usage", + type: "number", + format: "double", + }, + profiledHostPercentage: { + baseName: "profiled_host_percentage", + type: "number", + format: "double", + }, + profiledHostUsage: { + baseName: "profiled_host_usage", + type: "number", + format: "double", + }, + snmpPercentage: { + baseName: "snmp_percentage", + type: "number", + format: "double", + }, + snmpUsage: { + baseName: "snmp_usage", + type: "number", + format: "double", + }, + }; + + static getAttributeTypeMap(): AttributeTypeMap { + return MonthlyUsageAttributionValues.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index f7d75f58392..f7130268ab1 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -193,6 +193,11 @@ import { MonitorSummaryWidgetDefinition } from "./MonitorSummaryWidgetDefinition import { MonitorThresholdWindowOptions } from "./MonitorThresholdWindowOptions"; import { MonitorThresholds } from "./MonitorThresholds"; import { MonitorUpdateRequest } from "./MonitorUpdateRequest"; +import { MonthlyUsageAttributionBody } from "./MonthlyUsageAttributionBody"; +import { MonthlyUsageAttributionMetadata } from "./MonthlyUsageAttributionMetadata"; +import { MonthlyUsageAttributionPagination } from "./MonthlyUsageAttributionPagination"; +import { MonthlyUsageAttributionResponse } from "./MonthlyUsageAttributionResponse"; +import { MonthlyUsageAttributionValues } from "./MonthlyUsageAttributionValues"; import { NoteWidgetDefinition } from "./NoteWidgetDefinition"; import { NotebookAbsoluteTime } from "./NotebookAbsoluteTime"; import { NotebookAuthor } from "./NotebookAuthor"; @@ -679,6 +684,37 @@ const enumsMap: { [key: string]: any[] } = { "audit alert", "ci-pipelines alert", ], + MonthlyUsageAttributionSupportedMetrics: [ + "api_usage", + "api_percentage", + "apm_host_usage", + "apm_host_percentage", + "browser_usage", + "browser_percentage", + "container_usage", + "container_percentage", + "custom_timeseries_usage", + "custom_timeseries_percentage", + "fargate_usage", + "fargate_percentage", + "functions_usage", + "functions_percentage", + "indexed_logs_usage", + "indexed_logs_percentage", + "infra_host_usage", + "infra_host_percentage", + "invocations_usage", + "invocations_percentage", + "npm_host_usage", + "npm_host_percentage", + "profiled_container_usage", + "profiled_container_percentage", + "profiled_host_usage", + "profiled_host_percentage", + "snmp_usage", + "snmp_percentage", + "*", + ], NoteWidgetDefinitionType: ["note"], NotebookCellResourceType: ["notebook_cells"], NotebookGraphSize: ["xs", "s", "m", "l", "xl"], @@ -1241,6 +1277,11 @@ const typeMap: { [index: string]: any } = { MonitorThresholdWindowOptions: MonitorThresholdWindowOptions, MonitorThresholds: MonitorThresholds, MonitorUpdateRequest: MonitorUpdateRequest, + MonthlyUsageAttributionBody: MonthlyUsageAttributionBody, + MonthlyUsageAttributionMetadata: MonthlyUsageAttributionMetadata, + MonthlyUsageAttributionPagination: MonthlyUsageAttributionPagination, + MonthlyUsageAttributionResponse: MonthlyUsageAttributionResponse, + MonthlyUsageAttributionValues: MonthlyUsageAttributionValues, NoteWidgetDefinition: NoteWidgetDefinition, NotebookAbsoluteTime: NotebookAbsoluteTime, NotebookAuthor: NotebookAuthor, diff --git a/packages/datadog-api-client-v1/types/ObjectParamAPI.ts b/packages/datadog-api-client-v1/types/ObjectParamAPI.ts index 70de6d16508..977122841a0 100644 --- a/packages/datadog-api-client-v1/types/ObjectParamAPI.ts +++ b/packages/datadog-api-client-v1/types/ObjectParamAPI.ts @@ -72,6 +72,8 @@ import { Monitor } from "../models/Monitor"; import { MonitorGroupSearchResponse } from "../models/MonitorGroupSearchResponse"; import { MonitorSearchResponse } from "../models/MonitorSearchResponse"; import { MonitorUpdateRequest } from "../models/MonitorUpdateRequest"; +import { MonthlyUsageAttributionResponse } from "../models/MonthlyUsageAttributionResponse"; +import { MonthlyUsageAttributionSupportedMetrics } from "../models/MonthlyUsageAttributionSupportedMetrics"; import { NotebookCreateRequest } from "../models/NotebookCreateRequest"; import { NotebookResponse } from "../models/NotebookResponse"; import { NotebookUpdateRequest } from "../models/NotebookUpdateRequest"; @@ -4899,6 +4901,51 @@ export interface UsageMeteringApiGetMonthlyCustomReportsRequest { sort?: UsageSort; } +export interface UsageMeteringApiGetMonthlyUsageAttributionRequest { + /** + * Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month. Maximum of 15 months ago. + * @type Date + * @memberof UsageMeteringApigetMonthlyUsageAttribution + */ + startMonth: Date; + /** + * Comma-separated list of usage types to return, or `*` for all usage types. + * @type MonthlyUsageAttributionSupportedMetrics + * @memberof UsageMeteringApigetMonthlyUsageAttribution + */ + fields: MonthlyUsageAttributionSupportedMetrics; + /** + * Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. + * @type Date + * @memberof UsageMeteringApigetMonthlyUsageAttribution + */ + endMonth?: Date; + /** + * The direction to sort by: `[desc, asc]`. + * @type UsageSortDirection + * @memberof UsageMeteringApigetMonthlyUsageAttribution + */ + sortDirection?: UsageSortDirection; + /** + * The field to sort by. + * @type MonthlyUsageAttributionSupportedMetrics + * @memberof UsageMeteringApigetMonthlyUsageAttribution + */ + sortName?: MonthlyUsageAttributionSupportedMetrics; + /** + * Comma separated list of tags used to group usage. If no value is provided the usage will not be broken down by tags. + * @type string + * @memberof UsageMeteringApigetMonthlyUsageAttribution + */ + tagBreakdownKeys?: string; + /** + * List following results with a next_record_id provided in the previous query. + * @type string + * @memberof UsageMeteringApigetMonthlyUsageAttribution + */ + nextRecordId?: string; +} + export interface UsageMeteringApiGetSpecifiedDailyCustomReportsRequest { /** * Date of the report in the format `YYYY-MM-DD`. @@ -5495,6 +5542,29 @@ export class ObjectUsageMeteringApi { .toPromise(); } + /** + * Get Monthly Usage Attribution. + * Get Monthly Usage Attribution + * @param param the request object + */ + public getMonthlyUsageAttribution( + param: UsageMeteringApiGetMonthlyUsageAttributionRequest, + options?: Configuration + ): Promise { + return this.api + .getMonthlyUsageAttribution( + param.startMonth, + param.fields, + param.endMonth, + param.sortDirection, + param.sortName, + param.tagBreakdownKeys, + param.nextRecordId, + options + ) + .toPromise(); + } + /** * Get specified daily custom reports. * Get specified daily custom reports diff --git a/packages/datadog-api-client-v1/types/ObservableAPI.ts b/packages/datadog-api-client-v1/types/ObservableAPI.ts index 3bd41b53189..9a15a3f1c70 100644 --- a/packages/datadog-api-client-v1/types/ObservableAPI.ts +++ b/packages/datadog-api-client-v1/types/ObservableAPI.ts @@ -73,6 +73,8 @@ import { Monitor } from "../models/Monitor"; import { MonitorGroupSearchResponse } from "../models/MonitorGroupSearchResponse"; import { MonitorSearchResponse } from "../models/MonitorSearchResponse"; import { MonitorUpdateRequest } from "../models/MonitorUpdateRequest"; +import { MonthlyUsageAttributionResponse } from "../models/MonthlyUsageAttributionResponse"; +import { MonthlyUsageAttributionSupportedMetrics } from "../models/MonthlyUsageAttributionSupportedMetrics"; import { NotebookCreateRequest } from "../models/NotebookCreateRequest"; import { NotebookResponse } from "../models/NotebookResponse"; import { NotebookUpdateRequest } from "../models/NotebookUpdateRequest"; @@ -7962,6 +7964,67 @@ export class ObservableUsageMeteringApi { }) ); } + /** + * Get Monthly Usage Attribution. + * Get Monthly Usage Attribution + * @param startMonth Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month. Maximum of 15 months ago. + * @param fields Comma-separated list of usage types to return, or `*` for all usage types. + * @param endMonth Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. + * @param sortDirection The direction to sort by: `[desc, asc]`. + * @param sortName The field to sort by. + * @param tagBreakdownKeys Comma separated list of tags used to group usage. If no value is provided the usage will not be broken down by tags. + * @param nextRecordId List following results with a next_record_id provided in the previous query. + */ + public getMonthlyUsageAttribution( + startMonth: Date, + fields: MonthlyUsageAttributionSupportedMetrics, + endMonth?: Date, + sortDirection?: UsageSortDirection, + sortName?: MonthlyUsageAttributionSupportedMetrics, + tagBreakdownKeys?: string, + nextRecordId?: string, + _options?: Configuration + ): Observable { + const requestContextPromise = + this.requestFactory.getMonthlyUsageAttribution( + startMonth, + fields, + endMonth, + sortDirection, + sortName, + tagBreakdownKeys, + nextRecordId, + _options + ); + + // build promise chain + let middlewarePreObservable = from_(requestContextPromise); + for (const middleware of this.configuration.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe( + mergeMap((ctx: RequestContext) => middleware.pre(ctx)) + ); + } + + return middlewarePreObservable + .pipe( + mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx)) + ) + .pipe( + mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of this.configuration.middleware) { + middlewarePostObservable = middlewarePostObservable.pipe( + mergeMap((rsp: ResponseContext) => middleware.post(rsp)) + ); + } + return middlewarePostObservable.pipe( + map((rsp: ResponseContext) => + this.responseProcessor.getMonthlyUsageAttribution(rsp) + ) + ); + }) + ); + } /** * Get specified daily custom reports. * Get specified daily custom reports diff --git a/packages/datadog-api-client-v1/types/PromiseAPI.ts b/packages/datadog-api-client-v1/types/PromiseAPI.ts index 5c33f2f4852..60909ce68b1 100644 --- a/packages/datadog-api-client-v1/types/PromiseAPI.ts +++ b/packages/datadog-api-client-v1/types/PromiseAPI.ts @@ -72,6 +72,8 @@ import { Monitor } from "../models/Monitor"; import { MonitorGroupSearchResponse } from "../models/MonitorGroupSearchResponse"; import { MonitorSearchResponse } from "../models/MonitorSearchResponse"; import { MonitorUpdateRequest } from "../models/MonitorUpdateRequest"; +import { MonthlyUsageAttributionResponse } from "../models/MonthlyUsageAttributionResponse"; +import { MonthlyUsageAttributionSupportedMetrics } from "../models/MonthlyUsageAttributionSupportedMetrics"; import { NotebookCreateRequest } from "../models/NotebookCreateRequest"; import { NotebookResponse } from "../models/NotebookResponse"; import { NotebookUpdateRequest } from "../models/NotebookUpdateRequest"; @@ -3264,6 +3266,40 @@ export class PromiseUsageMeteringApi { return result.toPromise(); } + /** + * Get Monthly Usage Attribution. + * Get Monthly Usage Attribution + * @param startMonth Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month. Maximum of 15 months ago. + * @param fields Comma-separated list of usage types to return, or `*` for all usage types. + * @param endMonth Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. + * @param sortDirection The direction to sort by: `[desc, asc]`. + * @param sortName The field to sort by. + * @param tagBreakdownKeys Comma separated list of tags used to group usage. If no value is provided the usage will not be broken down by tags. + * @param nextRecordId List following results with a next_record_id provided in the previous query. + */ + public getMonthlyUsageAttribution( + startMonth: Date, + fields: MonthlyUsageAttributionSupportedMetrics, + endMonth?: Date, + sortDirection?: UsageSortDirection, + sortName?: MonthlyUsageAttributionSupportedMetrics, + tagBreakdownKeys?: string, + nextRecordId?: string, + _options?: Configuration + ): Promise { + const result = this.api.getMonthlyUsageAttribution( + startMonth, + fields, + endMonth, + sortDirection, + sortName, + tagBreakdownKeys, + nextRecordId, + _options + ); + return result.toPromise(); + } + /** * Get specified daily custom reports. * Get specified daily custom reports