class Nodeum::TaskDestinationsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

create_task_destination(task_id, task_destination_body, opts = {}) click to toggle source

Creates a new task destination. **API Key Scope**: task_destinations / 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_destination_body [TaskDestinationUp] @param [Hash] opts the optional parameters @return [TaskDestinationDown]

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 28
def create_task_destination(task_id, task_destination_body, opts = {})
  data, _status_code, _headers = create_task_destination_with_http_info(task_id, task_destination_body, opts)
  data
end
create_task_destination_with_http_info(task_id, task_destination_body, opts = {}) click to toggle source

Creates a new task destination. **API Key Scope**: task_destinations / 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_destination_body [TaskDestinationUp] @param [Hash] opts the optional parameters @return [Array<(TaskDestinationDown, Integer, Hash)>] TaskDestinationDown data, response status code and response headers

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 39
def create_task_destination_with_http_info(task_id, task_destination_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskDestinationsApi.create_task_destination ...'
  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 TaskDestinationsApi.create_task_destination"
  end
  # verify the required parameter 'task_destination_body' is set
  if @api_client.config.client_side_validation && task_destination_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_body' when calling TaskDestinationsApi.create_task_destination"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_destinations'.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_destination_body) 

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

  # 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: TaskDestinationsApi#create_task_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
destroy_task_destination(task_id, task_destination_id, opts = {}) click to toggle source

Destroys a specific task destination. **API Key Scope**: task_destinations / 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 task_destination_id [Integer] Numeric ID of task destination. @param [Hash] opts the optional parameters @return [nil]

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 98
def destroy_task_destination(task_id, task_destination_id, opts = {})
  destroy_task_destination_with_http_info(task_id, task_destination_id, opts)
  nil
end
destroy_task_destination_with_http_info(task_id, task_destination_id, opts = {}) click to toggle source

Destroys a specific task destination. **API Key Scope**: task_destinations / 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 task_destination_id [Integer] Numeric ID of task destination. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 109
def destroy_task_destination_with_http_info(task_id, task_destination_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskDestinationsApi.destroy_task_destination ...'
  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 TaskDestinationsApi.destroy_task_destination"
  end
  # verify the required parameter 'task_destination_id' is set
  if @api_client.config.client_side_validation && task_destination_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_id' when calling TaskDestinationsApi.destroy_task_destination"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_destinations/{task_destination_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_destination_id' + '}', CGI.escape(task_destination_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: TaskDestinationsApi#destroy_task_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
index_task_destinations(task_id, opts = {}) click to toggle source

Lists all task destinations. **API Key Scope**: task_destinations / index @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 @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] :folder_id Filter on folder id @option opts [String] :tape_id Filter on tape id @option opts [String] :pool_id Filter on a pool id @return [TaskDestinationCollection]

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 170
def index_task_destinations(task_id, opts = {})
  data, _status_code, _headers = index_task_destinations_with_http_info(task_id, opts)
  data
end
index_task_destinations_with_http_info(task_id, opts = {}) click to toggle source

Lists all task destinations. **API Key Scope**: task_destinations / index @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 @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] :folder_id Filter on folder id @option opts [String] :tape_id Filter on tape id @option opts [String] :pool_id Filter on a pool id @return [Array<(TaskDestinationCollection, Integer, Hash)>] TaskDestinationCollection data, response status code and response headers

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 187
def index_task_destinations_with_http_info(task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskDestinationsApi.index_task_destinations ...'
  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 TaskDestinationsApi.index_task_destinations"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_destinations'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  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[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
  query_params[:'tape_id'] = opts[:'tape_id'] if !opts[:'tape_id'].nil?
  query_params[:'pool_id'] = opts[:'pool_id'] if !opts[:'pool_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] || 'TaskDestinationCollection' 

  # 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: TaskDestinationsApi#index_task_destinations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
show_task_destination(task_id, task_destination_id, opts = {}) click to toggle source

Displays a specific task destination. **API Key Scope**: task_destinations / 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 task_destination_id [Integer] Numeric ID of task destination. @param [Hash] opts the optional parameters @return [TaskDestinationDown]

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 247
def show_task_destination(task_id, task_destination_id, opts = {})
  data, _status_code, _headers = show_task_destination_with_http_info(task_id, task_destination_id, opts)
  data
end
show_task_destination_with_http_info(task_id, task_destination_id, opts = {}) click to toggle source

Displays a specific task destination. **API Key Scope**: task_destinations / 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 task_destination_id [Integer] Numeric ID of task destination. @param [Hash] opts the optional parameters @return [Array<(TaskDestinationDown, Integer, Hash)>] TaskDestinationDown data, response status code and response headers

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 258
def show_task_destination_with_http_info(task_id, task_destination_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskDestinationsApi.show_task_destination ...'
  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 TaskDestinationsApi.show_task_destination"
  end
  # verify the required parameter 'task_destination_id' is set
  if @api_client.config.client_side_validation && task_destination_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_id' when calling TaskDestinationsApi.show_task_destination"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_destinations/{task_destination_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_destination_id' + '}', CGI.escape(task_destination_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] || 'TaskDestinationDown' 

  # 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: TaskDestinationsApi#show_task_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_task_destination(task_id, task_destination_id, task_destination_body, opts = {}) click to toggle source

Updates a specific task destination. **API Key Scope**: task_destinations / 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_destination_id [Integer] Numeric ID of task destination. @param task_destination_body [TaskDestinationUp] @param [Hash] opts the optional parameters @return [TaskDestinationDown]

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 316
def update_task_destination(task_id, task_destination_id, task_destination_body, opts = {})
  data, _status_code, _headers = update_task_destination_with_http_info(task_id, task_destination_id, task_destination_body, opts)
  data
end
update_task_destination_with_http_info(task_id, task_destination_id, task_destination_body, opts = {}) click to toggle source

Updates a specific task destination. **API Key Scope**: task_destinations / 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_destination_id [Integer] Numeric ID of task destination. @param task_destination_body [TaskDestinationUp] @param [Hash] opts the optional parameters @return [Array<(TaskDestinationDown, Integer, Hash)>] TaskDestinationDown data, response status code and response headers

# File lib/nodeum_sdk/api/task_destinations_api.rb, line 328
def update_task_destination_with_http_info(task_id, task_destination_id, task_destination_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskDestinationsApi.update_task_destination ...'
  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 TaskDestinationsApi.update_task_destination"
  end
  # verify the required parameter 'task_destination_id' is set
  if @api_client.config.client_side_validation && task_destination_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_id' when calling TaskDestinationsApi.update_task_destination"
  end
  # verify the required parameter 'task_destination_body' is set
  if @api_client.config.client_side_validation && task_destination_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_body' when calling TaskDestinationsApi.update_task_destination"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_destinations/{task_destination_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_destination_id' + '}', CGI.escape(task_destination_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_destination_body) 

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

  # 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: TaskDestinationsApi#update_task_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end