Class: Harbor2Client::RetentionApi

Inherits:
Object
  • Object
show all
Defined in:
lib/harbor2_client/api/retention_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RetentionApi

Returns a new instance of RetentionApi.



19
20
21
# File 'lib/harbor2_client/api/retention_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/harbor2_client/api/retention_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_retention(policy, opts = {}) ⇒ nil

Create Retention Policy Create Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when no retention policy binded to project yet.

Parameters:

  • policy

    Create Retention Policy successfully.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


28
29
30
31
# File 'lib/harbor2_client/api/retention_api.rb', line 28

def create_retention(policy, opts = {})
  create_retention_with_http_info(policy, opts)
  nil
end

#create_retention_with_http_info(policy, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create Retention Policy Create Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when no retention policy binded to project yet.

Parameters:

  • policy

    Create Retention Policy successfully.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

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

    nil, response status code and response headers



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
76
77
78
79
80
81
# File 'lib/harbor2_client/api/retention_api.rb', line 39

def create_retention_with_http_info(policy, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.create_retention ...'
  end
  # verify the required parameter 'policy' is set
  if @api_client.config.client_side_validation && policy.nil?
    fail ArgumentError, "Missing the required parameter 'policy' when calling RetentionApi.create_retention"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.create_retention, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/retentions'

  # 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'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(policy)
  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: RetentionApi#create_retention\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_retention(id, opts = {}) ⇒ nil

Delete Retention Policy Delete Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when retention policy has already binded to project.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


88
89
90
91
# File 'lib/harbor2_client/api/retention_api.rb', line 88

def delete_retention(id, opts = {})
  delete_retention_with_http_info(id, opts)
  nil
end

#delete_retention_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete Retention Policy Delete Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when retention policy has already binded to project.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

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

    nil, response status code and response headers



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
136
137
138
139
140
141
# File 'lib/harbor2_client/api/retention_api.rb', line 99

def delete_retention_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.delete_retention ...'
  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 RetentionApi.delete_retention"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.delete_retention, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/retentions/{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'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

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

#get_rentenition_metadata(opts = {}) ⇒ RetentionMetadata

Get Retention Metadatas Get Retention Metadatas.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:



147
148
149
150
# File 'lib/harbor2_client/api/retention_api.rb', line 147

def (opts = {})
  data, _status_code, _headers = (opts)
  data
end

#get_rentenition_metadata_with_http_info(opts = {}) ⇒ Array<(RetentionMetadata, Fixnum, Hash)>

Get Retention Metadatas Get Retention Metadatas.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

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

    RetentionMetadata data, response status code and response headers



157
158
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
# File 'lib/harbor2_client/api/retention_api.rb', line 157

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.get_rentenition_metadata ...'
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.get_rentenition_metadata, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/retentions/metadatas'

  # 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'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # 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 => 'RetentionMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RetentionApi#get_rentenition_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_retention(id, opts = {}) ⇒ RetentionPolicy

Get Retention Policy Get Retention Policy.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:



203
204
205
206
# File 'lib/harbor2_client/api/retention_api.rb', line 203

def get_retention(id, opts = {})
  data, _status_code, _headers = get_retention_with_http_info(id, opts)
  data
end

#get_retention_task_log(id, eid, tid, opts = {}) ⇒ String

Get Retention job task log Get Retention job task log, tags ratain or deletion detail will be shown in a table.

Parameters:

  • id

    Retention ID.

  • eid

    Retention execution ID.

  • tid

    Retention execution ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (String)


266
267
268
269
# File 'lib/harbor2_client/api/retention_api.rb', line 266

def get_retention_task_log(id, eid, tid, opts = {})
  data, _status_code, _headers = get_retention_task_log_with_http_info(id, eid, tid, opts)
  data
end

#get_retention_task_log_with_http_info(id, eid, tid, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get Retention job task log Get Retention job task log, tags ratain or deletion detail will be shown in a table.

Parameters:

  • id

    Retention ID.

  • eid

    Retention execution ID.

  • tid

    Retention execution ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

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

    String data, response status code and response headers



279
280
281
282
283
284
285
286
287
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
326
327
328
329
330
# File 'lib/harbor2_client/api/retention_api.rb', line 279

def get_retention_task_log_with_http_info(id, eid, tid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.get_retention_task_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 RetentionApi.get_retention_task_log"
  end
  # verify the required parameter 'eid' is set
  if @api_client.config.client_side_validation && eid.nil?
    fail ArgumentError, "Missing the required parameter 'eid' when calling RetentionApi.get_retention_task_log"
  end
  # verify the required parameter 'tid' is set
  if @api_client.config.client_side_validation && tid.nil?
    fail ArgumentError, "Missing the required parameter 'tid' when calling RetentionApi.get_retention_task_log"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.get_retention_task_log, the character length must be great than or equal to 1.'
  end

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

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

#get_retention_with_http_info(id, opts = {}) ⇒ Array<(RetentionPolicy, Fixnum, Hash)>

Get Retention Policy Get Retention Policy.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

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

    RetentionPolicy data, response status code and response headers



214
215
216
217
218
219
220
221
222
223
224
225
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
# File 'lib/harbor2_client/api/retention_api.rb', line 214

def get_retention_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.get_retention ...'
  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 RetentionApi.get_retention"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.get_retention, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/retentions/{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'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # 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 => 'RetentionPolicy')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RetentionApi#get_retention\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_retention_executions(id, opts = {}) ⇒ Array<RetentionExecution>

Get Retention executions Get Retention executions, execution status may be delayed before job service schedule it up.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number.

  • :page_size (Integer)

    The size of per page.

Returns:



339
340
341
342
# File 'lib/harbor2_client/api/retention_api.rb', line 339

def list_retention_executions(id, opts = {})
  data, _status_code, _headers = list_retention_executions_with_http_info(id, opts)
  data
end

#list_retention_executions_with_http_info(id, opts = {}) ⇒ Array<(Array<RetentionExecution>, Fixnum, Hash)>

Get Retention executions Get Retention executions, execution status may be delayed before job service schedule it up.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number.

  • :page_size (Integer)

    The size of per page.

Returns:

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

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



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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/harbor2_client/api/retention_api.rb', line 352

def list_retention_executions_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.list_retention_executions ...'
  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 RetentionApi.list_retention_executions"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.list_retention_executions, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/retentions/{id}/executions'.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?

  # 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'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # 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<RetentionExecution>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RetentionApi#list_retention_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_retention_tasks(id, eid, opts = {}) ⇒ Array<RetentionExecutionTask>

Get Retention tasks Get Retention tasks, each repository as a task.

Parameters:

  • id

    Retention ID.

  • eid

    Retention execution ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number.

  • :page_size (Integer)

    The size of per page.

Returns:



407
408
409
410
# File 'lib/harbor2_client/api/retention_api.rb', line 407

def list_retention_tasks(id, eid, opts = {})
  data, _status_code, _headers = list_retention_tasks_with_http_info(id, eid, opts)
  data
end

#list_retention_tasks_with_http_info(id, eid, opts = {}) ⇒ Array<(Array<RetentionExecutionTask>, Fixnum, Hash)>

Get Retention tasks Get Retention tasks, each repository as a task.

Parameters:

  • id

    Retention ID.

  • eid

    Retention execution ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number.

  • :page_size (Integer)

    The size of per page.

Returns:

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

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



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/harbor2_client/api/retention_api.rb', line 421

def list_retention_tasks_with_http_info(id, eid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.list_retention_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 RetentionApi.list_retention_tasks"
  end
  # verify the required parameter 'eid' is set
  if @api_client.config.client_side_validation && eid.nil?
    fail ArgumentError, "Missing the required parameter 'eid' when calling RetentionApi.list_retention_tasks"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.list_retention_tasks, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/retentions/{id}/executions/{eid}/tasks'.sub('{' + 'id' + '}', id.to_s).sub('{' + 'eid' + '}', eid.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?

  # 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'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # 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<RetentionExecutionTask>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RetentionApi#list_retention_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#operate_retention_execution(id, eid, body, opts = {}) ⇒ nil

Stop a Retention execution Stop a Retention execution, only support "stop" action now.

Parameters:

  • id

    Retention ID.

  • eid

    Retention execution ID.

  • body

    The action, only support &quot;stop&quot; now.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


479
480
481
482
# File 'lib/harbor2_client/api/retention_api.rb', line 479

def operate_retention_execution(id, eid, body, opts = {})
  operate_retention_execution_with_http_info(id, eid, body, opts)
  nil
end

#operate_retention_execution_with_http_info(id, eid, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Stop a Retention execution Stop a Retention execution, only support &quot;stop&quot; action now.

Parameters:

  • id

    Retention ID.

  • eid

    Retention execution ID.

  • body

    The action, only support &quot;stop&quot; now.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

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

    nil, response status code and response headers



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/harbor2_client/api/retention_api.rb', line 492

def operate_retention_execution_with_http_info(id, eid, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.operate_retention_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 RetentionApi.operate_retention_execution"
  end
  # verify the required parameter 'eid' is set
  if @api_client.config.client_side_validation && eid.nil?
    fail ArgumentError, "Missing the required parameter 'eid' when calling RetentionApi.operate_retention_execution"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling RetentionApi.operate_retention_execution"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.operate_retention_execution, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/retentions/{id}/executions/{eid}'.sub('{' + 'id' + '}', id.to_s).sub('{' + 'eid' + '}', eid.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'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:PATCH, 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: RetentionApi#operate_retention_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#trigger_retention_execution(id, body, opts = {}) ⇒ nil

Trigger a Retention Execution Trigger a Retention Execution, if dry_run is True, nothing would be deleted actually.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


550
551
552
553
# File 'lib/harbor2_client/api/retention_api.rb', line 550

def trigger_retention_execution(id, body, opts = {})
  trigger_retention_execution_with_http_info(id, body, opts)
  nil
end

#trigger_retention_execution_with_http_info(id, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Trigger a Retention Execution Trigger a Retention Execution, if dry_run is True, nothing would be deleted actually.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

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

    nil, response status code and response headers



562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
# File 'lib/harbor2_client/api/retention_api.rb', line 562

def trigger_retention_execution_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.trigger_retention_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 RetentionApi.trigger_retention_execution"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling RetentionApi.trigger_retention_execution"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.trigger_retention_execution, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/retentions/{id}/executions'.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(['text/plain'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  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: RetentionApi#trigger_retention_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_retention(id, policy, opts = {}) ⇒ nil

Update Retention Policy Update Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when retention policy has already binded to project.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


616
617
618
619
# File 'lib/harbor2_client/api/retention_api.rb', line 616

def update_retention(id, policy, opts = {})
  update_retention_with_http_info(id, policy, opts)
  nil
end

#update_retention_with_http_info(id, policy, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update Retention Policy Update Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when retention policy has already binded to project.

Parameters:

  • id

    Retention ID.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

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

    nil, response status code and response headers



628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/harbor2_client/api/retention_api.rb', line 628

def update_retention_with_http_info(id, policy, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RetentionApi.update_retention ...'
  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 RetentionApi.update_retention"
  end
  # verify the required parameter 'policy' is set
  if @api_client.config.client_side_validation && policy.nil?
    fail ArgumentError, "Missing the required parameter 'policy' when calling RetentionApi.update_retention"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling RetentionApi.update_retention, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/retentions/{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'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(policy)
  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: RetentionApi#update_retention\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end