Class: SwaggerClient::ReplicationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/harbor_swagger_client/api/replication_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ReplicationApi

Returns a new instance of ReplicationApi.



19
20
21
# File 'lib/harbor_swagger_client/api/replication_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/harbor_swagger_client/api/replication_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_replication_execution(id, opts = {}) ⇒ ReplicationExecution

Get the specific replication execution Get the replication execution specified by ID

Parameters:

  • id

    The ID of the execution.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# 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 = {}) ⇒ Array<(ReplicationExecution, Fixnum, Hash)>

Get the specific replication execution Get the replication execution specified by ID

Parameters:

  • id

    The ID of the execution.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ReplicationExecution, Fixnum, Hash)>)

    ReplicationExecution data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# 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 = {}) ⇒ String

Get the log of the specific replication task Get the log of the specific replication task

Parameters:

  • id

    The ID of the execution that the tasks belongs to.

  • task_id

    The ID of the task.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


82
83
84
85
# 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 = {}) ⇒ Array<(String, Fixnum, Hash)>

Get the log of the specific replication task Get the log of the specific replication task

Parameters:

  • id

    The ID of the execution that the tasks belongs to.

  • task_id

    The ID of the task.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# 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 = {}) ⇒ Array<ReplicationExecution>

List replication executions List replication executions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page number (default to 1)

  • :page_size (Integer)

    The size of per page (default to 10)

  • :policy_id (Integer)

    The ID of the policy that the executions belong to.

  • :status (String)

    The execution status.

  • :trigger (String)

    The trigger mode.

Returns:



145
146
147
148
# 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 = {}) ⇒ Array<(Array<ReplicationExecution>, Fixnum, Hash)>

List replication executions List replication executions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page number

  • :page_size (Integer)

    The size of per page

  • :policy_id (Integer)

    The ID of the policy that the executions belong to.

  • :status (String)

    The execution status.

  • :trigger (String)

    The trigger mode.

Returns:

  • (Array<(Array<ReplicationExecution>, Fixnum, Hash)>)

    Array<ReplicationExecution> data, response status code and response headers



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# 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 = {}) ⇒ Array<ReplicationTask>

List replication tasks for a specific execution List replication tasks for a specific execution

Parameters:

  • id

    The ID of the execution that the tasks belongs to.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page number (default to 1)

  • :page_size (Integer)

    The size of per page (default to 10)

  • :status (String)

    The task status.

  • :resource_type (String)

    The resource type.

Returns:



212
213
214
215
# 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 = {}) ⇒ Array<(Array<ReplicationTask>, Fixnum, Hash)>

List replication tasks for a specific execution List replication tasks for a specific execution

Parameters:

  • id

    The ID of the execution that the tasks belongs to.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page number

  • :page_size (Integer)

    The size of per page

  • :status (String)

    The task status.

  • :resource_type (String)

    The resource type.

Returns:

  • (Array<(Array<ReplicationTask>, Fixnum, Hash)>)

    Array<ReplicationTask> data, response status code and response headers



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# 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 = {}) ⇒ nil

Start one replication execution Start one replication execution according to the policy

Parameters:

  • execution

    The ID of policy that the execution belongs to

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


278
279
280
281
# 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 = {}) ⇒ Array<(nil, Fixnum, Hash)>

Start one replication execution Start one replication execution according to the policy

Parameters:

  • execution

    The ID of policy that the execution belongs to

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# 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 = {}) ⇒ nil

Stop the specific replication execution Stop the replication execution specified by ID

Parameters:

  • id

    The ID of the execution.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


331
332
333
334
# 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 = {}) ⇒ Array<(nil, Fixnum, Hash)>

Stop the specific replication execution Stop the replication execution specified by ID

Parameters:

  • id

    The ID of the execution.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# 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