Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 86 additions & 25 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70492,6 +70492,8 @@ components:
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit"
maxItems: 100
type: array
tracking_mode:
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode"
type:
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorType"
value_limit:
Expand All @@ -70506,6 +70508,7 @@ components:
- type
- include
- limit_exceeded_action
- tracking_mode
- value_limit
- enabled
type: object
Expand All @@ -70520,6 +70523,16 @@ components:
x-enum-varnames:
- DROP_TAG
- DROP_EVENT
ObservabilityPipelineTagCardinalityLimitProcessorOverrideType:
description: How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking.
enum:
- limit_override
- excluded
example: limit_override
type: string
x-enum-varnames:
- LIMIT_OVERRIDE
- EXCLUDED
ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit:
description: A cardinality override applied to a specific metric.
properties:
Expand All @@ -70529,65 +70542,63 @@ components:
description: The name of the metric this override applies to.
example: "system.cpu.user"
type: string
mode:
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode"
override_type:
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType"
per_tag_limits:
description: A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `mode` is `excluded`.
description: A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `override_type` is `excluded`.
items:
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit"
maxItems: 50
type: array
value_limit:
description: The maximum number of distinct tag value combinations allowed for this metric. Required when `mode` is `tracked`. Must be omitted when `mode` is `excluded`.
description: The maximum number of distinct tag value combinations allowed for this metric. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`.
example: 10000
format: int64
maximum: 1000000
minimum: 0
type: integer
required:
- metric_name
- mode
- override_type
type: object
ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode:
description: How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely.
enum:
- tracked
- excluded
example: tracked
type: string
x-enum-varnames:
- TRACKED
- EXCLUDED
ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit:
description: A cardinality override for a specific tag key within a per-metric limit.
properties:
mode:
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode"
override_type:
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType"
tag_key:
description: The tag key this override applies to.
example: "host"
type: string
value_limit:
description: The maximum number of distinct values allowed for this tag. Required when `mode` is `limit_override`. Must be omitted when `mode` is `excluded`.
description: The maximum number of distinct values allowed for this tag. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`.
example: 5000
format: int64
maximum: 1000000
minimum: 0
type: integer
required:
- tag_key
- override_type
type: object
ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode:
description: Controls whether the processor uses exact or probabilistic tag tracking.
properties:
mode:
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode"
required:
- mode
type: object
ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode:
description: How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking.
ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode:
description: The cardinality tracking algorithm to use.
enum:
- limit_override
- excluded
example: limit_override
- exact_fingerprint
- probabilistic
example: exact_fingerprint
type: string
x-enum-varnames:
- LIMIT_OVERRIDE
- EXCLUDED
- EXACT_FINGERPRINT
- PROBABILISTIC
ObservabilityPipelineTagCardinalityLimitProcessorType:
default: tag_cardinality_limit
description: The processor type. The value must be `tag_cardinality_limit`.
Expand Down Expand Up @@ -127284,6 +127295,56 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
get:
description: Get the custom forecast for a budget.
operationId: GetCustomForecast
parameters:
- $ref: "#/components/parameters/BudgetID"
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
budget_uid: 00000000-0000-0000-0000-000000000001
created_at: 1738258683590
created_by: 00000000-0a0a-0a0a-aaa0-00000000000a
entries:
- amount: 400
month: 202501
tag_filters:
- tag_key: service
tag_value: ec2
- amount: 450
month: 202502
tag_filters:
- tag_key: service
tag_value: ec2
updated_at: 1738258683590
updated_by: 00000000-0a0a-0a0a-aaa0-00000000000a
id: 11111111-1111-1111-1111-111111111111
type: custom_forecast
schema:
$ref: "#/components/schemas/CustomForecastResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
summary: Get a budget's custom forecast
tags:
- Cloud Cost Management
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/cost/budgets:
get:
description: List budgets.
Expand Down
8 changes: 8 additions & 0 deletions examples/v2/cloud-cost-management/GetCustomForecast.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get a budget's custom forecast returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_custom_forecast".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.get_custom_forecast("budget_id")
3 changes: 3 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2741,6 +2741,9 @@
"v2.DeleteCustomForecast" => {
"budget_id" => "String",
},
"v2.GetCustomForecast" => {
"budget_id" => "String",
},
"v2.GetCommitmentsCommitmentList" => {
"provider" => "CommitmentsProvider",
"product" => "String",
Expand Down
24 changes: 24 additions & 0 deletions features/v2/cloud_cost_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,30 @@ Feature: Cloud Cost Management
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/cloud-cost-management
Scenario: Get a budget's custom forecast returns "Bad Request" response
Given operation "GetCustomForecast" enabled
And new "GetCustomForecast" request
And request contains "budget_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-cost-management
Scenario: Get a budget's custom forecast returns "Not Found" response
Given operation "GetCustomForecast" enabled
And new "GetCustomForecast" request
And request contains "budget_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/cloud-cost-management
Scenario: Get a budget's custom forecast returns "OK" response
Given operation "GetCustomForecast" enabled
And new "GetCustomForecast" request
And request contains "budget_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@replay-only @team:DataDog/cloud-cost-management
Scenario: Get a tag pipeline ruleset returns "OK" response
Given new "GetTagPipelinesRuleset" request
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,12 @@
"type": "idempotent"
}
},
"GetCustomForecast": {
"tag": "Cloud Cost Management",
"undo": {
"type": "safe"
}
},
"ListBudgets": {
"tag": "Cloud Cost Management",
"undo": {
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ def initialize
"v2.get_commitments_utilization_timeseries": false,
"v2.get_cost_anomaly": false,
"v2.get_cost_tag_metadata_currency": false,
"v2.get_custom_forecast": false,
"v2.list_cost_anomalies": false,
"v2.list_cost_tag_key_sources": false,
"v2.list_cost_tag_metadata": false,
Expand Down
5 changes: 3 additions & 2 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5305,10 +5305,11 @@ def overrides
"v2.observability_pipeline_syslog_source_mode" => "ObservabilityPipelineSyslogSourceMode",
"v2.observability_pipeline_tag_cardinality_limit_processor" => "ObservabilityPipelineTagCardinalityLimitProcessor",
"v2.observability_pipeline_tag_cardinality_limit_processor_action" => "ObservabilityPipelineTagCardinalityLimitProcessorAction",
"v2.observability_pipeline_tag_cardinality_limit_processor_override_type" => "ObservabilityPipelineTagCardinalityLimitProcessorOverrideType",
"v2.observability_pipeline_tag_cardinality_limit_processor_per_metric_limit" => "ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit",
"v2.observability_pipeline_tag_cardinality_limit_processor_per_metric_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode",
"v2.observability_pipeline_tag_cardinality_limit_processor_per_tag_limit" => "ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit",
"v2.observability_pipeline_tag_cardinality_limit_processor_per_tag_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode",
"v2.observability_pipeline_tag_cardinality_limit_processor_tracking_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode",
"v2.observability_pipeline_tag_cardinality_limit_processor_tracking_mode_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode",
"v2.observability_pipeline_tag_cardinality_limit_processor_type" => "ObservabilityPipelineTagCardinalityLimitProcessorType",
"v2.observability_pipeline_throttle_processor" => "ObservabilityPipelineThrottleProcessor",
"v2.observability_pipeline_throttle_processor_type" => "ObservabilityPipelineThrottleProcessorType",
Expand Down
71 changes: 71 additions & 0 deletions lib/datadog_api_client/v2/api/cloud_cost_management_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2504,6 +2504,77 @@ def get_custom_costs_file_with_http_info(file_id, opts = {})
return data, status_code, headers
end

# Get a budget's custom forecast.
#
# @see #get_custom_forecast_with_http_info
def get_custom_forecast(budget_id, opts = {})
data, _status_code, _headers = get_custom_forecast_with_http_info(budget_id, opts)
data
end

# Get a budget's custom forecast.
#
# Get the custom forecast for a budget.
#
# @param budget_id [String] Budget id.
# @param opts [Hash] the optional parameters
# @return [Array<(CustomForecastResponse, Integer, Hash)>] CustomForecastResponse data, response status code and response headers
def get_custom_forecast_with_http_info(budget_id, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_forecast".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_forecast")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_forecast"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_custom_forecast ...'
end
# verify the required parameter 'budget_id' is set
if @api_client.config.client_side_validation && budget_id.nil?
fail ArgumentError, "Missing the required parameter 'budget_id' when calling CloudCostManagementAPI.get_custom_forecast"
end
# resource path
local_var_path = '/api/v2/cost/budget/{budget_id}/custom-forecast'.sub('{budget_id}', CGI.escape(budget_id.to_s).gsub('%2F', '/'))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'CustomForecastResponse'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

new_options = opts.merge(
:operation => :get_custom_forecast,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: CloudCostManagementAPI#get_custom_forecast\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get a tag pipeline ruleset.
#
# @see #get_tag_pipelines_ruleset_with_http_info
Expand Down
Loading
Loading