=begin #AllQ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.32 =end require 'uri' module Allq class ActionsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Bury # Bury Job # @param job_id Job ID # @param [Hash] opts the optional parameters # @return [BasicResponse] def bury_put(job_id, opts = {}) data, _status_code, _headers = bury_put_with_http_info(job_id, opts) data end # Bury # Bury Job # @param job_id Job ID # @param [Hash] opts the optional parameters # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers def bury_put_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.bury_put ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.bury_put" end # resource path local_var_path = '/bury' # query parameters query_params = {} query_params[:'job_id'] = job_id # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BasicResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#bury_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete # Finished Job # @param job_id Job ID # @param [Hash] opts the optional parameters # @option opts [String] :tube Name of Tube (For deleting \"ready\" objects) # @return [BasicResponse] def job_delete(job_id, opts = {}) data, _status_code, _headers = job_delete_with_http_info(job_id, opts) data end # Delete # Finished Job # @param job_id Job ID # @param [Hash] opts the optional parameters # @option opts [String] :tube Name of Tube (For deleting \"ready\" objects) # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers def job_delete_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.job_delete ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.job_delete" end # resource path local_var_path = '/job' # query parameters query_params = {} query_params[:'job_id'] = job_id query_params[:'tube'] = opts[:'tube'] if !opts[:'tube'].nil? # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BasicResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#job_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Job # Get job from queue # @param tube Name of tube # @param [Hash] opts the optional parameters # @option opts [String] :delete Delete on get # @return [JobResponse] def job_get(tube, opts = {}) data, _status_code, _headers = job_get_with_http_info(tube, opts) data end # Job # Get job from queue # @param tube Name of tube # @param [Hash] opts the optional parameters # @option opts [String] :delete Delete on get # @return [Array<(JobResponse, Fixnum, Hash)>] JobResponse data, response status code and response headers def job_get_with_http_info(tube, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.job_get ...' end # verify the required parameter 'tube' is set if @api_client.config.client_side_validation && tube.nil? fail ArgumentError, "Missing the required parameter 'tube' when calling ActionsApi.job_get" end # resource path local_var_path = '/job' # query parameters query_params = {} query_params[:'tube'] = tube query_params[:'delete'] = opts[:'delete'] if !opts[:'delete'].nil? # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'JobResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#job_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Job # Put job into queue # @param new_job New Job Object # @param [Hash] opts the optional parameters # @return [JobRef] def job_post(new_job, opts = {}) data, _status_code, _headers = job_post_with_http_info(new_job, opts) data end # Job # Put job into queue # @param new_job New Job Object # @param [Hash] opts the optional parameters # @return [Array<(JobRef, Fixnum, Hash)>] JobRef data, response status code and response headers def job_post_with_http_info(new_job, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.job_post ...' end # verify the required parameter 'new_job' is set if @api_client.config.client_side_validation && new_job.nil? fail ArgumentError, "Missing the required parameter 'new_job' when calling ActionsApi.job_post" end # resource path local_var_path = '/job' # query parameters query_params = {} # header parameters 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 = {} # http body (model) post_body = @api_client.object_to_http_body(new_job) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'JobRef') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#job_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Kicj # Kick Job # @param tube Job ID # @param [Hash] opts the optional parameters # @return [BasicResponse] def kick_put(tube, opts = {}) data, _status_code, _headers = kick_put_with_http_info(tube, opts) data end # Kicj # Kick Job # @param tube Job ID # @param [Hash] opts the optional parameters # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers def kick_put_with_http_info(tube, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.kick_put ...' end # verify the required parameter 'tube' is set if @api_client.config.client_side_validation && tube.nil? fail ArgumentError, "Missing the required parameter 'tube' when calling ActionsApi.kick_put" end # resource path local_var_path = '/kick' # query parameters query_params = {} query_params[:'tube'] = tube # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BasicResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#kick_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Multiple Job # Get multiple jobs from queue # @param tube Name of tube # @param count Max number of reults # @param [Hash] opts the optional parameters # @option opts [String] :delete Delete on get # @return [MultipleJobResponse] def multiple_job_get(tube, count, opts = {}) data, _status_code, _headers = multiple_job_get_with_http_info(tube, count, opts) data end # Multiple Job # Get multiple jobs from queue # @param tube Name of tube # @param count Max number of reults # @param [Hash] opts the optional parameters # @option opts [String] :delete Delete on get # @return [Array<(MultipleJobResponse, Fixnum, Hash)>] MultipleJobResponse data, response status code and response headers def multiple_job_get_with_http_info(tube, count, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.multiple_job_get ...' end # verify the required parameter 'tube' is set if @api_client.config.client_side_validation && tube.nil? fail ArgumentError, "Missing the required parameter 'tube' when calling ActionsApi.multiple_job_get" end # verify the required parameter 'count' is set if @api_client.config.client_side_validation && count.nil? fail ArgumentError, "Missing the required parameter 'count' when calling ActionsApi.multiple_job_get" end # resource path local_var_path = '/multiple_job' # query parameters query_params = {} query_params[:'tube'] = tube query_params[:'count'] = count query_params[:'delete'] = opts[:'delete'] if !opts[:'delete'].nil? # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'MultipleJobResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#multiple_job_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Parent Job # Create a parent job # @param new_parent_job New Parent Job Data # @param [Hash] opts the optional parameters # @return [JobRef] def parent_job_post(new_parent_job, opts = {}) data, _status_code, _headers = parent_job_post_with_http_info(new_parent_job, opts) data end # Parent Job # Create a parent job # @param new_parent_job New Parent Job Data # @param [Hash] opts the optional parameters # @return [Array<(JobRef, Fixnum, Hash)>] JobRef data, response status code and response headers def parent_job_post_with_http_info(new_parent_job, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.parent_job_post ...' end # verify the required parameter 'new_parent_job' is set if @api_client.config.client_side_validation && new_parent_job.nil? fail ArgumentError, "Missing the required parameter 'new_parent_job' when calling ActionsApi.parent_job_post" end # resource path local_var_path = '/parent_job' # query parameters query_params = {} # header parameters 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 = {} # http body (model) post_body = @api_client.object_to_http_body(new_parent_job) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'JobRef') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#parent_job_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Peek # Peek at next job # @param tube Tube name # @param [Hash] opts the optional parameters # @option opts [String] :buried Look in buried (default to false) # @option opts [String] :offset Offset from start (default to 0) # @return [JobResponse] def peek_get(tube, opts = {}) data, _status_code, _headers = peek_get_with_http_info(tube, opts) data end # Peek # Peek at next job # @param tube Tube name # @param [Hash] opts the optional parameters # @option opts [String] :buried Look in buried # @option opts [String] :offset Offset from start # @return [Array<(JobResponse, Fixnum, Hash)>] JobResponse data, response status code and response headers def peek_get_with_http_info(tube, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.peek_get ...' end # verify the required parameter 'tube' is set if @api_client.config.client_side_validation && tube.nil? fail ArgumentError, "Missing the required parameter 'tube' when calling ActionsApi.peek_get" end # resource path local_var_path = '/peek' # query parameters query_params = {} query_params[:'tube'] = tube query_params[:'buried'] = opts[:'buried'] if !opts[:'buried'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'JobResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#peek_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Release # Releases job back into queue # @param job_id Job ID # @param [Hash] opts the optional parameters # @option opts [Integer] :delay Delay for re-enqueue # @return [BasicResponse] def release_put(job_id, opts = {}) data, _status_code, _headers = release_put_with_http_info(job_id, opts) data end # Release # Releases job back into queue # @param job_id Job ID # @param [Hash] opts the optional parameters # @option opts [Integer] :delay Delay for re-enqueue # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers def release_put_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.release_put ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.release_put" end # resource path local_var_path = '/release' # query parameters query_params = {} query_params[:'job_id'] = job_id query_params[:'delay'] = opts[:'delay'] if !opts[:'delay'].nil? # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BasicResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#release_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Set Children Started # When a parent job doesn't know how many children are going to be added, this is the event that sets the final children count on the parent_job, allowing it to run when the children are done. # @param job_id Job ID # @param [Hash] opts the optional parameters # @option opts [String] :force_now Force parent to start now # @return [BasicResponse] def set_children_started_put(job_id, opts = {}) data, _status_code, _headers = set_children_started_put_with_http_info(job_id, opts) data end # Set Children Started # When a parent job doesn't know how many children are going to be added, this is the event that sets the final children count on the parent_job, allowing it to run when the children are done. # @param job_id Job ID # @param [Hash] opts the optional parameters # @option opts [String] :force_now Force parent to start now # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers def set_children_started_put_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.set_children_started_put ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.set_children_started_put" end # resource path local_var_path = '/set_children_started' # query parameters query_params = {} query_params[:'job_id'] = job_id query_params[:'force_now'] = opts[:'force_now'] if !opts[:'force_now'].nil? # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BasicResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#set_children_started_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Throttle # Creates a throttle on a tube # @param throttle Throttle info # @param [Hash] opts the optional parameters # @return [TubeRef] def throttle_post(throttle, opts = {}) data, _status_code, _headers = throttle_post_with_http_info(throttle, opts) data end # Throttle # Creates a throttle on a tube # @param throttle Throttle info # @param [Hash] opts the optional parameters # @return [Array<(TubeRef, Fixnum, Hash)>] TubeRef data, response status code and response headers def throttle_post_with_http_info(throttle, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.throttle_post ...' end # verify the required parameter 'throttle' is set if @api_client.config.client_side_validation && throttle.nil? fail ArgumentError, "Missing the required parameter 'throttle' when calling ActionsApi.throttle_post" end # resource path local_var_path = '/throttle' # query parameters query_params = {} # header parameters 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 = {} # http body (model) post_body = @api_client.object_to_http_body(throttle) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TubeRef') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#throttle_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Touch # Touch job # @param job_id Job ID # @param [Hash] opts the optional parameters # @return [BasicResponse] def touch_put(job_id, opts = {}) data, _status_code, _headers = touch_put_with_http_info(job_id, opts) data end # Touch # Touch job # @param job_id Job ID # @param [Hash] opts the optional parameters # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers def touch_put_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.touch_put ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.touch_put" end # resource path local_var_path = '/touch' # query parameters query_params = {} query_params[:'job_id'] = job_id # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BasicResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#touch_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Clear Tube # Delete all contents of tube # @param tube Tube Name # @param [Hash] opts the optional parameters # @return [BasicResponse] def tube_delete(tube, opts = {}) data, _status_code, _headers = tube_delete_with_http_info(tube, opts) data end # Clear Tube # Delete all contents of tube # @param tube Tube Name # @param [Hash] opts the optional parameters # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers def tube_delete_with_http_info(tube, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActionsApi.tube_delete ...' end # verify the required parameter 'tube' is set if @api_client.config.client_side_validation && tube.nil? fail ArgumentError, "Missing the required parameter 'tube' when calling ActionsApi.tube_delete" end # resource path local_var_path = '/tube' # query parameters query_params = {} query_params[:'tube'] = tube # header parameters 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 = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BasicResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ActionsApi#tube_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end