lib/datadog_api_client/v2/api/metrics_api.rb
# Create a tag configuration
# Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric.
# Optionally, include percentile aggregations on any distribution metric or configure custom aggregations
# on any count, rate, or gauge metric.
# Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
# @param metric_name [String] The name of the metric.
# @param body [MetricTagConfigurationCreateRequest] 
# @param opts [Hash] the optional parameters
# @return [Array<(MetricTagConfigurationResponse, Integer, Hash)>] MetricTagConfigurationResponse data, response status code and response headers
Create a tag configuration
Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric.
Optionally, include percentile aggregations on any distribution metric or configure custom aggregations
on any count, rate, or gauge metric.
Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
Create a tag configuration Create and define a list of queryable tag keys for an existing count / gauge / rate / distribution metric . Optionally include percentile aggregations on any distribution metric or configure custom aggregations on any count rate or gauge metric . Can only be used with application keys of users with the ` Manage Tags for Metrics ` permission .
def create_tag_configuration_with_http_info(metric_name, body, opts = {})
      if @api_client.config.unstable_operations.has_key?(:create_tag_configuration)
        unstable_enabled = @api_client.config.unstable_operations[:create_tag_configuration]
        if unstable_enabled
          @api_client.config.logger.warn format("Using unstable operation '%s'", "create_tag_configuration")
        else
          raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_tag_configuration"))
        end
      end
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsAPI.create_tag_configuration ...'
      end
      if @api_client.config.client_side_validation && metric_name.nil?
        fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.create_tag_configuration"
      end
      if @api_client.config.client_side_validation && body.nil?
        fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.create_tag_configuration"
      end
      local_var_path = '/api/v2/metrics/{metric_name}/tags'.sub('{metric_name}', CGI.escape(metric_name.to_s).gsub('%2F', '/'))
      query_params = opts[:query_params] || {}
      header_params = opts[:header_params] || {}
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
      form_params = opts[:form_params] || {}
      post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
      return_type = opts[:debug_return_type] || 'MetricTagConfigurationResponse'
      auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
      new_options = opts.merge(
        :operation => :create_tag_configuration,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )
      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: MetricsAPI#create_tag_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def create_tag_configuration_with_http_info ( metric_name , body , opts = { } ) if @api_client . config . unstable_operations . has_key? ( :create_tag_configuration ) unstable_enabled = @api_client . config . unstable_operations [ :create_tag_configuration ] if unstable_enabled @api_client . config . logger . warn format ( "Using unstable operation '%s'" , "create_tag_configuration" ) else raise APIError . new ( message : format ( "Unstable operation '%s' is disabled" , "create_tag_configuration" ) ) end end if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: MetricsAPI.create_tag_configuration ...' end if @api_client . config . client_side_validation && metric_name . nil? fail ArgumentError , "Missing the required parameter 'metric_name' when calling MetricsAPI.create_tag_configuration" end if @api_client . config . client_side_validation && body . nil? fail ArgumentError , "Missing the required parameter 'body' when calling MetricsAPI.create_tag_configuration" end local_var_path = '/api/v2/metrics/{metric_name}/tags' . sub ( '{metric_name}' , CGI . escape ( metric_name . to_s ) . gsub ( '%2F' , '/' ) ) query_params = opts [ :query_params ] || { } header_params = opts [ :header_params ] || { } header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] ) header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'application/json' ] ) form_params = opts [ :form_params ] || { } post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( body ) return_type = opts [ :debug_return_type ] || 'MetricTagConfigurationResponse' auth_names = opts [ :debug_auth_names ] || [ :apiKeyAuth , :appKeyAuth ] new_options = opts . merge ( :operation => :create_tag_configuration , :header_params => header_params , :query_params => query_params , :form_params => form_params , :body => post_body , :auth_names => auth_names , :return_type => return_type ) data , status_code , headers = @api_client . call_api ( :POST , local_var_path , new_options ) if @api_client . config . debugging @api_client . config . logger . debug "API called: MetricsAPI#create_tag_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Create a tag configuration
Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric.
Create a tag configuration Create and define a list of queryable tag keys for an existing count / gauge / rate / distribution metric .
# verify the required parameter 'metric_name' is set # verify the required parameter 'body' is set # resource path # query parameters # header parameters # HTTP header 'Accept' (if needed) # HTTP header 'Content-Type' # form parameters # http body (model) # return_type # auth_names
MetricTagConfigurationResponse data, response status code and response headers
MetricTagConfigurationResponse data response status code and response headers
Array<(MetricTagConfigurationResponse, Integer, Hash)>
metric_name
The name of the metric.
The name of the metric .
body
<not_specific>
opts
the optional parameters
the optional parameters
<not_specific>
None