Sha256: aae1ee53ee030fa729645c08026f75d7f7d9161250bebe5dbf839fc62c631001

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

require 'time'
require 'datadog_api_client/v1'
# setup authorization
DatadogAPIClient::V1.configure do |config|
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKeyAuth'] = 'Bearer'

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['appKeyAuth'] = 'Bearer'
end

api_instance = DatadogAPIClient::V1::SnapshotsApi.new
start = 789 # Integer | The POSIX timestamp of the start of the query.
_end = 789 # Integer | The POSIX timestamp of the end of the query.
opts = {
  metric_query: 'metric_query_example', # String | The metric query.
  event_query: 'event_query_example', # String | A query that adds event bands to the graph.
  graph_def: 'graph_def_example', # String | A JSON document defining the graph. `graph_def` can be used instead of `metric_query`. The JSON document uses the [grammar defined here](https://docs.datadoghq.com/graphing/graphing_json/#grammar) and should be formatted to a single line then URL encoded.
  title: 'title_example' # String | A title for the graph. If no title is specified, the graph does not have a title.
}

begin
  # Take graph snapshots
  result = api_instance.get_graph_snapshot(start, _end, opts)
  p result
rescue DatadogAPIClient::V1::ApiError => e
  puts "Error when calling SnapshotsApi->get_graph_snapshot: #{e}"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datadog_api_client-1.0.0.beta.2 examples/v1/snapshots/GetGraphSnapshot.rbbeta