Class: Harbor2Client::ProjectApi
- Inherits:
-
Object
- Object
- Harbor2Client::ProjectApi
- Defined in:
- lib/harbor2_client/api/project_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_project(project, opts = {}) ⇒ nil
Create a new project.
-
#create_project_with_http_info(project, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Create a new project.
-
#delete_project(project_name_or_id, opts = {}) ⇒ nil
Delete project by projectID This endpoint is aimed to delete project by project ID.
-
#delete_project_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete project by projectID This endpoint is aimed to delete project by project ID.
-
#get_logs(project_name, opts = {}) ⇒ Array<AuditLog>
Get recent logs of the projects Get recent logs of the projects.
-
#get_logs_with_http_info(project_name, opts = {}) ⇒ Array<(Array<AuditLog>, Fixnum, Hash)>
Get recent logs of the projects Get recent logs of the projects.
-
#get_project(project_name_or_id, opts = {}) ⇒ Project
Return specific project detail information This endpoint returns specific project information by project ID.
-
#get_project_deletable(project_name_or_id, opts = {}) ⇒ ProjectDeletable
Get the deletable status of the project Get the deletable status of the project.
-
#get_project_deletable_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(ProjectDeletable, Fixnum, Hash)>
Get the deletable status of the project Get the deletable status of the project.
-
#get_project_summary(project_name_or_id, opts = {}) ⇒ ProjectSummary
Get summary of the project.
-
#get_project_summary_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(ProjectSummary, Fixnum, Hash)>
Get summary of the project.
-
#get_project_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(Project, Fixnum, Hash)>
Return specific project detail information This endpoint returns specific project information by project ID.
-
#get_scanner_of_project(project_name_or_id, opts = {}) ⇒ ScannerRegistration
Get project level scanner Get the scanner registration of the specified project.
-
#get_scanner_of_project_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(ScannerRegistration, Fixnum, Hash)>
Get project level scanner Get the scanner registration of the specified project.
-
#head_project(project_name, opts = {}) ⇒ nil
Check if the project name user provided already exists.
-
#head_project_with_http_info(project_name, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Check if the project name user provided already exists.
-
#initialize(api_client = ApiClient.default) ⇒ ProjectApi
constructor
A new instance of ProjectApi.
-
#list_projects(opts = {}) ⇒ Array<Project>
List projects This endpoint returns projects created by Harbor.
-
#list_projects_with_http_info(opts = {}) ⇒ Array<(Array<Project>, Fixnum, Hash)>
List projects This endpoint returns projects created by Harbor.
-
#list_scanner_candidates_of_project(project_name_or_id, opts = {}) ⇒ Array<ScannerRegistration>
Get scanner registration candidates for configurating project level scanner Retrieve the system configured scanner registrations as candidates of setting project level scanner.
-
#list_scanner_candidates_of_project_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(Array<ScannerRegistration>, Fixnum, Hash)>
Get scanner registration candidates for configurating project level scanner Retrieve the system configured scanner registrations as candidates of setting project level scanner.
-
#set_scanner_of_project(project_name_or_id, payload, opts = {}) ⇒ nil
Configure scanner for the specified project Set one of the system configured scanner registration as the indepndent scanner of the specified project.
-
#set_scanner_of_project_with_http_info(project_name_or_id, payload, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Configure scanner for the specified project Set one of the system configured scanner registration as the indepndent scanner of the specified project.
-
#update_project(project_name_or_id, project, opts = {}) ⇒ nil
Update properties for a selected project.
-
#update_project_with_http_info(project_name_or_id, project, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update properties for a selected project.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ProjectApi
Returns a new instance of ProjectApi.
19 20 21 |
# File 'lib/harbor2_client/api/project_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/harbor2_client/api/project_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_project(project, opts = {}) ⇒ nil
Create a new project. This endpoint is for user to create a new project.
29 30 31 32 |
# File 'lib/harbor2_client/api/project_api.rb', line 29 def create_project(project, opts = {}) create_project_with_http_info(project, opts) nil end |
#create_project_with_http_info(project, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Create a new project. This endpoint is for user to create a new project.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/harbor2_client/api/project_api.rb', line 41 def create_project_with_http_info(project, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.create_project ...' end # verify the required parameter 'project' is set if @api_client.config.client_side_validation && project.nil? fail ArgumentError, "Missing the required parameter 'project' when calling ProjectApi.create_project" 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 ProjectApi.create_project, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects' # 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-Resource-Name-In-Location'] = opts[:'x_resource_name_in_location'] if !opts[:'x_resource_name_in_location'].nil? # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(project) 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: ProjectApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_project(project_name_or_id, opts = {}) ⇒ nil
Delete project by projectID This endpoint is aimed to delete project by project ID.
92 93 94 95 |
# File 'lib/harbor2_client/api/project_api.rb', line 92 def delete_project(project_name_or_id, opts = {}) delete_project_with_http_info(project_name_or_id, opts) nil end |
#delete_project_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete project by projectID This endpoint is aimed to delete project by project ID.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/harbor2_client/api/project_api.rb', line 104 def delete_project_with_http_info(project_name_or_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.delete_project ...' end # verify the required parameter 'project_name_or_id' is set if @api_client.config.client_side_validation && project_name_or_id.nil? fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ProjectApi.delete_project" 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 ProjectApi.delete_project, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_name_or_id}'.sub('{' + 'project_name_or_id' + '}', project_name_or_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? header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].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: ProjectApi#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_logs(project_name, opts = {}) ⇒ Array<AuditLog>
Get recent logs of the projects Get recent logs of the projects
158 159 160 161 |
# File 'lib/harbor2_client/api/project_api.rb', line 158 def get_logs(project_name, opts = {}) data, _status_code, _headers = get_logs_with_http_info(project_name, opts) data end |
#get_logs_with_http_info(project_name, opts = {}) ⇒ Array<(Array<AuditLog>, Fixnum, Hash)>
Get recent logs of the projects Get recent logs of the projects
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/harbor2_client/api/project_api.rb', line 173 def get_logs_with_http_info(project_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.get_logs ...' 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 ProjectApi.get_logs" 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 ProjectApi.get_logs, 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 ProjectApi.get_logs, must be smaller than or equal to 100.' end # resource path local_var_path = '/projects/{project_name}/logs'.sub('{' + 'project_name' + '}', project_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? # 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<AuditLog>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_project(project_name_or_id, opts = {}) ⇒ Project
Return specific project detail information This endpoint returns specific project information by project ID.
232 233 234 235 |
# File 'lib/harbor2_client/api/project_api.rb', line 232 def get_project(project_name_or_id, opts = {}) data, _status_code, _headers = get_project_with_http_info(project_name_or_id, opts) data end |
#get_project_deletable(project_name_or_id, opts = {}) ⇒ ProjectDeletable
Get the deletable status of the project Get the deletable status of the project
296 297 298 299 |
# File 'lib/harbor2_client/api/project_api.rb', line 296 def get_project_deletable(project_name_or_id, opts = {}) data, _status_code, _headers = get_project_deletable_with_http_info(project_name_or_id, opts) data end |
#get_project_deletable_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(ProjectDeletable, Fixnum, Hash)>
Get the deletable status of the project Get the deletable status of the project
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/harbor2_client/api/project_api.rb', line 308 def get_project_deletable_with_http_info(project_name_or_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.get_project_deletable ...' end # verify the required parameter 'project_name_or_id' is set if @api_client.config.client_side_validation && project_name_or_id.nil? fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ProjectApi.get_project_deletable" 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 ProjectApi.get_project_deletable, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_name_or_id}/_deletable'.sub('{' + 'project_name_or_id' + '}', project_name_or_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? header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].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 => 'ProjectDeletable') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_project_deletable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_project_summary(project_name_or_id, opts = {}) ⇒ ProjectSummary
Get summary of the project. Get summary of the project.
360 361 362 363 |
# File 'lib/harbor2_client/api/project_api.rb', line 360 def get_project_summary(project_name_or_id, opts = {}) data, _status_code, _headers = get_project_summary_with_http_info(project_name_or_id, opts) data end |
#get_project_summary_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(ProjectSummary, Fixnum, Hash)>
Get summary of the project. Get summary of the project.
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 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/harbor2_client/api/project_api.rb', line 372 def get_project_summary_with_http_info(project_name_or_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.get_project_summary ...' end # verify the required parameter 'project_name_or_id' is set if @api_client.config.client_side_validation && project_name_or_id.nil? fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ProjectApi.get_project_summary" 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 ProjectApi.get_project_summary, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_name_or_id}/summary'.sub('{' + 'project_name_or_id' + '}', project_name_or_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? header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].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 => 'ProjectSummary') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_project_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_project_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(Project, Fixnum, Hash)>
Return specific project detail information This endpoint returns specific project information by project ID.
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/harbor2_client/api/project_api.rb', line 244 def get_project_with_http_info(project_name_or_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.get_project ...' end # verify the required parameter 'project_name_or_id' is set if @api_client.config.client_side_validation && project_name_or_id.nil? fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ProjectApi.get_project" 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 ProjectApi.get_project, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_name_or_id}'.sub('{' + 'project_name_or_id' + '}', project_name_or_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? header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].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 => 'Project') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_scanner_of_project(project_name_or_id, opts = {}) ⇒ ScannerRegistration
Get project level scanner Get the scanner registration of the specified project. If no scanner registration is configured for the specified project, the system default scanner registration will be returned.
424 425 426 427 |
# File 'lib/harbor2_client/api/project_api.rb', line 424 def get_scanner_of_project(project_name_or_id, opts = {}) data, _status_code, _headers = get_scanner_of_project_with_http_info(project_name_or_id, opts) data end |
#get_scanner_of_project_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(ScannerRegistration, Fixnum, Hash)>
Get project level scanner Get the scanner registration of the specified project. If no scanner registration is configured for the specified project, the system default scanner registration will be returned.
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 |
# File 'lib/harbor2_client/api/project_api.rb', line 436 def get_scanner_of_project_with_http_info(project_name_or_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.get_scanner_of_project ...' end # verify the required parameter 'project_name_or_id' is set if @api_client.config.client_side_validation && project_name_or_id.nil? fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ProjectApi.get_scanner_of_project" 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 ProjectApi.get_scanner_of_project, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_name_or_id}/scanner'.sub('{' + 'project_name_or_id' + '}', project_name_or_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? header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].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 => 'ScannerRegistration') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_scanner_of_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#head_project(project_name, opts = {}) ⇒ nil
Check if the project name user provided already exists. This endpoint is used to check if the project name provided already exist.
487 488 489 490 |
# File 'lib/harbor2_client/api/project_api.rb', line 487 def head_project(project_name, opts = {}) head_project_with_http_info(project_name, opts) nil end |
#head_project_with_http_info(project_name, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Check if the project name user provided already exists. This endpoint is used to check if the project name provided already exist.
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 |
# File 'lib/harbor2_client/api/project_api.rb', line 498 def head_project_with_http_info(project_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.head_project ...' 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 ProjectApi.head_project" 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 ProjectApi.head_project, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects' # query parameters query_params = {} query_params[:'project_name'] = project_name # 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(:HEAD, 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: ProjectApi#head_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_projects(opts = {}) ⇒ Array<Project>
List projects This endpoint returns projects created by Harbor.
555 556 557 558 |
# File 'lib/harbor2_client/api/project_api.rb', line 555 def list_projects(opts = {}) data, _status_code, _headers = list_projects_with_http_info(opts) data end |
#list_projects_with_http_info(opts = {}) ⇒ Array<(Array<Project>, Fixnum, Hash)>
List projects This endpoint returns projects created by Harbor.
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 |
# File 'lib/harbor2_client/api/project_api.rb', line 573 def list_projects_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.list_projects ...' 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 ProjectApi.list_projects, 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 ProjectApi.list_projects, must be smaller than or equal to 100.' end # resource path local_var_path = '/projects' # 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[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'public'] = opts[:'public'] if !opts[:'public'].nil? query_params[:'owner'] = opts[:'owner'] if !opts[:'owner'].nil? query_params[:'with_detail'] = opts[:'with_detail'] if !opts[:'with_detail'].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<Project>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#list_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_scanner_candidates_of_project(project_name_or_id, opts = {}) ⇒ Array<ScannerRegistration>
Get scanner registration candidates for configurating project level scanner Retrieve the system configured scanner registrations as candidates of setting project level scanner.
636 637 638 639 |
# File 'lib/harbor2_client/api/project_api.rb', line 636 def list_scanner_candidates_of_project(project_name_or_id, opts = {}) data, _status_code, _headers = list_scanner_candidates_of_project_with_http_info(project_name_or_id, opts) data end |
#list_scanner_candidates_of_project_with_http_info(project_name_or_id, opts = {}) ⇒ Array<(Array<ScannerRegistration>, Fixnum, Hash)>
Get scanner registration candidates for configurating project level scanner Retrieve the system configured scanner registrations as candidates of setting project level scanner.
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 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 |
# File 'lib/harbor2_client/api/project_api.rb', line 652 def list_scanner_candidates_of_project_with_http_info(project_name_or_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.list_scanner_candidates_of_project ...' end # verify the required parameter 'project_name_or_id' is set if @api_client.config.client_side_validation && project_name_or_id.nil? fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ProjectApi.list_scanner_candidates_of_project" 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 ProjectApi.list_scanner_candidates_of_project, 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 ProjectApi.list_scanner_candidates_of_project, must be smaller than or equal to 100.' end # resource path local_var_path = '/projects/{project_name_or_id}/scanner/candidates'.sub('{' + 'project_name_or_id' + '}', project_name_or_id.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? # 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-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].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<ScannerRegistration>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#list_scanner_candidates_of_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#set_scanner_of_project(project_name_or_id, payload, opts = {}) ⇒ nil
Configure scanner for the specified project Set one of the system configured scanner registration as the indepndent scanner of the specified project.
713 714 715 716 |
# File 'lib/harbor2_client/api/project_api.rb', line 713 def set_scanner_of_project(project_name_or_id, payload, opts = {}) set_scanner_of_project_with_http_info(project_name_or_id, payload, opts) nil end |
#set_scanner_of_project_with_http_info(project_name_or_id, payload, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Configure scanner for the specified project Set one of the system configured scanner registration as the indepndent scanner of the specified project.
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 769 770 771 772 773 |
# File 'lib/harbor2_client/api/project_api.rb', line 726 def set_scanner_of_project_with_http_info(project_name_or_id, payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.set_scanner_of_project ...' end # verify the required parameter 'project_name_or_id' is set if @api_client.config.client_side_validation && project_name_or_id.nil? fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ProjectApi.set_scanner_of_project" end # verify the required parameter 'payload' is set if @api_client.config.client_side_validation && payload.nil? fail ArgumentError, "Missing the required parameter 'payload' when calling ProjectApi.set_scanner_of_project" 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 ProjectApi.set_scanner_of_project, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_name_or_id}/scanner'.sub('{' + 'project_name_or_id' + '}', project_name_or_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? header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].nil? # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) auth_names = ['basic'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#set_scanner_of_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_project(project_name_or_id, project, opts = {}) ⇒ nil
Update properties for a selected project. This endpoint is aimed to update the properties of a project.
782 783 784 785 |
# File 'lib/harbor2_client/api/project_api.rb', line 782 def update_project(project_name_or_id, project, opts = {}) update_project_with_http_info(project_name_or_id, project, opts) nil end |
#update_project_with_http_info(project_name_or_id, project, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update properties for a selected project. This endpoint is aimed to update the properties of a project.
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 |
# File 'lib/harbor2_client/api/project_api.rb', line 795 def update_project_with_http_info(project_name_or_id, project, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.update_project ...' end # verify the required parameter 'project_name_or_id' is set if @api_client.config.client_side_validation && project_name_or_id.nil? fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ProjectApi.update_project" end # verify the required parameter 'project' is set if @api_client.config.client_side_validation && project.nil? fail ArgumentError, "Missing the required parameter 'project' when calling ProjectApi.update_project" 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 ProjectApi.update_project, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_name_or_id}'.sub('{' + 'project_name_or_id' + '}', project_name_or_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? header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].nil? # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(project) auth_names = ['basic'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |