=begin #Datadog API V1 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020-Present Datadog, Inc. =end require 'cgi' module DatadogAPIClient::V1 class LogsPipelinesAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end # Create a pipeline. # # @see #create_logs_pipeline_with_http_info def create_logs_pipeline(body, opts = {}) data, _status_code, _headers = create_logs_pipeline_with_http_info(body, opts) data end # Create a pipeline. # # Create a pipeline in your organization. # # @param body [LogsPipeline] Definition of the new pipeline. # @param opts [Hash] the optional parameters # @return [Array<(LogsPipeline, Integer, Hash)>] LogsPipeline data, response status code and response headers def create_logs_pipeline_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsPipelinesAPI.create_logs_pipeline ...' 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 LogsPipelinesAPI.create_logs_pipeline" end # resource path local_var_path = '/api/v1/logs/config/pipelines' # 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] || 'LogsPipeline' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :create_logs_pipeline, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsPipelinesAPI#create_logs_pipeline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a pipeline. # # @see #delete_logs_pipeline_with_http_info def delete_logs_pipeline(pipeline_id, opts = {}) delete_logs_pipeline_with_http_info(pipeline_id, opts) nil end # Delete a pipeline. # # Delete a given pipeline from your organization. # This endpoint takes no JSON arguments. # # @param pipeline_id [String] ID of the pipeline to delete. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_logs_pipeline_with_http_info(pipeline_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsPipelinesAPI.delete_logs_pipeline ...' end # verify the required parameter 'pipeline_id' is set if @api_client.config.client_side_validation && pipeline_id.nil? fail ArgumentError, "Missing the required parameter 'pipeline_id' when calling LogsPipelinesAPI.delete_logs_pipeline" end # resource path local_var_path = '/api/v1/logs/config/pipelines/{pipeline_id}'.sub('{pipeline_id}', CGI.escape(pipeline_id.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] new_options = opts.merge( :operation => :delete_logs_pipeline, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsPipelinesAPI#delete_logs_pipeline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a pipeline. # # @see #get_logs_pipeline_with_http_info def get_logs_pipeline(pipeline_id, opts = {}) data, _status_code, _headers = get_logs_pipeline_with_http_info(pipeline_id, opts) data end # Get a pipeline. # # Get a specific pipeline from your organization. # This endpoint takes no JSON arguments. # # @param pipeline_id [String] ID of the pipeline to get. # @param opts [Hash] the optional parameters # @return [Array<(LogsPipeline, Integer, Hash)>] LogsPipeline data, response status code and response headers def get_logs_pipeline_with_http_info(pipeline_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsPipelinesAPI.get_logs_pipeline ...' end # verify the required parameter 'pipeline_id' is set if @api_client.config.client_side_validation && pipeline_id.nil? fail ArgumentError, "Missing the required parameter 'pipeline_id' when calling LogsPipelinesAPI.get_logs_pipeline" end # resource path local_var_path = '/api/v1/logs/config/pipelines/{pipeline_id}'.sub('{pipeline_id}', CGI.escape(pipeline_id.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] || 'LogsPipeline' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :get_logs_pipeline, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsPipelinesAPI#get_logs_pipeline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get pipeline order. # # @see #get_logs_pipeline_order_with_http_info def get_logs_pipeline_order(opts = {}) data, _status_code, _headers = get_logs_pipeline_order_with_http_info(opts) data end # Get pipeline order. # # Get the current order of your pipelines. # This endpoint takes no JSON arguments. # # @param opts [Hash] the optional parameters # @return [Array<(LogsPipelinesOrder, Integer, Hash)>] LogsPipelinesOrder data, response status code and response headers def get_logs_pipeline_order_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsPipelinesAPI.get_logs_pipeline_order ...' end # resource path local_var_path = '/api/v1/logs/config/pipeline-order' # 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] || 'LogsPipelinesOrder' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :get_logs_pipeline_order, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsPipelinesAPI#get_logs_pipeline_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all pipelines. # # @see #list_logs_pipelines_with_http_info def list_logs_pipelines(opts = {}) data, _status_code, _headers = list_logs_pipelines_with_http_info(opts) data end # Get all pipelines. # # Get all pipelines from your organization. # This endpoint takes no JSON arguments. # # @param opts [Hash] the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_logs_pipelines_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsPipelinesAPI.list_logs_pipelines ...' end # resource path local_var_path = '/api/v1/logs/config/pipelines' # 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] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :list_logs_pipelines, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsPipelinesAPI#list_logs_pipelines\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a pipeline. # # @see #update_logs_pipeline_with_http_info def update_logs_pipeline(pipeline_id, body, opts = {}) data, _status_code, _headers = update_logs_pipeline_with_http_info(pipeline_id, body, opts) data end # Update a pipeline. # # Update a given pipeline configuration to change it’s processors or their order. # # **Note**: Using this method updates your pipeline configuration by **replacing** # your current configuration with the new one sent to your Datadog organization. # # @param pipeline_id [String] ID of the pipeline to delete. # @param body [LogsPipeline] New definition of the pipeline. # @param opts [Hash] the optional parameters # @return [Array<(LogsPipeline, Integer, Hash)>] LogsPipeline data, response status code and response headers def update_logs_pipeline_with_http_info(pipeline_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsPipelinesAPI.update_logs_pipeline ...' end # verify the required parameter 'pipeline_id' is set if @api_client.config.client_side_validation && pipeline_id.nil? fail ArgumentError, "Missing the required parameter 'pipeline_id' when calling LogsPipelinesAPI.update_logs_pipeline" 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 LogsPipelinesAPI.update_logs_pipeline" end # resource path local_var_path = '/api/v1/logs/config/pipelines/{pipeline_id}'.sub('{pipeline_id}', CGI.escape(pipeline_id.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] || 'LogsPipeline' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :update_logs_pipeline, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsPipelinesAPI#update_logs_pipeline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update pipeline order. # # @see #update_logs_pipeline_order_with_http_info def update_logs_pipeline_order(body, opts = {}) data, _status_code, _headers = update_logs_pipeline_order_with_http_info(body, opts) data end # Update pipeline order. # # Update the order of your pipelines. Since logs are processed sequentially, reordering a pipeline may change # the structure and content of the data processed by other pipelines and their processors. # # **Note**: Using the `PUT` method updates your pipeline order by replacing your current order # with the new one sent to your Datadog organization. # # @param body [LogsPipelinesOrder] Object containing the new ordered list of pipeline IDs. # @param opts [Hash] the optional parameters # @return [Array<(LogsPipelinesOrder, Integer, Hash)>] LogsPipelinesOrder data, response status code and response headers def update_logs_pipeline_order_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsPipelinesAPI.update_logs_pipeline_order ...' 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 LogsPipelinesAPI.update_logs_pipeline_order" end # resource path local_var_path = '/api/v1/logs/config/pipeline-order' # 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] || 'LogsPipelinesOrder' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :update_logs_pipeline_order, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsPipelinesAPI#update_logs_pipeline_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end