class Nodeum::TaskSchedulesApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/nodeum_sdk/api/task_schedules_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_task_schedule(task_id, task_schedule_body, opts = {}) click to toggle source

Creates a new task schedule. Only one should be created. **API Key Scope**: task_schedules / create @param task_id [String] Numeric ID or name of task. Task names are not unique, it's recommanded to use numeric ID. @param task_schedule_body [TaskSchedule] @param [Hash] opts the optional parameters @return [TaskSchedule]

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 28
def create_task_schedule(task_id, task_schedule_body, opts = {})
  data, _status_code, _headers = create_task_schedule_with_http_info(task_id, task_schedule_body, opts)
  data
end
create_task_schedule_with_http_info(task_id, task_schedule_body, opts = {}) click to toggle source

Creates a new task schedule. Only one should be created. **API Key Scope**: task_schedules / create @param task_id [String] Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID. @param task_schedule_body [TaskSchedule] @param [Hash] opts the optional parameters @return [Array<(TaskSchedule, Integer, Hash)>] TaskSchedule data, response status code and response headers

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 39
def create_task_schedule_with_http_info(task_id, task_schedule_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskSchedulesApi.create_task_schedule ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskSchedulesApi.create_task_schedule"
  end
  # verify the required parameter 'task_schedule_body' is set
  if @api_client.config.client_side_validation && task_schedule_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_schedule_body' when calling TaskSchedulesApi.create_task_schedule"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_schedule'.sub('{' + 'task_id' + '}', CGI.escape(task_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[:body] || @api_client.object_to_http_body(task_schedule_body) 

  # return_type
  return_type = opts[:return_type] || 'TaskSchedule' 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :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: TaskSchedulesApi#create_task_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
destroy_task_schedule(task_id, opts = {}) click to toggle source

Destroys the task schedule. **API Key Scope**: task_schedules / destroy @param task_id [String] Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID. @param [Hash] opts the optional parameters @return [nil]

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 97
def destroy_task_schedule(task_id, opts = {})
  destroy_task_schedule_with_http_info(task_id, opts)
  nil
end
destroy_task_schedule_with_http_info(task_id, opts = {}) click to toggle source

Destroys the task schedule. **API Key Scope**: task_schedules / destroy @param task_id [String] Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 107
def destroy_task_schedule_with_http_info(task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskSchedulesApi.destroy_task_schedule ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskSchedulesApi.destroy_task_schedule"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_schedule'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :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: TaskSchedulesApi#destroy_task_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
index_task_schedules(opts = {}) click to toggle source

Lists all task schedules. **API Key Scope**: task_schedules / index @param [Hash] opts the optional parameters @option opts [Boolean] :with_next Display the next scheduled date, and information about missing executions. (default to true) @option opts [Integer] :limit The number of items to display for pagination. @option opts [Integer] :offset The number of items to skip for pagination. @option opts [Array<String>] :sort_by Sort results by attribute. Can sort on multiple attributes, separated by &#x60;|&#x60;. Order direction can be suffixing the attribute by either &#x60;:asc&#x60; (default) or &#x60;:desc&#x60;. @option opts [String] :id Filter on id @option opts [String] :rrule Filter on RRule of schedule @option opts [String] :done Filter on done schedule @option opts [String] :task_id Filter on task id @return [TaskScheduleCollection]

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 164
def index_task_schedules(opts = {})
  data, _status_code, _headers = index_task_schedules_with_http_info(opts)
  data
end
index_task_schedules_with_http_info(opts = {}) click to toggle source

Lists all task schedules. **API Key Scope**: task_schedules / index @param [Hash] opts the optional parameters @option opts [Boolean] :with_next Display the next scheduled date, and information about missing executions. @option opts [Integer] :limit The number of items to display for pagination. @option opts [Integer] :offset The number of items to skip for pagination. @option opts [Array<String>] :sort_by Sort results by attribute. Can sort on multiple attributes, separated by &#x60;|&#x60;. Order direction can be suffixing the attribute by either &#x60;:asc&#x60; (default) or &#x60;:desc&#x60;. @option opts [String] :id Filter on id @option opts [String] :rrule Filter on RRule of schedule @option opts [String] :done Filter on done schedule @option opts [String] :task_id Filter on task id @return [Array<(TaskScheduleCollection, Integer, Hash)>] TaskScheduleCollection data, response status code and response headers

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 181
def index_task_schedules_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskSchedulesApi.index_task_schedules ...'
  end
  # resource path
  local_var_path = '/task_schedules'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'with_next'] = opts[:'with_next'] if !opts[:'with_next'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'rrule'] = opts[:'rrule'] if !opts[:'rrule'].nil?
  query_params[:'done'] = opts[:'done'] if !opts[:'done'].nil?
  query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].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[:body] 

  # return_type
  return_type = opts[:return_type] || 'TaskScheduleCollection' 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :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: TaskSchedulesApi#index_task_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
show_task_schedule(task_id, opts = {}) click to toggle source

Displays the task schedule. **API Key Scope**: task_schedules / show @param task_id [String] Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID. @param [Hash] opts the optional parameters @return [TaskSchedule]

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 237
def show_task_schedule(task_id, opts = {})
  data, _status_code, _headers = show_task_schedule_with_http_info(task_id, opts)
  data
end
show_task_schedule_with_http_info(task_id, opts = {}) click to toggle source

Displays the task schedule. **API Key Scope**: task_schedules / show @param task_id [String] Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID. @param [Hash] opts the optional parameters @return [Array<(TaskSchedule, Integer, Hash)>] TaskSchedule data, response status code and response headers

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 247
def show_task_schedule_with_http_info(task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskSchedulesApi.show_task_schedule ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskSchedulesApi.show_task_schedule"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_schedule'.sub('{' + 'task_id' + '}', CGI.escape(task_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[:body] 

  # return_type
  return_type = opts[:return_type] || 'TaskSchedule' 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :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: TaskSchedulesApi#show_task_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_task_schedule(task_id, task_schedule_body, opts = {}) click to toggle source

Updates the existing task schedule. **API Key Scope**: task_schedules / update @param task_id [String] Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID. @param task_schedule_body [TaskSchedule] @param [Hash] opts the optional parameters @return [TaskSchedule]

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 300
def update_task_schedule(task_id, task_schedule_body, opts = {})
  data, _status_code, _headers = update_task_schedule_with_http_info(task_id, task_schedule_body, opts)
  data
end
update_task_schedule_with_http_info(task_id, task_schedule_body, opts = {}) click to toggle source

Updates the existing task schedule. **API Key Scope**: task_schedules / update @param task_id [String] Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID. @param task_schedule_body [TaskSchedule] @param [Hash] opts the optional parameters @return [Array<(TaskSchedule, Integer, Hash)>] TaskSchedule data, response status code and response headers

# File lib/nodeum_sdk/api/task_schedules_api.rb, line 311
def update_task_schedule_with_http_info(task_id, task_schedule_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskSchedulesApi.update_task_schedule ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskSchedulesApi.update_task_schedule"
  end
  # verify the required parameter 'task_schedule_body' is set
  if @api_client.config.client_side_validation && task_schedule_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_schedule_body' when calling TaskSchedulesApi.update_task_schedule"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_schedule'.sub('{' + 'task_id' + '}', CGI.escape(task_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[:body] || @api_client.object_to_http_body(task_schedule_body) 

  # return_type
  return_type = opts[:return_type] || 'TaskSchedule' 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :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: TaskSchedulesApi#update_task_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end