SwaggerClient - the Ruby gem for the Harbor API
These APIs provide services for manipulating Harbor project.
This SDK is automatically generated by the Swagger Codegen project:
- API version: 2.0
- Package version: 2.0.0
- Build package: io.swagger.codegen.languages.RubyClientCodegen
To build the Ruby code into a gem:
gem build harbor_swagger_client.gemspec
Then either install the gem locally:
gem install ./harbor_swagger_client-2.0.0.gem
(for development, run gem install --dev ./harbor_swagger_client-2.0.0.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'harbor_swagger_client', '~> 2.0.0'
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'harbor_swagger_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'harbor_swagger_client'
# Setup authorization
SwaggerClient.configure do |config|
# Configure HTTP basic authorization: basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
end
api_instance = SwaggerClient::ArtifactApi.new
project_name = 'project_name_example' # String | The name of the project
repository_name = 'repository_name_example' # String | The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb
reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
label = SwaggerClient::Label.new # Label | The label that added to the artifact. Only the ID property is needed.
opts = {
x_request_id: 'x_request_id_example' # String | An unique ID for the request
}
begin
#Add label to artifact
api_instance.add_label(project_namerepository_name, reference, label, opts)
rescue SwaggerClient::ApiError => e
puts "Exception when calling ArtifactApi->add_label: #{e}"
end
All URIs are relative to http://localhost/api/v2.0
Class | Method | HTTP request | Description |
---|---|---|---|
SwaggerClient::ArtifactApi | add_label | POST /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels | Add label to artifact |
SwaggerClient::ArtifactApi | copy_artifact | POST /projects/{project_name}/repositories/{repository_name}/artifacts | Copy artifact |
SwaggerClient::ArtifactApi | create_tag | POST /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags | Create tag |
SwaggerClient::ArtifactApi | delete_artifact | DELETE /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} | Delete the specific artifact |
SwaggerClient::ArtifactApi | delete_tag | DELETE /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name} | Delete tag |
SwaggerClient::ArtifactApi | get_addition | GET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition} | Get the addition of the specific artifact |
SwaggerClient::ArtifactApi | get_artifact | GET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} | Get the specific artifact |
SwaggerClient::ArtifactApi | list_artifacts | GET /projects/{project_name}/repositories/{repository_name}/artifacts | List artifacts |
SwaggerClient::ArtifactApi | list_tags | GET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags | List tags |
SwaggerClient::ArtifactApi | remove_label | DELETE /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id} | Remove label from artifact |
SwaggerClient::AuditlogApi | list_audit_logs | GET /audit-logs | Get recent logs of the projects which the user is a member of |
SwaggerClient::IconApi | get_icon | GET /icons/{digest} | Get artifact icon |
SwaggerClient::PingApi | ping_get | GET /ping | Ping Harbor to check if it's alive. |
SwaggerClient::PreheatApi | create_instance | POST /p2p/preheat/instances | Create p2p provider instances |
SwaggerClient::PreheatApi | create_policy | POST /projects/{project_name}/preheat/policies | Create a preheat policy under a project |
SwaggerClient::PreheatApi | delete_instance | DELETE /p2p/preheat/instances/{preheat_instance_name} | Delete the specified P2P provider instance |
SwaggerClient::PreheatApi | delete_policy | DELETE /projects/{project_name}/preheat/policies/{preheat_policy_name} | Delete a preheat policy |
SwaggerClient::PreheatApi | get_execution | GET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id} | Get a execution detail by id |
SwaggerClient::PreheatApi | get_instance | GET /p2p/preheat/instances/{preheat_instance_name} | Get a P2P provider instance |
SwaggerClient::PreheatApi | get_policy | GET /projects/{project_name}/preheat/policies/{preheat_policy_name} | Get a preheat policy |
SwaggerClient::PreheatApi | get_preheat_log | GET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks/{task_id}/logs | Get the log text stream of the specified task for the given execution |
SwaggerClient::PreheatApi | list_executions | GET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions | List executions for the given policy |
SwaggerClient::PreheatApi | list_instances | GET /p2p/preheat/instances | List P2P provider instances |
SwaggerClient::PreheatApi | list_policies | GET /projects/{project_name}/preheat/policies | List preheat policies |
SwaggerClient::PreheatApi | list_providers | GET /p2p/preheat/providers | List P2P providers |
SwaggerClient::PreheatApi | list_providers_under_project | GET /projects/{project_name}/preheat/providers | Get all providers at project level |
SwaggerClient::PreheatApi | list_tasks | GET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks | List all the related tasks for the given execution |
SwaggerClient::PreheatApi | manual_preheat | POST /projects/{project_name}/preheat/policies/{preheat_policy_name} | Manual preheat |
SwaggerClient::PreheatApi | ping_instances | POST /p2p/preheat/instances/ping | Ping status of a instance. |
SwaggerClient::PreheatApi | stop_execution | PATCH /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id} | Stop a execution |
SwaggerClient::PreheatApi | update_instance | PUT /p2p/preheat/instances/{preheat_instance_name} | Update the specified P2P provider instance |
SwaggerClient::PreheatApi | update_policy | PUT /projects/{project_name}/preheat/policies/{preheat_policy_name} | Update preheat policy |
SwaggerClient::ProjectApi | create_project | POST /projects | Create a new project. |
SwaggerClient::ProjectApi | delete_project | DELETE /projects/{project_id} | Delete project by projectID |
SwaggerClient::ProjectApi | get_logs | GET /projects/{project_name}/logs | Get recent logs of the projects |
SwaggerClient::ProjectApi | get_project | GET /projects/{project_id} | Return specific project detail information |
SwaggerClient::ProjectApi | get_project_deletable | GET /projects/{project_id}/_deletable | Get the deletable status of the project |
SwaggerClient::ProjectApi | get_project_summary | GET /projects/{project_id}/summary | Get summary of the project. |
SwaggerClient::ProjectApi | head_project | HEAD /projects | Check if the project name user provided already exists. |
SwaggerClient::ProjectApi | list_projects | GET /projects | List projects |
SwaggerClient::ProjectApi | update_project | PUT /projects/{project_id} | Update properties for a selected project. |
SwaggerClient::ReplicationApi | get_replication_execution | GET /replication/executions/{id} | Get the specific replication execution |
SwaggerClient::ReplicationApi | get_replication_log | GET /replication/executions/{id}/tasks/{task_id}/log | Get the log of the specific replication task |
SwaggerClient::ReplicationApi | list_replication_executions | GET /replication/executions | List replication executions |
SwaggerClient::ReplicationApi | list_replication_tasks | GET /replication/executions/{id}/tasks | List replication tasks for a specific execution |
SwaggerClient::ReplicationApi | start_replication | POST /replication/executions | Start one replication execution |
SwaggerClient::ReplicationApi | stop_replication | PUT /replication/executions/{id} | Stop the specific replication execution |
SwaggerClient::RepositoryApi | delete_repository | DELETE /projects/{project_name}/repositories/{repository_name} | Delete repository |
SwaggerClient::RepositoryApi | get_repository | GET /projects/{project_name}/repositories/{repository_name} | Get repository |
SwaggerClient::RepositoryApi | list_repositories | GET /projects/{project_name}/repositories | List repositories |
SwaggerClient::RepositoryApi | update_repository | PUT /projects/{project_name}/repositories/{repository_name} | Update repository |
SwaggerClient::RobotApi | create_robot | POST /robots | Create a robot account |
SwaggerClient::RobotApi | delete_robot | DELETE /robots/{robot_id} | Delete a robot account |
SwaggerClient::RobotApi | get_robot_by_id | GET /robots/{robot_id} | Get a robot account |
SwaggerClient::RobotApi | list_robot | GET /robots | Get robot account |
SwaggerClient::RobotApi | refresh_sec | PATCH /robots/{robot_id} | Refresh the robot secret |
SwaggerClient::RobotApi | update_robot | PUT /robots/{robot_id} | Update a robot account |
SwaggerClient::Robotv1Api | create_robot_v1 | POST /projects/{project_id_or_name}/robots | Create a robot account |
SwaggerClient::Robotv1Api | delete_robot_v1 | DELETE /projects/{project_id_or_name}/robots/{robot_id} | Delete a robot account |
SwaggerClient::Robotv1Api | get_robot_by_idv1 | GET /projects/{project_id_or_name}/robots/{robot_id} | Get a robot account |
SwaggerClient::Robotv1Api | list_robot_v1 | GET /projects/{project_id_or_name}/robots | Get all robot accounts of specified project |
SwaggerClient::Robotv1Api | update_robot_v1 | PUT /projects/{project_id_or_name}/robots/{robot_id} | Update status of robot account. |
SwaggerClient::ScanApi | get_report_log | GET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log | Get the log of the scan report |
SwaggerClient::ScanApi | scan_artifact | POST /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan | Scan the artifact |
SwaggerClient::SysteminfoApi | systeminfo_get | GET /systeminfo | Get general system info |
SwaggerClient::SysteminfoApi | systeminfo_getcert_get | GET /systeminfo/getcert | Get default root certificate. |
SwaggerClient::SysteminfoApi | systeminfo_volumes_get | GET /systeminfo/volumes | Get system volume info (total/free size). |
- SwaggerClient::Access
- SwaggerClient::AdditionLink
- SwaggerClient::AdditionLinks
- SwaggerClient::Annotations
- SwaggerClient::Artifact
- SwaggerClient::AuditLog
- SwaggerClient::AuthproxySetting
- SwaggerClient::CVEAllowlist
- SwaggerClient::CVEAllowlistItem
- SwaggerClient::Error
- SwaggerClient::Errors
- SwaggerClient::Execution
- SwaggerClient::ExtraAttrs
- SwaggerClient::GeneralInfo
- SwaggerClient::Icon
- SwaggerClient::Instance
- SwaggerClient::Label
- SwaggerClient::Metadata
- SwaggerClient::Metrics
- SwaggerClient::NativeReportSummary
- SwaggerClient::Permission
- SwaggerClient::Platform
- SwaggerClient::PreheatPolicy
- SwaggerClient::Project
- SwaggerClient::ProjectDeletable
- SwaggerClient::ProjectMetadata
- SwaggerClient::ProjectReq
- SwaggerClient::ProjectSummary
- SwaggerClient::ProjectSummaryQuota
- SwaggerClient::ProviderUnderProject
- SwaggerClient::Reference
- SwaggerClient::Registry
- SwaggerClient::RegistryCredential
- SwaggerClient::ReplicationExecution
- SwaggerClient::ReplicationTask
- SwaggerClient::Repository
- SwaggerClient::ResourceList
- SwaggerClient::Robot
- SwaggerClient::RobotCreate
- SwaggerClient::RobotCreateV1
- SwaggerClient::RobotCreated
- SwaggerClient::RobotSec
- SwaggerClient::ScanOverview
- SwaggerClient::StartReplicationExecution
- SwaggerClient::Storage
- SwaggerClient::SystemInfo
- SwaggerClient::Tag
- SwaggerClient::Task
- SwaggerClient::VulnerabilitySummary
- Type: HTTP basic authentication