Sha256: 6de48924d7a3b715df4078a103a542aa46208df9286a4e56e1617e0de4836815

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::NotebooksAPI.new
body = DatadogAPIClient::V1::NotebookCreateRequest.new({ data: DatadogAPIClient::V1::NotebookCreateData.new({ attributes: DatadogAPIClient::V1::NotebookCreateDataAttributes.new({ cells: [DatadogAPIClient::V1::NotebookCellCreateRequest.new({ attributes: DatadogAPIClient::V1::NotebookDistributionCellAttributes.new({ definition: DatadogAPIClient::V1::DistributionWidgetDefinition.new({ requests: [DatadogAPIClient::V1::DistributionWidgetRequest.new], type: DatadogAPIClient::V1::DistributionWidgetDefinitionType::DISTRIBUTION }) }), type: DatadogAPIClient::V1::NotebookCellResourceType::NOTEBOOK_CELLS })], name: "Example Notebook", time: DatadogAPIClient::V1::NotebookAbsoluteTime.new({ _end: Time.parse("2021-02-24T20:18:28Z"), start: Time.parse("2021-02-24T19:18:28Z") }) }), type: DatadogAPIClient::V1::NotebookResourceType::NOTEBOOKS }) }) # NotebookCreateRequest | The JSON description of the notebook you want to create.

begin
  # Create a notebook
  result = api_instance.create_notebook(body)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling NotebooksAPI->create_notebook: #{e}"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datadog_api_client-1.7.0 examples/generated/v1/notebooks/CreateNotebook.rb