class DatadogAPIClient::V1::NotebooksAPI
Attributes
Public Class Methods
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 22 def initialize(api_client = APIClient.default) @api_client = api_client end
Public Instance Methods
Create a notebook Create a notebook using the specified options. @param body [NotebookCreateRequest] The JSON description of the notebook you want to create. @param [Hash] opts the optional parameters @return [NotebookResponse]
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 30 def create_notebook(body, opts = {}) data, _status_code, _headers = create_notebook_with_http_info(body, opts) data end
Create a notebook Create a notebook using the specified options. @param body [NotebookCreateRequest] The JSON description of the notebook you want to create. @param [Hash] opts the optional parameters @return [Array<(NotebookResponse
, Integer, Hash)>] NotebookResponse
data, response status code and response headers
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 40 def create_notebook_with_http_info(body, opts = {}) if @api_client.config.unstable_operations.has_key?(:create_notebook) unstable_enabled = @api_client.config.unstable_operations[:create_notebook] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "create_notebook") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_notebook")) end end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotebooksAPI.create_notebook ...' 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 NotebooksAPI.create_notebook" end # resource path local_var_path = '/api/v1/notebooks' # 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] || 'NotebookResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :create_notebook, :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: NotebooksAPI#create_notebook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a notebook Delete a notebook using the specified ID. @param notebook_id [Integer] Unique ID, assigned when you create the notebook. @param [Hash] opts the optional parameters @return [nil]
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 105 def delete_notebook(notebook_id, opts = {}) delete_notebook_with_http_info(notebook_id, opts) nil end
Delete a notebook Delete a notebook using the specified ID. @param notebook_id [Integer] Unique ID, assigned when you create the notebook. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 115 def delete_notebook_with_http_info(notebook_id, opts = {}) if @api_client.config.unstable_operations.has_key?(:delete_notebook) unstable_enabled = @api_client.config.unstable_operations[:delete_notebook] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "delete_notebook") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "delete_notebook")) end end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotebooksAPI.delete_notebook ...' end # verify the required parameter 'notebook_id' is set if @api_client.config.client_side_validation && notebook_id.nil? fail ArgumentError, "Missing the required parameter 'notebook_id' when calling NotebooksAPI.delete_notebook" end # resource path local_var_path = '/api/v1/notebooks/{notebook_id}'.sub('{' + 'notebook_id' + '}', CGI.escape(notebook_id.to_s)) # 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] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :delete_notebook, :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(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotebooksAPI#delete_notebook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get a notebook Get a notebook using the specified notebook ID. @param notebook_id [Integer] Unique ID, assigned when you create the notebook. @param [Hash] opts the optional parameters @return [NotebookResponse]
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 178 def get_notebook(notebook_id, opts = {}) data, _status_code, _headers = get_notebook_with_http_info(notebook_id, opts) data end
Get a notebook Get a notebook using the specified notebook ID. @param notebook_id [Integer] Unique ID, assigned when you create the notebook. @param [Hash] opts the optional parameters @return [Array<(NotebookResponse
, Integer, Hash)>] NotebookResponse
data, response status code and response headers
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 188 def get_notebook_with_http_info(notebook_id, opts = {}) if @api_client.config.unstable_operations.has_key?(:get_notebook) unstable_enabled = @api_client.config.unstable_operations[:get_notebook] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_notebook") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_notebook")) end end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotebooksAPI.get_notebook ...' end # verify the required parameter 'notebook_id' is set if @api_client.config.client_side_validation && notebook_id.nil? fail ArgumentError, "Missing the required parameter 'notebook_id' when calling NotebooksAPI.get_notebook" end # resource path local_var_path = '/api/v1/notebooks/{notebook_id}'.sub('{' + 'notebook_id' + '}', CGI.escape(notebook_id.to_s)) # 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] || 'NotebookResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :get_notebook, :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(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotebooksAPI#get_notebook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all notebooks Get all notebooks. This can also be used to search for notebooks with a particular `query` in the notebook `name` or author `handle`. @param [Hash] opts the optional parameters @option opts [String] :author_handle Return notebooks created by the given `author_handle`. @option opts [String] :exclude_author_handle Return notebooks not created by the given `author_handle`. @option opts [Integer] :start The index of the first notebook you want returned. @option opts [Integer] :count The number of notebooks to be returned. @option opts [String] :sort_field Sort by field `modified` or `name`. (default to 'modified') @option opts [String] :sort_dir Sort by direction `asc` or `desc`. (default to 'desc') @option opts [String] :query Return only notebooks with `query` string in notebook name or author handle. @option opts [Boolean] :include_cells Value of `false` excludes the `cells` and global `time` for each notebook. (default to true) @return [NotebooksResponse]
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 258 def list_notebooks(opts = {}) data, _status_code, _headers = list_notebooks_with_http_info(opts) data end
Get all notebooks Get all notebooks. This can also be used to search for notebooks with a particular `query` in the notebook `name` or author `handle`. @param [Hash] opts the optional parameters @option opts [String] :author_handle Return notebooks created by the given `author_handle`. @option opts [String] :exclude_author_handle Return notebooks not created by the given `author_handle`. @option opts [Integer] :start The index of the first notebook you want returned. @option opts [Integer] :count The number of notebooks to be returned. @option opts [String] :sort_field Sort by field `modified` or `name`. @option opts [String] :sort_dir Sort by direction `asc` or `desc`. @option opts [String] :query Return only notebooks with `query` string in notebook name or author handle. @option opts [Boolean] :include_cells Value of `false` excludes the `cells` and global `time` for each notebook. @return [Array<(NotebooksResponse
, Integer, Hash)>] NotebooksResponse
data, response status code and response headers
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 275 def list_notebooks_with_http_info(opts = {}) if @api_client.config.unstable_operations.has_key?(:list_notebooks) unstable_enabled = @api_client.config.unstable_operations[:list_notebooks] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "list_notebooks") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_notebooks")) end end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotebooksAPI.list_notebooks ...' end # resource path local_var_path = '/api/v1/notebooks' # query parameters query_params = opts[:query_params] || {} query_params[:'author_handle'] = opts[:'author_handle'] if !opts[:'author_handle'].nil? query_params[:'exclude_author_handle'] = opts[:'exclude_author_handle'] if !opts[:'exclude_author_handle'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil? query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil? query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? query_params[:'include_cells'] = opts[:'include_cells'] if !opts[:'include_cells'].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] || 'NotebooksResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :list_notebooks, :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(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotebooksAPI#list_notebooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update a notebook Update a notebook using the specified ID. @param notebook_id [Integer] Unique ID, assigned when you create the notebook. @param body [NotebookUpdateRequest] Update notebook request body. @param [Hash] opts the optional parameters @return [NotebookResponse]
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 343 def update_notebook(notebook_id, body, opts = {}) data, _status_code, _headers = update_notebook_with_http_info(notebook_id, body, opts) data end
Update a notebook Update a notebook using the specified ID. @param notebook_id [Integer] Unique ID, assigned when you create the notebook. @param body [NotebookUpdateRequest] Update notebook request body. @param [Hash] opts the optional parameters @return [Array<(NotebookResponse
, Integer, Hash)>] NotebookResponse
data, response status code and response headers
# File lib/datadog_api_client/v1/api/notebooks_api.rb, line 354 def update_notebook_with_http_info(notebook_id, body, opts = {}) if @api_client.config.unstable_operations.has_key?(:update_notebook) unstable_enabled = @api_client.config.unstable_operations[:update_notebook] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "update_notebook") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_notebook")) end end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NotebooksAPI.update_notebook ...' end # verify the required parameter 'notebook_id' is set if @api_client.config.client_side_validation && notebook_id.nil? fail ArgumentError, "Missing the required parameter 'notebook_id' when calling NotebooksAPI.update_notebook" 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 NotebooksAPI.update_notebook" end # resource path local_var_path = '/api/v1/notebooks/{notebook_id}'.sub('{' + 'notebook_id' + '}', CGI.escape(notebook_id.to_s)) # 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] || 'NotebookResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :update_notebook, :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(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: NotebooksAPI#update_notebook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end