Class: Harbor2Client::ArtifactApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ArtifactApi

Returns a new instance of ArtifactApi.



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

def api_client
  @api_client
end

Instance Method Details

#add_label(project_name, repository_name, reference, label, opts = {}) ⇒ nil

Add label to artifact Add label to the specified artiact.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • label

    The label that added to the artifact. Only the ID property is needed.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


31
32
33
34
# File 'lib/harbor2_client/api/artifact_api.rb', line 31

def add_label(project_name, repository_name, reference, label, opts = {})
  add_label_with_http_info(project_name, repository_name, reference, label, opts)
  nil
end

#add_label_with_http_info(project_name, repository_name, reference, label, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Add label to artifact Add label to the specified artiact.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • label

    The label that added to the artifact. Only the ID property is needed.

  • 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



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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/harbor2_client/api/artifact_api.rb', line 45

def add_label_with_http_info(project_name, repository_name, reference, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.add_label ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.add_label"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.add_label"
  end
  # verify the required parameter 'reference' is set
  if @api_client.config.client_side_validation && reference.nil?
    fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.add_label"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling ArtifactApi.add_label"
  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 ArtifactApi.add_label, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.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(label)
  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: ArtifactApi#add_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#copy_artifact(project_name, repository_name, from, opts = {}) ⇒ nil

Copy artifact Copy the artifact specified in the "from" parameter to the repository.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • from

    The artifact from which the new artifact is copied from, the format should be &quot;project/repository:tag&quot; or &quot;project/repository@digest&quot;.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


108
109
110
111
# File 'lib/harbor2_client/api/artifact_api.rb', line 108

def copy_artifact(project_name, repository_name, from, opts = {})
  copy_artifact_with_http_info(project_name, repository_name, from, opts)
  nil
end

#copy_artifact_with_http_info(project_name, repository_name, from, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Copy artifact Copy the artifact specified in the &quot;from&quot; parameter to the repository.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • from

    The artifact from which the new artifact is copied from, the format should be &quot;project/repository:tag&quot; or &quot;project/repository@digest&quot;.

  • 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



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/harbor2_client/api/artifact_api.rb', line 121

def copy_artifact_with_http_info(project_name, repository_name, from, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.copy_artifact ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.copy_artifact"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.copy_artifact"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling ArtifactApi.copy_artifact"
  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 ArtifactApi.copy_artifact, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'from'] = from

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

#create_tag(project_name, repository_name, reference, tag, opts = {}) ⇒ nil

Create tag Create a tag for the specified artifact

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • tag

    The JSON object of tag.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


182
183
184
185
# File 'lib/harbor2_client/api/artifact_api.rb', line 182

def create_tag(project_name, repository_name, reference, tag, opts = {})
  create_tag_with_http_info(project_name, repository_name, reference, tag, opts)
  nil
end

#create_tag_with_http_info(project_name, repository_name, reference, tag, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create tag Create a tag for the specified artifact

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • tag

    The JSON object of tag.

  • 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



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
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
# File 'lib/harbor2_client/api/artifact_api.rb', line 196

def create_tag_with_http_info(project_name, repository_name, reference, tag, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.create_tag ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.create_tag"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.create_tag"
  end
  # verify the required parameter 'reference' is set
  if @api_client.config.client_side_validation && reference.nil?
    fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.create_tag"
  end
  # verify the required parameter 'tag' is set
  if @api_client.config.client_side_validation && tag.nil?
    fail ArgumentError, "Missing the required parameter 'tag' when calling ArtifactApi.create_tag"
  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 ArtifactApi.create_tag, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.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(tag)
  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: ArtifactApi#create_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_artifact(project_name, repository_name, reference, opts = {}) ⇒ nil

Delete the specific artifact Delete the artifact specified by the reference under the project and repository. The reference can be digest or tag

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


259
260
261
262
# File 'lib/harbor2_client/api/artifact_api.rb', line 259

def delete_artifact(project_name, repository_name, reference, opts = {})
  delete_artifact_with_http_info(project_name, repository_name, reference, opts)
  nil
end

#delete_artifact_with_http_info(project_name, repository_name, reference, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete the specific artifact Delete the artifact specified by the reference under the project and repository. The reference can be digest or tag

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • 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



272
273
274
275
276
277
278
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
# File 'lib/harbor2_client/api/artifact_api.rb', line 272

def delete_artifact_with_http_info(project_name, repository_name, reference, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.delete_artifact ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.delete_artifact"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.delete_artifact"
  end
  # verify the required parameter 'reference' is set
  if @api_client.config.client_side_validation && reference.nil?
    fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.delete_artifact"
  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 ArtifactApi.delete_artifact, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.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: ArtifactApi#delete_artifact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_tag(project_name, repository_name, reference, tag_name, opts = {}) ⇒ nil

Delete tag Delete the tag of the specified artifact

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • tag_name

    The name of the tag

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


332
333
334
335
# File 'lib/harbor2_client/api/artifact_api.rb', line 332

def delete_tag(project_name, repository_name, reference, tag_name, opts = {})
  delete_tag_with_http_info(project_name, repository_name, reference, tag_name, opts)
  nil
end

#delete_tag_with_http_info(project_name, repository_name, reference, tag_name, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete tag Delete the tag of the specified artifact

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • tag_name

    The name of the tag

  • 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



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

def delete_tag_with_http_info(project_name, repository_name, reference, tag_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.delete_tag ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.delete_tag"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.delete_tag"
  end
  # verify the required parameter 'reference' is set
  if @api_client.config.client_side_validation && reference.nil?
    fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.delete_tag"
  end
  # verify the required parameter 'tag_name' is set
  if @api_client.config.client_side_validation && tag_name.nil?
    fail ArgumentError, "Missing the required parameter 'tag_name' when calling ArtifactApi.delete_tag"
  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 ArtifactApi.delete_tag, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s).sub('{' + 'tag_name' + '}', tag_name.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: ArtifactApi#delete_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_addition(project_name, repository_name, reference, addition, opts = {}) ⇒ String

Get the addition of the specific artifact Get the addition of the artifact specified by the reference under the project and repository.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • addition

    The type of addition.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (String)


410
411
412
413
# File 'lib/harbor2_client/api/artifact_api.rb', line 410

def get_addition(project_name, repository_name, reference, addition, opts = {})
  data, _status_code, _headers = get_addition_with_http_info(project_name, repository_name, reference, addition, opts)
  data
end

#get_addition_with_http_info(project_name, repository_name, reference, addition, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get the addition of the specific artifact Get the addition of the artifact specified by the reference under the project and repository.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • addition

    The type of addition.

  • 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



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
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/harbor2_client/api/artifact_api.rb', line 424

def get_addition_with_http_info(project_name, repository_name, reference, addition, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.get_addition ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.get_addition"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.get_addition"
  end
  # verify the required parameter 'reference' is set
  if @api_client.config.client_side_validation && reference.nil?
    fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.get_addition"
  end
  # verify the required parameter 'addition' is set
  if @api_client.config.client_side_validation && addition.nil?
    fail ArgumentError, "Missing the required parameter 'addition' when calling ArtifactApi.get_addition"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['build_history', 'values.yaml', 'readme.md', 'dependencies'].include?(addition)
    fail ArgumentError, "invalid value for 'addition', must be one of build_history, values.yaml, readme.md, dependencies"
  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 ArtifactApi.get_addition, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s).sub('{' + 'addition' + '}', addition.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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ArtifactApi#get_addition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_artifact(project_name, repository_name, reference, opts = {}) ⇒ Artifact

Get the specific artifact Get the artifact specified by the reference under the project and repository. The reference can be digest or tag.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • 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 (default to 1)

  • :page_size (Integer)

    The size of per page (default to 10)

  • :x_accept_vulnerabilities (String)

    A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports &#39;application/vnd.scanner.adapter.vuln.report.harbor+json; version&#x3D;1.0&#39; and &#39;application/vnd.security.vulnerability.report; version&#x3D;1.1&#39; (default to application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0)

  • :with_tag (BOOLEAN)

    Specify whether the tags are inclued inside the returning artifacts (default to true)

  • :with_label (BOOLEAN)

    Specify whether the labels are inclued inside the returning artifacts (default to false)

  • :with_scan_overview (BOOLEAN)

    Specify whether the scan overview is inclued inside the returning artifacts (default to false)

  • :with_signature (BOOLEAN)

    Specify whether the signature is inclued inside the returning artifacts (default to false)

  • :with_immutable_status (BOOLEAN)

    Specify whether the immutable status is inclued inside the tags of the returning artifacts. Only works when setting &quot;with_tag&#x3D;true&quot; (default to false)

Returns:



500
501
502
503
# File 'lib/harbor2_client/api/artifact_api.rb', line 500

def get_artifact(project_name, repository_name, reference, opts = {})
  data, _status_code, _headers = get_artifact_with_http_info(project_name, repository_name, reference, opts)
  data
end

#get_artifact_with_http_info(project_name, repository_name, reference, opts = {}) ⇒ Array<(Artifact, Fixnum, Hash)>

Get the specific artifact Get the artifact specified by the reference under the project and repository. The reference can be digest or tag.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • 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

  • :x_accept_vulnerabilities (String)

    A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports &#39;application/vnd.scanner.adapter.vuln.report.harbor+json; version&#x3D;1.0&#39; and &#39;application/vnd.security.vulnerability.report; version&#x3D;1.1&#39;

  • :with_tag (BOOLEAN)

    Specify whether the tags are inclued inside the returning artifacts

  • :with_label (BOOLEAN)

    Specify whether the labels are inclued inside the returning artifacts

  • :with_scan_overview (BOOLEAN)

    Specify whether the scan overview is inclued inside the returning artifacts

  • :with_signature (BOOLEAN)

    Specify whether the signature is inclued inside the returning artifacts

  • :with_immutable_status (BOOLEAN)

    Specify whether the immutable status is inclued inside the tags of the returning artifacts. Only works when setting &quot;with_tag&#x3D;true&quot;

Returns:

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

    Artifact data, response status code and response headers



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
# File 'lib/harbor2_client/api/artifact_api.rb', line 521

def get_artifact_with_http_info(project_name, repository_name, reference, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.get_artifact ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.get_artifact"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.get_artifact"
  end
  # verify the required parameter 'reference' is set
  if @api_client.config.client_side_validation && reference.nil?
    fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.get_artifact"
  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 ArtifactApi.get_artifact, the character length must be great than or equal to 1.'
  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 ArtifactApi.get_artifact, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.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[:'with_tag'] = opts[:'with_tag'] if !opts[:'with_tag'].nil?
  query_params[:'with_label'] = opts[:'with_label'] if !opts[:'with_label'].nil?
  query_params[:'with_scan_overview'] = opts[:'with_scan_overview'] if !opts[:'with_scan_overview'].nil?
  query_params[:'with_signature'] = opts[:'with_signature'] if !opts[:'with_signature'].nil?
  query_params[:'with_immutable_status'] = opts[:'with_immutable_status'] if !opts[:'with_immutable_status'].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?
  header_params[:'X-Accept-Vulnerabilities'] = opts[:'x_accept_vulnerabilities'] if !opts[:'x_accept_vulnerabilities'].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 => 'Artifact')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ArtifactApi#get_artifact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vulnerabilities_addition(project_name, repository_name, reference, opts = {}) ⇒ String

Get the vulnerabilities addition of the specific artifact Get the vulnerabilities addition of the artifact specified by the reference under the project and repository.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :x_accept_vulnerabilities (String)

    A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports &#39;application/vnd.scanner.adapter.vuln.report.harbor+json; version&#x3D;1.0&#39; and &#39;application/vnd.security.vulnerability.report; version&#x3D;1.1&#39; (default to application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0)

Returns:

  • (String)


594
595
596
597
# File 'lib/harbor2_client/api/artifact_api.rb', line 594

def get_vulnerabilities_addition(project_name, repository_name, reference, opts = {})
  data, _status_code, _headers = get_vulnerabilities_addition_with_http_info(project_name, repository_name, reference, opts)
  data
end

#get_vulnerabilities_addition_with_http_info(project_name, repository_name, reference, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get the vulnerabilities addition of the specific artifact Get the vulnerabilities addition of the artifact specified by the reference under the project and repository.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :x_accept_vulnerabilities (String)

    A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports &#39;application/vnd.scanner.adapter.vuln.report.harbor+json; version&#x3D;1.0&#39; and &#39;application/vnd.security.vulnerability.report; version&#x3D;1.1&#39;

Returns:

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

    String data, response status code and response headers



608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
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
# File 'lib/harbor2_client/api/artifact_api.rb', line 608

def get_vulnerabilities_addition_with_http_info(project_name, repository_name, reference, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.get_vulnerabilities_addition ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.get_vulnerabilities_addition"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.get_vulnerabilities_addition"
  end
  # verify the required parameter 'reference' is set
  if @api_client.config.client_side_validation && reference.nil?
    fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.get_vulnerabilities_addition"
  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 ArtifactApi.get_vulnerabilities_addition, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/vulnerabilities'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.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?
  header_params[:'X-Accept-Vulnerabilities'] = opts[:'x_accept_vulnerabilities'] if !opts[:'x_accept_vulnerabilities'].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: ArtifactApi#get_vulnerabilities_addition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_artifacts(project_name, repository_name, opts = {}) ⇒ Array<Artifact>

List artifacts List artifacts under the specific project and repository. Except the basic properties, the other supported queries in "q" includes "tags=*" to list only tagged artifacts, "tags=nil" to list only untagged artifacts, "tags=~v" to list artifacts whose tag fuzzy matches "v", "tags=v" to list artifact whose tag exactly matches "v", "labels=(id1, id2)" to list artifacts that both labels with id1 and id2 are added to

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

  • :page (Integer)

    The page number (default to 1)

  • :page_size (Integer)

    The size of per page (default to 10)

  • :x_accept_vulnerabilities (String)

    A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports &#39;application/vnd.scanner.adapter.vuln.report.harbor+json; version&#x3D;1.0&#39; and &#39;application/vnd.security.vulnerability.report; version&#x3D;1.1&#39; (default to application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0)

  • :with_tag (BOOLEAN)

    Specify whether the tags are included inside the returning artifacts (default to true)

  • :with_label (BOOLEAN)

    Specify whether the labels are included inside the returning artifacts (default to false)

  • :with_scan_overview (BOOLEAN)

    Specify whether the scan overview is included inside the returning artifacts (default to false)

  • :with_signature (BOOLEAN)

    Specify whether the signature is included inside the tags of the returning artifacts. Only works when setting &quot;with_tag&#x3D;true&quot; (default to false)

  • :with_immutable_status (BOOLEAN)

    Specify whether the immutable status is included inside the tags of the returning artifacts. Only works when setting &quot;with_tag&#x3D;true&quot; (default to false)

Returns:



678
679
680
681
# File 'lib/harbor2_client/api/artifact_api.rb', line 678

def list_artifacts(project_name, repository_name, opts = {})
  data, _status_code, _headers = list_artifacts_with_http_info(project_name, repository_name, opts)
  data
end

#list_artifacts_with_http_info(project_name, repository_name, opts = {}) ⇒ Array<(Array<Artifact>, Fixnum, Hash)>

List artifacts List artifacts under the specific project and repository. Except the basic properties, the other supported queries in &quot;q&quot; includes &quot;tags&#x3D;*&quot; to list only tagged artifacts, &quot;tags&#x3D;nil&quot; to list only untagged artifacts, &quot;tags&#x3D;~v&quot; to list artifacts whose tag fuzzy matches &quot;v&quot;, &quot;tags&#x3D;v&quot; to list artifact whose tag exactly matches &quot;v&quot;, &quot;labels&#x3D;(id1, id2)&quot; to list artifacts that both labels with id1 and id2 are added to

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

  • :page (Integer)

    The page number

  • :page_size (Integer)

    The size of per page

  • :x_accept_vulnerabilities (String)

    A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports &#39;application/vnd.scanner.adapter.vuln.report.harbor+json; version&#x3D;1.0&#39; and &#39;application/vnd.security.vulnerability.report; version&#x3D;1.1&#39;

  • :with_tag (BOOLEAN)

    Specify whether the tags are included inside the returning artifacts

  • :with_label (BOOLEAN)

    Specify whether the labels are included inside the returning artifacts

  • :with_scan_overview (BOOLEAN)

    Specify whether the scan overview is included inside the returning artifacts

  • :with_signature (BOOLEAN)

    Specify whether the signature is included inside the tags of the returning artifacts. Only works when setting &quot;with_tag&#x3D;true&quot;

  • :with_immutable_status (BOOLEAN)

    Specify whether the immutable status is included inside the tags of the returning artifacts. Only works when setting &quot;with_tag&#x3D;true&quot;

Returns:

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

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



700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
# File 'lib/harbor2_client/api/artifact_api.rb', line 700

def list_artifacts_with_http_info(project_name, repository_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.list_artifacts ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.list_artifacts"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.list_artifacts"
  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 ArtifactApi.list_artifacts, the character length must be great than or equal to 1.'
  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 ArtifactApi.list_artifacts, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'with_tag'] = opts[:'with_tag'] if !opts[:'with_tag'].nil?
  query_params[:'with_label'] = opts[:'with_label'] if !opts[:'with_label'].nil?
  query_params[:'with_scan_overview'] = opts[:'with_scan_overview'] if !opts[:'with_scan_overview'].nil?
  query_params[:'with_signature'] = opts[:'with_signature'] if !opts[:'with_signature'].nil?
  query_params[:'with_immutable_status'] = opts[:'with_immutable_status'] if !opts[:'with_immutable_status'].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?
  header_params[:'X-Accept-Vulnerabilities'] = opts[:'x_accept_vulnerabilities'] if !opts[:'x_accept_vulnerabilities'].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<Artifact>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ArtifactApi#list_artifacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_tags(project_name, repository_name, reference, opts = {}) ⇒ Array<Tag>

List tags List tags of the specific artifact

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

  • :page (Integer)

    The page number (default to 1)

  • :page_size (Integer)

    The size of per page (default to 10)

  • :with_signature (BOOLEAN)

    Specify whether the signature is included inside the returning tags (default to false)

  • :with_immutable_status (BOOLEAN)

    Specify whether the immutable status is included inside the returning tags (default to false)

Returns:



776
777
778
779
# File 'lib/harbor2_client/api/artifact_api.rb', line 776

def list_tags(project_name, repository_name, reference, opts = {})
  data, _status_code, _headers = list_tags_with_http_info(project_name, repository_name, reference, opts)
  data
end

#list_tags_with_http_info(project_name, repository_name, reference, opts = {}) ⇒ Array<(Array<Tag>, Fixnum, Hash)>

List tags List tags of the specific artifact

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

  • :page (Integer)

    The page number

  • :page_size (Integer)

    The size of per page

  • :with_signature (BOOLEAN)

    Specify whether the signature is included inside the returning tags

  • :with_immutable_status (BOOLEAN)

    Specify whether the immutable status is included inside the returning tags

Returns:

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

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



795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
# File 'lib/harbor2_client/api/artifact_api.rb', line 795

def list_tags_with_http_info(project_name, repository_name, reference, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.list_tags ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.list_tags"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.list_tags"
  end
  # verify the required parameter 'reference' is set
  if @api_client.config.client_side_validation && reference.nil?
    fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.list_tags"
  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 ArtifactApi.list_tags, the character length must be great than or equal to 1.'
  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 ArtifactApi.list_tags, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s)

  # query parameters
  query_params = {}
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'with_signature'] = opts[:'with_signature'] if !opts[:'with_signature'].nil?
  query_params[:'with_immutable_status'] = opts[:'with_immutable_status'] if !opts[:'with_immutable_status'].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<Tag>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ArtifactApi#list_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_label(project_name, repository_name, reference, label_id, opts = {}) ⇒ nil

Remove label from artifact Remove the label from the specified artiact.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • label_id

    The ID of the label that removed from the artifact.

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

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


866
867
868
869
# File 'lib/harbor2_client/api/artifact_api.rb', line 866

def remove_label(project_name, repository_name, reference, label_id, opts = {})
  remove_label_with_http_info(project_name, repository_name, reference, label_id, opts)
  nil
end

#remove_label_with_http_info(project_name, repository_name, reference, label_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Remove label from artifact Remove the label from the specified artiact.

Parameters:

  • project_name

    The name of the project

  • repository_name

    The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb

  • reference

    The reference of the artifact, can be digest or tag

  • label_id

    The ID of the label that removed from the artifact.

  • 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



880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
# File 'lib/harbor2_client/api/artifact_api.rb', line 880

def remove_label_with_http_info(project_name, repository_name, reference, label_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ArtifactApi.remove_label ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.remove_label"
  end
  # verify the required parameter 'repository_name' is set
  if @api_client.config.client_side_validation && repository_name.nil?
    fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.remove_label"
  end
  # verify the required parameter 'reference' is set
  if @api_client.config.client_side_validation && reference.nil?
    fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.remove_label"
  end
  # verify the required parameter 'label_id' is set
  if @api_client.config.client_side_validation && label_id.nil?
    fail ArgumentError, "Missing the required parameter 'label_id' when calling ArtifactApi.remove_label"
  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 ArtifactApi.remove_label, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s).sub('{' + 'label_id' + '}', label_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: ArtifactApi#remove_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end