Class: SwaggerClient::ArtifactApi
- Inherits:
-
Object
- Object
- SwaggerClient::ArtifactApi
- Defined in:
- lib/harbor_swagger_client/api/artifact_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_label(project_name, repository_name, reference, label, opts = {}) ⇒ nil
Add label to artifact Add label to the specified artiact.
-
#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.
-
#copy_artifact(project_name, repository_name, from, opts = {}) ⇒ nil
Copy artifact Copy the artifact specified in the "from" parameter to the repository.
-
#copy_artifact_with_http_info(project_name, repository_name, from, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Copy artifact Copy the artifact specified in the "from" parameter to the repository.
-
#create_tag(project_name, repository_name, reference, tag, opts = {}) ⇒ nil
Create tag Create a tag for the specified artifact.
-
#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.
-
#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.
-
#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.
-
#delete_tag(project_name, repository_name, reference, tag_name, opts = {}) ⇒ nil
Delete tag Delete the tag of the specified artifact.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#initialize(api_client = ApiClient.default) ⇒ ArtifactApi
constructor
A new instance of ArtifactApi.
-
#list_artifacts(project_name, repository_name, opts = {}) ⇒ Array<Artifact>
List artifacts List artifacts under the specific project and repository.
-
#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.
-
#list_tags(project_name, repository_name, reference, opts = {}) ⇒ Array<Tag>
List tags List tags of the specific artifact.
-
#list_tags_with_http_info(project_name, repository_name, reference, opts = {}) ⇒ Array<(Array<Tag>, Fixnum, Hash)>
List tags List tags of the specific artifact.
-
#remove_label(project_name, repository_name, reference, label_id, opts = {}) ⇒ nil
Remove label from artifact Remove the label from the specified artiact.
-
#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.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ArtifactApi
Returns a new instance of ArtifactApi.
19 20 21 |
# File 'lib/harbor_swagger_client/api/artifact_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/harbor_swagger_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.
31 32 33 34 |
# File 'lib/harbor_swagger_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.
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/harbor_swagger_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.
108 109 110 111 |
# File 'lib/harbor_swagger_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 "from" parameter to the repository.
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/harbor_swagger_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
182 183 184 185 |
# File 'lib/harbor_swagger_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
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/harbor_swagger_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
259 260 261 262 |
# File 'lib/harbor_swagger_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
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/harbor_swagger_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
332 333 334 335 |
# File 'lib/harbor_swagger_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
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/harbor_swagger_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.
410 411 412 413 |
# File 'lib/harbor_swagger_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.
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/harbor_swagger_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', 'vulnerabilities'].include?(addition) fail ArgumentError, "invalid value for 'addition', must be one of build_history, values.yaml, readme.md, dependencies, vulnerabilities" 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.
499 500 501 502 |
# File 'lib/harbor_swagger_client/api/artifact_api.rb', line 499 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.
519 520 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 |
# File 'lib/harbor_swagger_client/api/artifact_api.rb', line 519 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? # 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 |
#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
597 598 599 600 |
# File 'lib/harbor_swagger_client/api/artifact_api.rb', line 597 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 "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
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 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 |
# File 'lib/harbor_swagger_client/api/artifact_api.rb', line 617 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[:'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? # 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
690 691 692 693 |
# File 'lib/harbor_swagger_client/api/artifact_api.rb', line 690 def (project_name, repository_name, reference, opts = {}) data, _status_code, _headers = (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
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 762 763 764 765 766 767 768 |
# File 'lib/harbor_swagger_client/api/artifact_api.rb', line 708 def (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[:'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.
778 779 780 781 |
# File 'lib/harbor_swagger_client/api/artifact_api.rb', line 778 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.
792 793 794 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 |
# File 'lib/harbor_swagger_client/api/artifact_api.rb', line 792 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 |