class SwaggerClient::ReplicationApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

get_replication_execution(id, opts = {}) click to toggle source

Get the specific replication execution Get the replication execution specified by ID @param id The ID of the execution. @param [Hash] opts the optional parameters @return [ReplicationExecution]

# File lib/harbor_swagger_client/api/replication_api.rb, line 27
def get_replication_execution(id, opts = {})
  data, _status_code, _headers = get_replication_execution_with_http_info(id, opts)
  data
end
get_replication_execution_with_http_info(id, opts = {}) click to toggle source

Get the specific replication execution Get the replication execution specified by ID @param id The ID of the execution. @param [Hash] opts the optional parameters @return [Array<(ReplicationExecution, Fixnum, Hash)>] ReplicationExecution data, response status code and response headers

# File lib/harbor_swagger_client/api/replication_api.rb, line 37
def get_replication_execution_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReplicationApi.get_replication_execution ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ReplicationApi.get_replication_execution"
  end
  # resource path
  local_var_path = '/replication/executions/{id}'.sub('{' + 'id' + '}', id.to_s)

  # 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 = nil
  auth_names = ['basic']
  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 => 'ReplicationExecution')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReplicationApi#get_replication_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_replication_log(id, task_id, opts = {}) click to toggle source

Get the log of the specific replication task Get the log of the specific replication task @param id The ID of the execution that the tasks belongs to. @param task_id The ID of the task. @param [Hash] opts the optional parameters @return [String]

# File lib/harbor_swagger_client/api/replication_api.rb, line 82
def get_replication_log(id, task_id, opts = {})
  data, _status_code, _headers = get_replication_log_with_http_info(id, task_id, opts)
  data
end
get_replication_log_with_http_info(id, task_id, opts = {}) click to toggle source

Get the log of the specific replication task Get the log of the specific replication task @param id The ID of the execution that the tasks belongs to. @param task_id The ID of the task. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/harbor_swagger_client/api/replication_api.rb, line 93
def get_replication_log_with_http_info(id, task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReplicationApi.get_replication_log ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ReplicationApi.get_replication_log"
  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 ReplicationApi.get_replication_log"
  end
  # resource path
  local_var_path = '/replication/executions/{id}/tasks/{task_id}/log'.sub('{' + 'id' + '}', id.to_s).sub('{' + 'task_id' + '}', task_id.to_s)

  # 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 = nil
  auth_names = ['basic']
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReplicationApi#get_replication_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_replication_executions(opts = {}) click to toggle source

List replication executions List replication executions @param [Hash] opts the optional parameters @option opts [Integer] :page The page number (default to 1) @option opts [Integer] :page_size The size of per page (default to 10) @option opts [Integer] :policy_id The ID of the policy that the executions belong to. @option opts [String] :status The execution status. @option opts [String] :trigger The trigger mode. @return [Array<ReplicationExecution>]

# File lib/harbor_swagger_client/api/replication_api.rb, line 145
def list_replication_executions(opts = {})
  data, _status_code, _headers = list_replication_executions_with_http_info(opts)
  data
end
list_replication_executions_with_http_info(opts = {}) click to toggle source

List replication executions List replication executions @param [Hash] opts the optional parameters @option opts [Integer] :page The page number @option opts [Integer] :page_size The size of per page @option opts [Integer] :policy_id The ID of the policy that the executions belong to. @option opts [String] :status The execution status. @option opts [String] :trigger The trigger mode. @return [Array<(Array<ReplicationExecution>, Fixnum, Hash)>] Array<ReplicationExecution> data, response status code and response headers

# File lib/harbor_swagger_client/api/replication_api.rb, line 159
def list_replication_executions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReplicationApi.list_replication_executions ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ReplicationApi.list_replication_executions, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/replication/executions'

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'policy_id'] = opts[:'policy_id'] if !opts[:'policy_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'trigger'] = opts[:'trigger'] if !opts[:'trigger'].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 = ['basic']
  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 => 'Array<ReplicationExecution>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReplicationApi#list_replication_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_replication_tasks(id, opts = {}) click to toggle source

List replication tasks for a specific execution List replication tasks for a specific execution @param id The ID of the execution that the tasks belongs to. @param [Hash] opts the optional parameters @option opts [Integer] :page The page number (default to 1) @option opts [Integer] :page_size The size of per page (default to 10) @option opts [String] :status The task status. @option opts [String] :resource_type The resource type. @return [Array<ReplicationTask>]

# File lib/harbor_swagger_client/api/replication_api.rb, line 212
def list_replication_tasks(id, opts = {})
  data, _status_code, _headers = list_replication_tasks_with_http_info(id, opts)
  data
end
list_replication_tasks_with_http_info(id, opts = {}) click to toggle source

List replication tasks for a specific execution List replication tasks for a specific execution @param id The ID of the execution that the tasks belongs to. @param [Hash] opts the optional parameters @option opts [Integer] :page The page number @option opts [Integer] :page_size The size of per page @option opts [String] :status The task status. @option opts [String] :resource_type The resource type. @return [Array<(Array<ReplicationTask>, Fixnum, Hash)>] Array<ReplicationTask> data, response status code and response headers

# File lib/harbor_swagger_client/api/replication_api.rb, line 226
def list_replication_tasks_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReplicationApi.list_replication_tasks ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ReplicationApi.list_replication_tasks"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ReplicationApi.list_replication_tasks, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/replication/executions/{id}/tasks'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'resource_type'] = opts[:'resource_type'] if !opts[:'resource_type'].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 = ['basic']
  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 => 'Array<ReplicationTask>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReplicationApi#list_replication_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
start_replication(execution, opts = {}) click to toggle source

Start one replication execution Start one replication execution according to the policy @param execution The ID of policy that the execution belongs to @param [Hash] opts the optional parameters @return [nil]

# File lib/harbor_swagger_client/api/replication_api.rb, line 278
def start_replication(execution, opts = {})
  start_replication_with_http_info(execution, opts)
  nil
end
start_replication_with_http_info(execution, opts = {}) click to toggle source

Start one replication execution Start one replication execution according to the policy @param execution The ID of policy that the execution belongs to @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/harbor_swagger_client/api/replication_api.rb, line 288
def start_replication_with_http_info(execution, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReplicationApi.start_replication ...'
  end
  # verify the required parameter 'execution' is set
  if @api_client.config.client_side_validation && execution.nil?
    fail ArgumentError, "Missing the required parameter 'execution' when calling ReplicationApi.start_replication"
  end
  # resource path
  local_var_path = '/replication/executions'

  # 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(execution)
  auth_names = ['basic']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReplicationApi#start_replication\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
stop_replication(id, opts = {}) click to toggle source

Stop the specific replication execution Stop the replication execution specified by ID @param id The ID of the execution. @param [Hash] opts the optional parameters @return [nil]

# File lib/harbor_swagger_client/api/replication_api.rb, line 331
def stop_replication(id, opts = {})
  stop_replication_with_http_info(id, opts)
  nil
end
stop_replication_with_http_info(id, opts = {}) click to toggle source

Stop the specific replication execution Stop the replication execution specified by ID @param id The ID of the execution. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/harbor_swagger_client/api/replication_api.rb, line 341
def stop_replication_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReplicationApi.stop_replication ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ReplicationApi.stop_replication"
  end
  # resource path
  local_var_path = '/replication/executions/{id}'.sub('{' + 'id' + '}', id.to_s)

  # 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 = nil
  auth_names = ['basic']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReplicationApi#stop_replication\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end