class SwaggerClient::ProjectApi
Attributes
Public Class Methods
# File lib/harbor_swagger_client/api/project_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Create a new project. This endpoint is for user to create a new project. @param project New created project. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/project_api.rb, line 28 def create_project(project, opts = {}) create_project_with_http_info(project, opts) nil end
Create a new project. This endpoint is for user to create a new project. @param project New created project. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_client/api/project_api.rb, line 39 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? # 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 by projectID This endpoint is aimed to delete project by project ID. @param project_id The ID of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/project_api.rb, line 88 def delete_project(project_id, opts = {}) delete_project_with_http_info(project_id, opts) nil end
Delete project by projectID This endpoint is aimed to delete project by project ID. @param project_id The ID of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_client/api/project_api.rb, line 99 def delete_project_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.delete_project ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_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_id}'.sub('{' + 'project_id' + '}', project_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: ProjectApi#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get recent logs of the projects Get recent logs of the projects @param project_name The name of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @option opts [Integer] :page The page number (default to 1) @option opts [Integer] :page_size The size of per page (default to 10) @return [Array<AuditLog>]
# File lib/harbor_swagger_client/api/project_api.rb, line 151 def get_logs(project_name, opts = {}) data, _status_code, _headers = get_logs_with_http_info(project_name, opts) data end
Get recent logs of the projects Get recent logs of the projects @param project_name The name of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @option opts [Integer] :page The page number @option opts [Integer] :page_size The size of per page @return [Array<(Array<AuditLog>, Fixnum, Hash)>] Array<AuditLog> data, response status code and response headers
# File lib/harbor_swagger_client/api/project_api.rb, line 165 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[:'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
Return specific project detail information This endpoint returns specific project information by project ID. @param project_id The ID of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Project]
# File lib/harbor_swagger_client/api/project_api.rb, line 222 def get_project(project_id, opts = {}) data, _status_code, _headers = get_project_with_http_info(project_id, opts) data end
Get the deletable status of the project Get the deletable status of the project @param project_id The ID of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [ProjectDeletable]
# File lib/harbor_swagger_client/api/project_api.rb, line 283 def get_project_deletable(project_id, opts = {}) data, _status_code, _headers = get_project_deletable_with_http_info(project_id, opts) data end
Get the deletable status of the project Get the deletable status of the project @param project_id The ID of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(ProjectDeletable
, Fixnum, Hash)>] ProjectDeletable
data, response status code and response headers
# File lib/harbor_swagger_client/api/project_api.rb, line 294 def get_project_deletable_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.get_project_deletable ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_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_id}/_deletable'.sub('{' + 'project_id' + '}', project_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basic'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => '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 summary of the project. Get summary of the project. @param project_id The ID of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [ProjectSummary]
# File lib/harbor_swagger_client/api/project_api.rb, line 344 def get_project_summary(project_id, opts = {}) data, _status_code, _headers = get_project_summary_with_http_info(project_id, opts) data end
Get summary of the project. Get summary of the project. @param project_id The ID of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(ProjectSummary
, Fixnum, Hash)>] ProjectSummary
data, response status code and response headers
# File lib/harbor_swagger_client/api/project_api.rb, line 355 def get_project_summary_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.get_project_summary ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_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_id}/summary'.sub('{' + 'project_id' + '}', project_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basic'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => '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
Return specific project detail information This endpoint returns specific project information by project ID. @param project_id The ID of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(Project
, Fixnum, Hash)>] Project
data, response status code and response headers
# File lib/harbor_swagger_client/api/project_api.rb, line 233 def get_project_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.get_project ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_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_id}'.sub('{' + 'project_id' + '}', project_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basic'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => '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
Check if the project name user provided already exists. This endpoint is used to check if the project name provided already exist. @param project_name Project
name for checking exists. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/project_api.rb, line 405 def head_project(project_name, opts = {}) head_project_with_http_info(project_name, opts) nil end
Check if the project name user provided already exists. This endpoint is used to check if the project name provided already exist. @param project_name Project
name for checking exists. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_client/api/project_api.rb, line 416 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 This endpoint returns projects created by Harbor. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number (default to 1) @option opts [Integer] :page_size The size of per page (default to 10) @option opts [String] :name The name of project. @option opts [BOOLEAN] :public The project is public or private. @option opts [String] :owner The name of project owner. @option opts [BOOLEAN] :with_detail Bool value indicating whether return detailed information of the project (default to true) @return [Array<Project>]
# File lib/harbor_swagger_client/api/project_api.rb, line 471 def list_projects(opts = {}) data, _status_code, _headers = list_projects_with_http_info(opts) data end
List projects This endpoint returns projects created by Harbor. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number @option opts [Integer] :page_size The size of per page @option opts [String] :name The name of project. @option opts [BOOLEAN] :public The project is public or private. @option opts [String] :owner The name of project owner. @option opts [BOOLEAN] :with_detail Bool value indicating whether return detailed information of the project @return [Array<(Array<Project>, Fixnum, Hash)>] Array<Project> data, response status code and response headers
# File lib/harbor_swagger_client/api/project_api.rb, line 487 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[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].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
Update properties for a selected project. This endpoint is aimed to update the properties of a project. @param project_id The ID of the project @param project Updates of project. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/project_api.rb, line 544 def update_project(project_id, project, opts = {}) update_project_with_http_info(project_id, project, opts) nil end
Update properties for a selected project. This endpoint is aimed to update the properties of a project. @param project_id The ID of the project @param project Updates of project. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_client/api/project_api.rb, line 556 def update_project_with_http_info(project_id, project, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectApi.update_project ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_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_id}'.sub('{' + 'project_id' + '}', project_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(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