Class: DatadogAPIClient::V2::MetricsAPI
- Inherits:
-
Object
- Object
- DatadogAPIClient::V2::MetricsAPI
- Defined in:
- lib/datadog_api_client/v2/api/metrics_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_bulk_tags_metrics_configuration(body, opts = {}) ⇒ Object
Configure tags for multiple metrics.
-
#create_bulk_tags_metrics_configuration_with_http_info(body, opts = {}) ⇒ Array<(MetricBulkTagConfigResponse, Integer, Hash)>
Configure tags for multiple metrics.
-
#create_tag_configuration(metric_name, body, opts = {}) ⇒ Object
Create a tag configuration.
-
#create_tag_configuration_with_http_info(metric_name, body, opts = {}) ⇒ Array<(MetricTagConfigurationResponse, Integer, Hash)>
Create a tag configuration.
-
#delete_bulk_tags_metrics_configuration(body, opts = {}) ⇒ Object
Delete tags for multiple metrics.
-
#delete_bulk_tags_metrics_configuration_with_http_info(body, opts = {}) ⇒ Array<(MetricBulkTagConfigResponse, Integer, Hash)>
Delete tags for multiple metrics.
-
#delete_tag_configuration(metric_name, opts = {}) ⇒ Object
Delete a tag configuration.
-
#delete_tag_configuration_with_http_info(metric_name, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a tag configuration.
-
#estimate_metrics_output_series(metric_name, opts = {}) ⇒ Object
Tag Configuration Cardinality Estimator.
-
#estimate_metrics_output_series_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricEstimateResponse, Integer, Hash)>
Tag Configuration Cardinality Estimator.
-
#get_metric_tag_cardinality_details(metric_name, opts = {}) ⇒ Object
Get tag key cardinality details.
-
#get_metric_tag_cardinality_details_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricTagCardinalitiesResponse, Integer, Hash)>
Get tag key cardinality details.
-
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ MetricsAPI
constructor
A new instance of MetricsAPI.
-
#list_active_metric_configurations(metric_name, opts = {}) ⇒ Object
List active tags and aggregations.
-
#list_active_metric_configurations_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricSuggestedTagsAndAggregationsResponse, Integer, Hash)>
List active tags and aggregations.
-
#list_metric_assets(metric_name, opts = {}) ⇒ Object
Related Assets to a Metric.
-
#list_metric_assets_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricAssetsResponse, Integer, Hash)>
Related Assets to a Metric.
-
#list_tag_configuration_by_name(metric_name, opts = {}) ⇒ Object
List tag configuration by name.
-
#list_tag_configuration_by_name_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricTagConfigurationResponse, Integer, Hash)>
List tag configuration by name.
-
#list_tag_configurations(opts = {}) ⇒ Object
Get a list of metrics.
-
#list_tag_configurations_with_http_info(opts = {}) ⇒ Array<(MetricsAndMetricTagConfigurationsResponse, Integer, Hash)>
Get a list of metrics.
-
#list_tag_configurations_with_pagination(opts = {}) {|MetricsAndMetricTagConfigurations| ... } ⇒ Object
Get a list of metrics.
-
#list_tags_by_metric_name(metric_name, opts = {}) ⇒ Object
List tags by metric name.
-
#list_tags_by_metric_name_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricAllTagsResponse, Integer, Hash)>
List tags by metric name.
-
#list_volumes_by_metric_name(metric_name, opts = {}) ⇒ Object
List distinct metric volumes by metric name.
-
#list_volumes_by_metric_name_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricVolumesResponse, Integer, Hash)>
List distinct metric volumes by metric name.
-
#query_scalar_data(body, opts = {}) ⇒ Object
Query scalar data across multiple products.
-
#query_scalar_data_with_http_info(body, opts = {}) ⇒ Array<(ScalarFormulaQueryResponse, Integer, Hash)>
Query scalar data across multiple products.
-
#query_timeseries_data(body, opts = {}) ⇒ Object
Query timeseries data across multiple products.
-
#query_timeseries_data_with_http_info(body, opts = {}) ⇒ Array<(TimeseriesFormulaQueryResponse, Integer, Hash)>
Query timeseries data across multiple products.
-
#submit_metrics(body, opts = {}) ⇒ Object
Submit metrics.
-
#submit_metrics_with_http_info(body, opts = {}) ⇒ Array<(IntakePayloadAccepted, Integer, Hash)>
Submit metrics.
-
#update_tag_configuration(metric_name, body, opts = {}) ⇒ Object
Update a tag configuration.
-
#update_tag_configuration_with_http_info(metric_name, body, opts = {}) ⇒ Array<(MetricTagConfigurationResponse, Integer, Hash)>
Update a tag configuration.
Constructor Details
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ MetricsAPI
Returns a new instance of MetricsAPI.
22 23 24 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 22 def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
20 21 22 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 20 def api_client @api_client end |
Instance Method Details
#create_bulk_tags_metrics_configuration(body, opts = {}) ⇒ Object
Configure tags for multiple metrics.
29 30 31 32 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 29 def (body, opts = {}) data, _status_code, _headers = (body, opts) data end |
#create_bulk_tags_metrics_configuration_with_http_info(body, opts = {}) ⇒ Array<(MetricBulkTagConfigResponse, Integer, Hash)>
Configure tags for multiple metrics.
Create and define a list of queryable tag keys for a set of existing count, gauge, rate, and distribution metrics. Metrics are selected by passing a metric name prefix. Use the Delete method of this API path to remove tag configurations. Results can be sent to a set of account email addresses, just like the same operation in the Datadog web app. If multiple calls include the same metric, the last configuration applied (not by submit order) is used, do not expect deterministic ordering of concurrent calls. The ‘exclude_tags_mode` value will set all metrics that match the prefix to the same exclusion state, metric tag configurations do not support mixed inclusion and exclusion for tags on the same metric. Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 47 def (body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.create_bulk_tags_metrics_configuration ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.create_bulk_tags_metrics_configuration" end # resource path local_var_path = '/api/v2/metrics/config/bulk-tags' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'MetricBulkTagConfigResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :create_bulk_tags_metrics_configuration, :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::Post, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#create_bulk_tags_metrics_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_tag_configuration(metric_name, body, opts = {}) ⇒ Object
Create a tag configuration.
102 103 104 105 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 102 def create_tag_configuration(metric_name, body, opts = {}) data, _status_code, _headers = create_tag_configuration_with_http_info(metric_name, body, opts) data end |
#create_tag_configuration_with_http_info(metric_name, body, opts = {}) ⇒ Array<(MetricTagConfigurationResponse, Integer, Hash)>
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. By setting ‘exclude_tags_mode` to true, the behavior is changed from an allow-list to a deny-list, and tags in the defined list are not queryable. Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 119 def create_tag_configuration_with_http_info(metric_name, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.create_tag_configuration ...' end # verify the required parameter 'metric_name' is set 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 # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.create_tag_configuration" end # resource path local_var_path = '/api/v2/metrics/{metric_name}/tags'.sub('{metric_name}', CGI.escape(metric_name.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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'MetricTagConfigurationResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = 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, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, ) 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 |
#delete_bulk_tags_metrics_configuration(body, opts = {}) ⇒ Object
Delete tags for multiple metrics.
178 179 180 181 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 178 def (body, opts = {}) data, _status_code, _headers = (body, opts) data end |
#delete_bulk_tags_metrics_configuration_with_http_info(body, opts = {}) ⇒ Array<(MetricBulkTagConfigResponse, Integer, Hash)>
Delete tags for multiple metrics.
Delete all custom lists of queryable tag keys for a set of existing count, gauge, rate, and distribution metrics. Metrics are selected by passing a metric name prefix. Results can be sent to a set of account email addresses, just like the same operation in the Datadog web app. Can only be used with application keys of users with the ‘Manage Tags for Metrics` permission.
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 193 def (body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.delete_bulk_tags_metrics_configuration ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.delete_bulk_tags_metrics_configuration" end # resource path local_var_path = '/api/v2/metrics/config/bulk-tags' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'MetricBulkTagConfigResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :delete_bulk_tags_metrics_configuration, :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::Delete, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#delete_bulk_tags_metrics_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_tag_configuration(metric_name, opts = {}) ⇒ Object
Delete a tag configuration.
248 249 250 251 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 248 def delete_tag_configuration(metric_name, opts = {}) delete_tag_configuration_with_http_info(metric_name, opts) nil end |
#delete_tag_configuration_with_http_info(metric_name, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a tag configuration.
Deletes a metric’s tag configuration. Can only be used with application keys from users with the ‘Manage Tags for Metrics` permission.
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 261 def delete_tag_configuration_with_http_info(metric_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.delete_tag_configuration ...' end # verify the required parameter 'metric_name' is set if @api_client.config.client_side_validation && metric_name.nil? fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.delete_tag_configuration" end # resource path local_var_path = '/api/v2/metrics/{metric_name}/tags'.sub('{metric_name}', CGI.escape(metric_name.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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :delete_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, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#delete_tag_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#estimate_metrics_output_series(metric_name, opts = {}) ⇒ Object
Tag Configuration Cardinality Estimator.
314 315 316 317 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 314 def estimate_metrics_output_series(metric_name, opts = {}) data, _status_code, _headers = estimate_metrics_output_series_with_http_info(metric_name, opts) data end |
#estimate_metrics_output_series_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricEstimateResponse, Integer, Hash)>
Tag Configuration Cardinality Estimator.
Returns the estimated cardinality for a metric with a given tag, percentile and number of aggregations configuration using Metrics without Limits™.
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 331 def estimate_metrics_output_series_with_http_info(metric_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.estimate_metrics_output_series ...' end # verify the required parameter 'metric_name' is set if @api_client.config.client_side_validation && metric_name.nil? fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.estimate_metrics_output_series" end if @api_client.config.client_side_validation && !opts[:'filter_hours_ago'].nil? && opts[:'filter_hours_ago'] > 2147483647 fail ArgumentError, 'invalid value for "opts[:"filter_hours_ago"]" when calling MetricsAPI.estimate_metrics_output_series, must be smaller than or equal to 2147483647.' end if @api_client.config.client_side_validation && !opts[:'filter_hours_ago'].nil? && opts[:'filter_hours_ago'] < 49 fail ArgumentError, 'invalid value for "opts[:"filter_hours_ago"]" when calling MetricsAPI.estimate_metrics_output_series, must be greater than or equal to 49.' end if @api_client.config.client_side_validation && !opts[:'filter_num_aggregations'].nil? && opts[:'filter_num_aggregations'] > 9 fail ArgumentError, 'invalid value for "opts[:"filter_num_aggregations"]" when calling MetricsAPI.estimate_metrics_output_series, must be smaller than or equal to 9.' end if @api_client.config.client_side_validation && !opts[:'filter_timespan_h'].nil? && opts[:'filter_timespan_h'] > 2147483647 fail ArgumentError, 'invalid value for "opts[:"filter_timespan_h"]" when calling MetricsAPI.estimate_metrics_output_series, must be smaller than or equal to 2147483647.' end # resource path local_var_path = '/api/v2/metrics/{metric_name}/estimate'.sub('{metric_name}', CGI.escape(metric_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'filter[groups]'] = opts[:'filter_groups'] if !opts[:'filter_groups'].nil? query_params[:'filter[hours_ago]'] = opts[:'filter_hours_ago'] if !opts[:'filter_hours_ago'].nil? query_params[:'filter[num_aggregations]'] = opts[:'filter_num_aggregations'] if !opts[:'filter_num_aggregations'].nil? query_params[:'filter[pct]'] = opts[:'filter_pct'] if !opts[:'filter_pct'].nil? query_params[:'filter[timespan_h]'] = opts[:'filter_timespan_h'] if !opts[:'filter_timespan_h'].nil? # 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] || 'MetricEstimateResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :estimate_metrics_output_series, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#estimate_metrics_output_series\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_metric_tag_cardinality_details(metric_name, opts = {}) ⇒ Object
Get tag key cardinality details.
401 402 403 404 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 401 def get_metric_tag_cardinality_details(metric_name, opts = {}) data, _status_code, _headers = get_metric_tag_cardinality_details_with_http_info(metric_name, opts) data end |
#get_metric_tag_cardinality_details_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricTagCardinalitiesResponse, Integer, Hash)>
Get tag key cardinality details.
Returns the cardinality details of tags for a specific metric.
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 413 def get_metric_tag_cardinality_details_with_http_info(metric_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.get_metric_tag_cardinality_details ...' end # verify the required parameter 'metric_name' is set if @api_client.config.client_side_validation && metric_name.nil? fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.get_metric_tag_cardinality_details" end # resource path local_var_path = '/api/v2/metrics/{metric_name}/tag-cardinalities'.sub('{metric_name}', CGI.escape(metric_name.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] || 'MetricTagCardinalitiesResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_metric_tag_cardinality_details, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#get_metric_tag_cardinality_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_active_metric_configurations(metric_name, opts = {}) ⇒ Object
List active tags and aggregations.
466 467 468 469 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 466 def list_active_metric_configurations(metric_name, opts = {}) data, _status_code, _headers = list_active_metric_configurations_with_http_info(metric_name, opts) data end |
#list_active_metric_configurations_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricSuggestedTagsAndAggregationsResponse, Integer, Hash)>
List active tags and aggregations.
List tags and aggregations that are actively queried on dashboards, notebooks, monitors, the Metrics Explorer, and using the API for a given metric name.
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 479 def list_active_metric_configurations_with_http_info(metric_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.list_active_metric_configurations ...' end # verify the required parameter 'metric_name' is set if @api_client.config.client_side_validation && metric_name.nil? fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.list_active_metric_configurations" end # resource path local_var_path = '/api/v2/metrics/{metric_name}/active-configurations'.sub('{metric_name}', CGI.escape(metric_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'window[seconds]'] = opts[:'window_seconds'] if !opts[:'window_seconds'].nil? # 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] || 'MetricSuggestedTagsAndAggregationsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :list_active_metric_configurations, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#list_active_metric_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_metric_assets(metric_name, opts = {}) ⇒ Object
Related Assets to a Metric.
533 534 535 536 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 533 def list_metric_assets(metric_name, opts = {}) data, _status_code, _headers = list_metric_assets_with_http_info(metric_name, opts) data end |
#list_metric_assets_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricAssetsResponse, Integer, Hash)>
Related Assets to a Metric.
Returns dashboards, monitors, notebooks, and SLOs that a metric is stored in, if any. Updated every 24 hours.
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 545 def list_metric_assets_with_http_info(metric_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.list_metric_assets ...' end # verify the required parameter 'metric_name' is set if @api_client.config.client_side_validation && metric_name.nil? fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.list_metric_assets" end # resource path local_var_path = '/api/v2/metrics/{metric_name}/assets'.sub('{metric_name}', CGI.escape(metric_name.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] || 'MetricAssetsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :list_metric_assets, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#list_metric_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_tag_configuration_by_name(metric_name, opts = {}) ⇒ Object
List tag configuration by name.
598 599 600 601 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 598 def list_tag_configuration_by_name(metric_name, opts = {}) data, _status_code, _headers = list_tag_configuration_by_name_with_http_info(metric_name, opts) data end |
#list_tag_configuration_by_name_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricTagConfigurationResponse, Integer, Hash)>
List tag configuration by name.
Returns the tag configuration for the given metric name.
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 610 def list_tag_configuration_by_name_with_http_info(metric_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.list_tag_configuration_by_name ...' end # verify the required parameter 'metric_name' is set if @api_client.config.client_side_validation && metric_name.nil? fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.list_tag_configuration_by_name" end # resource path local_var_path = '/api/v2/metrics/{metric_name}/tags'.sub('{metric_name}', CGI.escape(metric_name.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] || 'MetricTagConfigurationResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :list_tag_configuration_by_name, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#list_tag_configuration_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_tag_configurations(opts = {}) ⇒ Object
Get a list of metrics.
663 664 665 666 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 663 def list_tag_configurations(opts = {}) data, _status_code, _headers = list_tag_configurations_with_http_info(opts) data end |
#list_tag_configurations_with_http_info(opts = {}) ⇒ Array<(MetricsAndMetricTagConfigurationsResponse, Integer, Hash)>
Get a list of metrics.
Returns all metrics that can be configured in the Metrics Summary page or with Metrics without Limits™ (matching additional filters if specified). Optionally, paginate by using the ‘page` and/or `page` query parameters. To fetch the first page, pass in a query parameter with either a valid `page` or an empty cursor like `page=`. To fetch the next page, pass in the `next_cursor` value from the response as the new `page` value. Once the `meta.pagination.next_cursor` value is null, all pages have been retrieved.
687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 687 def list_tag_configurations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.list_tag_configurations ...' end allowable_values = ['non_distribution', 'distribution'] if @api_client.config.client_side_validation && opts[:'filter_metric_type'] && !allowable_values.include?(opts[:'filter_metric_type']) fail ArgumentError, "invalid value for \"filter_metric_type\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling MetricsAPI.list_tag_configurations, must be smaller than or equal to 10000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling MetricsAPI.list_tag_configurations, must be greater than or equal to 1.' end # resource path local_var_path = '/api/v2/metrics' # query parameters query_params = opts[:query_params] || {} query_params[:'filter[configured]'] = opts[:'filter_configured'] if !opts[:'filter_configured'].nil? query_params[:'filter[tags_configured]'] = opts[:'filter_tags_configured'] if !opts[:'filter_tags_configured'].nil? query_params[:'filter[metric_type]'] = opts[:'filter_metric_type'] if !opts[:'filter_metric_type'].nil? query_params[:'filter[include_percentiles]'] = opts[:'filter_include_percentiles'] if !opts[:'filter_include_percentiles'].nil? query_params[:'filter[queried]'] = opts[:'filter_queried'] if !opts[:'filter_queried'].nil? query_params[:'filter[tags]'] = opts[:'filter_tags'] if !opts[:'filter_tags'].nil? query_params[:'filter[related_assets]'] = opts[:'filter_related_assets'] if !opts[:'filter_related_assets'].nil? query_params[:'window[seconds]'] = opts[:'window_seconds'] if !opts[:'window_seconds'].nil? query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # 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] || 'MetricsAndMetricTagConfigurationsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :list_tag_configurations, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#list_tag_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_tag_configurations_with_pagination(opts = {}) {|MetricsAndMetricTagConfigurations| ... } ⇒ Object
Get a list of metrics.
Provide a paginated version of #list_tag_configurations, returning all items.
To use it you need to use a block: list_tag_configurations_with_pagination { |item| p item }
760 761 762 763 764 765 766 767 768 769 770 771 772 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 760 def list_tag_configurations_with_pagination(opts = {}) api_version = "V2" page_size = @api_client.get_attribute_from_path(opts, "page_size", 10000) @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) while true do response = list_tag_configurations(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } if @api_client.get_attribute_from_path(response, "data").length < page_size break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.pagination.next_cursor")) end end |
#list_tags_by_metric_name(metric_name, opts = {}) ⇒ Object
List tags by metric name.
777 778 779 780 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 777 def (metric_name, opts = {}) data, _status_code, _headers = (metric_name, opts) data end |
#list_tags_by_metric_name_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricAllTagsResponse, Integer, Hash)>
List tags by metric name.
View indexed tag key-value pairs for a given metric name over the previous hour.
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 789 def (metric_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.list_tags_by_metric_name ...' end # verify the required parameter 'metric_name' is set if @api_client.config.client_side_validation && metric_name.nil? fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.list_tags_by_metric_name" end # resource path local_var_path = '/api/v2/metrics/{metric_name}/all-tags'.sub('{metric_name}', CGI.escape(metric_name.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] || 'MetricAllTagsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :list_tags_by_metric_name, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#list_tags_by_metric_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_volumes_by_metric_name(metric_name, opts = {}) ⇒ Object
List distinct metric volumes by metric name.
842 843 844 845 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 842 def list_volumes_by_metric_name(metric_name, opts = {}) data, _status_code, _headers = list_volumes_by_metric_name_with_http_info(metric_name, opts) data end |
#list_volumes_by_metric_name_with_http_info(metric_name, opts = {}) ⇒ Array<(MetricVolumesResponse, Integer, Hash)>
List distinct metric volumes by metric name.
View distinct metrics volumes for the given metric name.
Custom metrics generated in-app from other products will return ‘null` for ingested volumes.
856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 856 def list_volumes_by_metric_name_with_http_info(metric_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.list_volumes_by_metric_name ...' end # verify the required parameter 'metric_name' is set if @api_client.config.client_side_validation && metric_name.nil? fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.list_volumes_by_metric_name" end # resource path local_var_path = '/api/v2/metrics/{metric_name}/volumes'.sub('{metric_name}', CGI.escape(metric_name.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] || 'MetricVolumesResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :list_volumes_by_metric_name, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#list_volumes_by_metric_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#query_scalar_data(body, opts = {}) ⇒ Object
Query scalar data across multiple products.
909 910 911 912 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 909 def query_scalar_data(body, opts = {}) data, _status_code, _headers = query_scalar_data_with_http_info(body, opts) data end |
#query_scalar_data_with_http_info(body, opts = {}) ⇒ Array<(ScalarFormulaQueryResponse, Integer, Hash)>
Query scalar data across multiple products.
Query scalar values (as seen on Query Value, Table, and Toplist widgets). Multiple data sources are supported with the ability to process the data using formulas and functions.
923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 923 def query_scalar_data_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.query_scalar_data ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.query_scalar_data" end # resource path local_var_path = '/api/v2/query/scalar' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'ScalarFormulaQueryResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :query_scalar_data, :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::Post, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#query_scalar_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#query_timeseries_data(body, opts = {}) ⇒ Object
Query timeseries data across multiple products.
978 979 980 981 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 978 def query_timeseries_data(body, opts = {}) data, _status_code, _headers = query_timeseries_data_with_http_info(body, opts) data end |
#query_timeseries_data_with_http_info(body, opts = {}) ⇒ Array<(TimeseriesFormulaQueryResponse, Integer, Hash)>
Query timeseries data across multiple products.
Query timeseries data across various data sources and process the data by applying formulas and functions.
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 991 def query_timeseries_data_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.query_timeseries_data ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.query_timeseries_data" end # resource path local_var_path = '/api/v2/query/timeseries' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'TimeseriesFormulaQueryResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :query_timeseries_data, :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::Post, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#query_timeseries_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#submit_metrics(body, opts = {}) ⇒ Object
Submit metrics.
1046 1047 1048 1049 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 1046 def submit_metrics(body, opts = {}) data, _status_code, _headers = submit_metrics_with_http_info(body, opts) data end |
#submit_metrics_with_http_info(body, opts = {}) ⇒ Array<(IntakePayloadAccepted, Integer, Hash)>
Submit metrics.
The metrics end-point allows you to post time-series data that can be graphed on Datadog’s dashboards. The maximum payload size is 500 kilobytes (512000 bytes). Compressed payloads must have a decompressed size of less than 5 megabytes (5242880 bytes).
If you’re submitting metrics directly to the Datadog API without using DogStatsD, expect:
-
64 bits for the timestamp
-
64 bits for the value
-
20 bytes for the metric names
-
50 bytes for the timeseries
-
The full payload is approximately 100 bytes.
Host name is one of the resources in the Resources field.
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 1070 def submit_metrics_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.submit_metrics ...' end allowable_values = ['deflate', 'zstd1', 'gzip'] if @api_client.config.client_side_validation && opts[:'content_encoding'] && !allowable_values.include?(opts[:'content_encoding']) fail ArgumentError, "invalid value for \"content_encoding\", must be one of #{allowable_values}" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.submit_metrics" end # resource path local_var_path = '/api/v2/series' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Content-Encoding'] = opts[:'content_encoding'] if !opts[:'content_encoding'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'IntakePayloadAccepted' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth] = opts.merge( :operation => :submit_metrics, :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::Post, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#submit_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_tag_configuration(metric_name, body, opts = {}) ⇒ Object
Update a tag configuration.
1130 1131 1132 1133 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 1130 def update_tag_configuration(metric_name, body, opts = {}) data, _status_code, _headers = update_tag_configuration_with_http_info(metric_name, body, opts) data end |
#update_tag_configuration_with_http_info(metric_name, body, opts = {}) ⇒ Array<(MetricTagConfigurationResponse, Integer, Hash)>
Update a tag configuration.
Update the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations of a count, rate, or gauge metric. By setting ‘exclude_tags_mode` to true the behavior is changed from an allow-list to a deny-list, and tags in the defined list will not be queryable. Can only be used with application keys from users with the `Manage Tags for Metrics` permission. This endpoint requires a tag configuration to be created first.
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 |
# File 'lib/datadog_api_client/v2/api/metrics_api.rb', line 1147 def update_tag_configuration_with_http_info(metric_name, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsAPI.update_tag_configuration ...' end # verify the required parameter 'metric_name' is set if @api_client.config.client_side_validation && metric_name.nil? fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.update_tag_configuration" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.update_tag_configuration" end # resource path local_var_path = '/api/v2/metrics/{metric_name}/tags'.sub('{metric_name}', CGI.escape(metric_name.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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'MetricTagConfigurationResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :update_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, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsAPI#update_tag_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |