harbor2_client 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +186 -0
  4. data/Rakefile +8 -0
  5. data/docs/AdditionLink.md +9 -0
  6. data/docs/AdditionLinks.md +7 -0
  7. data/docs/Annotations.md +7 -0
  8. data/docs/Artifact.md +25 -0
  9. data/docs/ArtifactApi.md +694 -0
  10. data/docs/AuditLog.md +13 -0
  11. data/docs/AuditlogApi.md +69 -0
  12. data/docs/CVEAllowlist.md +13 -0
  13. data/docs/CVEAllowlistItem.md +8 -0
  14. data/docs/Error.md +9 -0
  15. data/docs/Errors.md +8 -0
  16. data/docs/Execution.md +17 -0
  17. data/docs/ExtraAttrs.md +7 -0
  18. data/docs/Icon.md +9 -0
  19. data/docs/IconApi.md +66 -0
  20. data/docs/Instance.md +19 -0
  21. data/docs/Label.md +15 -0
  22. data/docs/Metadata.md +13 -0
  23. data/docs/Metrics.md +14 -0
  24. data/docs/NativeReportSummary.md +15 -0
  25. data/docs/Platform.md +12 -0
  26. data/docs/PreheatApi.md +1176 -0
  27. data/docs/PreheatPolicy.md +18 -0
  28. data/docs/Project.md +22 -0
  29. data/docs/ProjectApi.md +542 -0
  30. data/docs/ProjectDeletable.md +9 -0
  31. data/docs/ProjectMetadata.md +14 -0
  32. data/docs/ProjectReq.md +13 -0
  33. data/docs/ProjectSummary.md +16 -0
  34. data/docs/ProjectSummaryQuota.md +9 -0
  35. data/docs/ProviderUnderProject.md +11 -0
  36. data/docs/Reference.md +13 -0
  37. data/docs/Registry.md +17 -0
  38. data/docs/RegistryCredential.md +10 -0
  39. data/docs/Repository.md +15 -0
  40. data/docs/RepositoryApi.md +256 -0
  41. data/docs/ResourceList.md +7 -0
  42. data/docs/ScanApi.md +138 -0
  43. data/docs/ScanOverview.md +7 -0
  44. data/docs/Tag.md +15 -0
  45. data/docs/Task.md +17 -0
  46. data/docs/VulnerabilitySummary.md +10 -0
  47. data/git_push.sh +55 -0
  48. data/harbor2_client.gemspec +46 -0
  49. data/lib/harbor2_client.rb +81 -0
  50. data/lib/harbor2_client/api/artifact_api.rb +848 -0
  51. data/lib/harbor2_client/api/auditlog_api.rb +91 -0
  52. data/lib/harbor2_client/api/icon_api.rb +84 -0
  53. data/lib/harbor2_client/api/preheat_api.rb +1327 -0
  54. data/lib/harbor2_client/api/project_api.rb +601 -0
  55. data/lib/harbor2_client/api/repository_api.rb +302 -0
  56. data/lib/harbor2_client/api/scan_api.rb +174 -0
  57. data/lib/harbor2_client/api_client.rb +391 -0
  58. data/lib/harbor2_client/api_error.rb +38 -0
  59. data/lib/harbor2_client/configuration.rb +209 -0
  60. data/lib/harbor2_client/models/addition_link.rb +195 -0
  61. data/lib/harbor2_client/models/addition_links.rb +175 -0
  62. data/lib/harbor2_client/models/annotations.rb +175 -0
  63. data/lib/harbor2_client/models/artifact.rb +355 -0
  64. data/lib/harbor2_client/models/audit_log.rb +235 -0
  65. data/lib/harbor2_client/models/cve_allowlist.rb +237 -0
  66. data/lib/harbor2_client/models/cve_allowlist_item.rb +186 -0
  67. data/lib/harbor2_client/models/error.rb +196 -0
  68. data/lib/harbor2_client/models/errors.rb +187 -0
  69. data/lib/harbor2_client/models/execution.rb +273 -0
  70. data/lib/harbor2_client/models/extra_attrs.rb +175 -0
  71. data/lib/harbor2_client/models/icon.rb +195 -0
  72. data/lib/harbor2_client/models/instance.rb +297 -0
  73. data/lib/harbor2_client/models/label.rb +255 -0
  74. data/lib/harbor2_client/models/metadata.rb +237 -0
  75. data/lib/harbor2_client/models/metrics.rb +245 -0
  76. data/lib/harbor2_client/models/native_report_summary.rb +255 -0
  77. data/lib/harbor2_client/models/platform.rb +227 -0
  78. data/lib/harbor2_client/models/preheat_policy.rb +285 -0
  79. data/lib/harbor2_client/models/project.rb +327 -0
  80. data/lib/harbor2_client/models/project_deletable.rb +195 -0
  81. data/lib/harbor2_client/models/project_metadata.rb +245 -0
  82. data/lib/harbor2_client/models/project_req.rb +235 -0
  83. data/lib/harbor2_client/models/project_summary.rb +263 -0
  84. data/lib/harbor2_client/models/project_summary_quota.rb +195 -0
  85. data/lib/harbor2_client/models/provider_under_project.rb +211 -0
  86. data/lib/harbor2_client/models/reference.rb +235 -0
  87. data/lib/harbor2_client/models/registry.rb +274 -0
  88. data/lib/harbor2_client/models/registry_credential.rb +205 -0
  89. data/lib/harbor2_client/models/repository.rb +255 -0
  90. data/lib/harbor2_client/models/resource_list.rb +175 -0
  91. data/lib/harbor2_client/models/scan_overview.rb +176 -0
  92. data/lib/harbor2_client/models/tag.rb +255 -0
  93. data/lib/harbor2_client/models/task.rb +274 -0
  94. data/lib/harbor2_client/models/vulnerability_summary.rb +208 -0
  95. data/lib/harbor2_client/version.rb +15 -0
  96. data/spec/api/artifact_api_spec.rb +209 -0
  97. data/spec/api/auditlog_api_spec.rb +50 -0
  98. data/spec/api/icon_api_spec.rb +48 -0
  99. data/spec/api/preheat_api_spec.rb +311 -0
  100. data/spec/api/project_api_spec.rb +160 -0
  101. data/spec/api/repository_api_spec.rb +94 -0
  102. data/spec/api/scan_api_spec.rb +66 -0
  103. data/spec/api_client_spec.rb +243 -0
  104. data/spec/configuration_spec.rb +42 -0
  105. data/spec/models/addition_link_spec.rb +47 -0
  106. data/spec/models/addition_links_spec.rb +35 -0
  107. data/spec/models/annotations_spec.rb +35 -0
  108. data/spec/models/artifact_spec.rb +143 -0
  109. data/spec/models/audit_log_spec.rb +71 -0
  110. data/spec/models/cve_allowlist_item_spec.rb +41 -0
  111. data/spec/models/cve_allowlist_spec.rb +71 -0
  112. data/spec/models/error_spec.rb +47 -0
  113. data/spec/models/errors_spec.rb +41 -0
  114. data/spec/models/execution_spec.rb +95 -0
  115. data/spec/models/extra_attrs_spec.rb +35 -0
  116. data/spec/models/icon_spec.rb +47 -0
  117. data/spec/models/instance_spec.rb +107 -0
  118. data/spec/models/label_spec.rb +83 -0
  119. data/spec/models/metadata_spec.rb +71 -0
  120. data/spec/models/metrics_spec.rb +77 -0
  121. data/spec/models/native_report_summary_spec.rb +83 -0
  122. data/spec/models/platform_spec.rb +65 -0
  123. data/spec/models/preheat_policy_spec.rb +101 -0
  124. data/spec/models/project_deletable_spec.rb +47 -0
  125. data/spec/models/project_metadata_spec.rb +77 -0
  126. data/spec/models/project_req_spec.rb +71 -0
  127. data/spec/models/project_spec.rb +125 -0
  128. data/spec/models/project_summary_quota_spec.rb +47 -0
  129. data/spec/models/project_summary_spec.rb +89 -0
  130. data/spec/models/provider_under_project_spec.rb +59 -0
  131. data/spec/models/reference_spec.rb +71 -0
  132. data/spec/models/registry_credential_spec.rb +53 -0
  133. data/spec/models/registry_spec.rb +95 -0
  134. data/spec/models/repository_spec.rb +83 -0
  135. data/spec/models/resource_list_spec.rb +35 -0
  136. data/spec/models/scan_overview_spec.rb +35 -0
  137. data/spec/models/tag_spec.rb +83 -0
  138. data/spec/models/task_spec.rb +95 -0
  139. data/spec/models/vulnerability_summary_spec.rb +53 -0
  140. data/spec/spec_helper.rb +111 -0
  141. metadata +428 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 06c1b271fcc751ff934f87903ed25fa951bf33c55021049775eca50cf0c04aa2
4
+ data.tar.gz: 347fcaa8d68ba804c2361afc1ec4fc88714142a0eedad6cf185199fc760c6c5c
5
+ SHA512:
6
+ metadata.gz: 5eacb7c454270d4dd637d129c51b3689d623e7748c152eebc80c584790113c7a32268de5e601e49aeb075c2dea92046cd650d2214e336c3ad2dd480857e9ea2c
7
+ data.tar.gz: eafd8a0fbb9325ec7a51c50daa3ac71677114bbbc120d5d17800be071b5ea5b292732a9423915ae42cfcbe7795fc6038188be7f12d6cfc94749ed8e595bd895c
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.3.3'
7
+ end
@@ -0,0 +1,186 @@
1
+ # harbor2_client
2
+
3
+ Harbor2Client - the Ruby gem for the [Harbor 2 API](https://github.com/goharbor/harbor/blob/master/api/v2.0/swagger.yaml).
4
+
5
+ These APIs provide services for manipulating Harbor projects.
6
+
7
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
+
9
+ - API version: 2.0
10
+ - Package version: 0.1.0
11
+ - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
+
13
+ ## Installation
14
+
15
+ ### Build a gem
16
+
17
+ To build the Ruby code into a gem:
18
+
19
+ ```shell
20
+ gem build harbor2_client.gemspec
21
+ ```
22
+
23
+ Then either install the gem locally:
24
+
25
+ ```shell
26
+ gem install ./harbor2_client-0.1.0.gem
27
+ ```
28
+ (for development, run `gem install --dev ./harbor2_client-0.1.0.gem` to install the development dependencies)
29
+
30
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
+
32
+ Finally add this to the Gemfile:
33
+
34
+ gem 'harbor2_client', '~> 0.1.0'
35
+
36
+ ### Install from Git
37
+
38
+ If the Ruby gem is hosted at a git repository: https://github.com/YOUR_GIT_USERNAME/YOUR_GIT_REPO, then add the following in the Gemfile:
39
+
40
+ gem 'harbor2_client', :git => 'https://github.com/YOUR_GIT_USERNAME/YOUR_GIT_REPO.git'
41
+
42
+ ### Include the Ruby code directly
43
+
44
+ Include the Ruby code directly using `-I` as follows:
45
+
46
+ ```shell
47
+ ruby -Ilib script.rb
48
+ ```
49
+
50
+ ## Getting Started
51
+
52
+ Please follow the [installation](#installation) procedure and then run the following code:
53
+ ```ruby
54
+ # Load the gem
55
+ require 'harbor2_client'
56
+
57
+ # Setup authorization
58
+ Harbor2Client.configure do |config|
59
+ # Configure HTTP basic authorization: basic
60
+ config.username = 'YOUR USERNAME'
61
+ config.password = 'YOUR PASSWORD'
62
+ end
63
+
64
+ api_instance = Harbor2Client::ArtifactApi.new
65
+
66
+ project_name = 'project_name_example' # String | The name of the project
67
+
68
+ 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
69
+
70
+ reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
71
+
72
+ label = Harbor2Client::Label.new # Label | The label that added to the artifact. Only the ID property is needed.
73
+
74
+ opts = {
75
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
76
+ }
77
+
78
+ begin
79
+ #Add label to artifact
80
+ api_instance.add_label(project_namerepository_name, reference, label, opts)
81
+ rescue Harbor2Client::ApiError => e
82
+ puts "Exception when calling ArtifactApi->add_label: #{e}"
83
+ end
84
+
85
+ ```
86
+
87
+ ## Documentation for API Endpoints
88
+
89
+ All URIs are relative to *http://localhost/api/v2.0*
90
+
91
+ Class | Method | HTTP request | Description
92
+ ------------ | ------------- | ------------- | -------------
93
+ *Harbor2Client::ArtifactApi* | [**add_label**](docs/ArtifactApi.md#add_label) | **POST** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels | Add label to artifact
94
+ *Harbor2Client::ArtifactApi* | [**copy_artifact**](docs/ArtifactApi.md#copy_artifact) | **POST** /projects/{project_name}/repositories/{repository_name}/artifacts | Copy artifact
95
+ *Harbor2Client::ArtifactApi* | [**create_tag**](docs/ArtifactApi.md#create_tag) | **POST** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags | Create tag
96
+ *Harbor2Client::ArtifactApi* | [**delete_artifact**](docs/ArtifactApi.md#delete_artifact) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} | Delete the specific artifact
97
+ *Harbor2Client::ArtifactApi* | [**delete_tag**](docs/ArtifactApi.md#delete_tag) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name} | Delete tag
98
+ *Harbor2Client::ArtifactApi* | [**get_addition**](docs/ArtifactApi.md#get_addition) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition} | Get the addition of the specific artifact
99
+ *Harbor2Client::ArtifactApi* | [**get_artifact**](docs/ArtifactApi.md#get_artifact) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} | Get the specific artifact
100
+ *Harbor2Client::ArtifactApi* | [**list_artifacts**](docs/ArtifactApi.md#list_artifacts) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts | List artifacts
101
+ *Harbor2Client::ArtifactApi* | [**list_tags**](docs/ArtifactApi.md#list_tags) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags | List tags
102
+ *Harbor2Client::ArtifactApi* | [**remove_label**](docs/ArtifactApi.md#remove_label) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id} | Remove label from artifact
103
+ *Harbor2Client::AuditlogApi* | [**list_audit_logs**](docs/AuditlogApi.md#list_audit_logs) | **GET** /audit-logs | Get recent logs of the projects which the user is a member of
104
+ *Harbor2Client::IconApi* | [**get_icon**](docs/IconApi.md#get_icon) | **GET** /icons/{digest} | Get artifact icon
105
+ *Harbor2Client::PreheatApi* | [**create_instance**](docs/PreheatApi.md#create_instance) | **POST** /p2p/preheat/instances | Create p2p provider instances
106
+ *Harbor2Client::PreheatApi* | [**create_policy**](docs/PreheatApi.md#create_policy) | **POST** /projects/{project_name}/preheat/policies | Create a preheat policy under a project
107
+ *Harbor2Client::PreheatApi* | [**delete_instance**](docs/PreheatApi.md#delete_instance) | **DELETE** /p2p/preheat/instances/{preheat_instance_name} | Delete the specified P2P provider instance
108
+ *Harbor2Client::PreheatApi* | [**delete_policy**](docs/PreheatApi.md#delete_policy) | **DELETE** /projects/{project_name}/preheat/policies/{preheat_policy_name} | Delete a preheat policy
109
+ *Harbor2Client::PreheatApi* | [**get_execution**](docs/PreheatApi.md#get_execution) | **GET** /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id} | Get a execution detail by id
110
+ *Harbor2Client::PreheatApi* | [**get_instance**](docs/PreheatApi.md#get_instance) | **GET** /p2p/preheat/instances/{preheat_instance_name} | Get a P2P provider instance
111
+ *Harbor2Client::PreheatApi* | [**get_policy**](docs/PreheatApi.md#get_policy) | **GET** /projects/{project_name}/preheat/policies/{preheat_policy_name} | Get a preheat policy
112
+ *Harbor2Client::PreheatApi* | [**get_preheat_log**](docs/PreheatApi.md#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
113
+ *Harbor2Client::PreheatApi* | [**list_executions**](docs/PreheatApi.md#list_executions) | **GET** /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions | List executions for the given policy
114
+ *Harbor2Client::PreheatApi* | [**list_instances**](docs/PreheatApi.md#list_instances) | **GET** /p2p/preheat/instances | List P2P provider instances
115
+ *Harbor2Client::PreheatApi* | [**list_policies**](docs/PreheatApi.md#list_policies) | **GET** /projects/{project_name}/preheat/policies | List preheat policies
116
+ *Harbor2Client::PreheatApi* | [**list_providers**](docs/PreheatApi.md#list_providers) | **GET** /p2p/preheat/providers | List P2P providers
117
+ *Harbor2Client::PreheatApi* | [**list_providers_under_project**](docs/PreheatApi.md#list_providers_under_project) | **GET** /projects/{project_name}/preheat/providers | Get all providers at project level
118
+ *Harbor2Client::PreheatApi* | [**list_tasks**](docs/PreheatApi.md#list_tasks) | **GET** /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks | List all the related tasks for the given execution
119
+ *Harbor2Client::PreheatApi* | [**manual_preheat**](docs/PreheatApi.md#manual_preheat) | **POST** /projects/{project_name}/preheat/policies/{preheat_policy_name} | Manual preheat
120
+ *Harbor2Client::PreheatApi* | [**ping_instances**](docs/PreheatApi.md#ping_instances) | **POST** /p2p/preheat/instances/ping | Ping status of a instance.
121
+ *Harbor2Client::PreheatApi* | [**stop_execution**](docs/PreheatApi.md#stop_execution) | **PATCH** /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id} | Stop a execution
122
+ *Harbor2Client::PreheatApi* | [**update_instance**](docs/PreheatApi.md#update_instance) | **PUT** /p2p/preheat/instances/{preheat_instance_name} | Update the specified P2P provider instance
123
+ *Harbor2Client::PreheatApi* | [**update_policy**](docs/PreheatApi.md#update_policy) | **PUT** /projects/{project_name}/preheat/policies/{preheat_policy_name} | Update preheat policy
124
+ *Harbor2Client::ProjectApi* | [**create_project**](docs/ProjectApi.md#create_project) | **POST** /projects | Create a new project.
125
+ *Harbor2Client::ProjectApi* | [**delete_project**](docs/ProjectApi.md#delete_project) | **DELETE** /projects/{project_id} | Delete project by projectID
126
+ *Harbor2Client::ProjectApi* | [**get_logs**](docs/ProjectApi.md#get_logs) | **GET** /projects/{project_name}/logs | Get recent logs of the projects
127
+ *Harbor2Client::ProjectApi* | [**get_project**](docs/ProjectApi.md#get_project) | **GET** /projects/{project_id} | Return specific project detail information
128
+ *Harbor2Client::ProjectApi* | [**get_project_deletable**](docs/ProjectApi.md#get_project_deletable) | **GET** /projects/{project_id}/_deletable | Get the deletable status of the project
129
+ *Harbor2Client::ProjectApi* | [**get_project_summary**](docs/ProjectApi.md#get_project_summary) | **GET** /projects/{project_id}/summary | Get summary of the project.
130
+ *Harbor2Client::ProjectApi* | [**head_project**](docs/ProjectApi.md#head_project) | **HEAD** /projects | Check if the project name user provided already exists.
131
+ *Harbor2Client::ProjectApi* | [**list_projects**](docs/ProjectApi.md#list_projects) | **GET** /projects | List projects
132
+ *Harbor2Client::ProjectApi* | [**update_project**](docs/ProjectApi.md#update_project) | **PUT** /projects/{project_id} | Update properties for a selected project.
133
+ *Harbor2Client::RepositoryApi* | [**delete_repository**](docs/RepositoryApi.md#delete_repository) | **DELETE** /projects/{project_name}/repositories/{repository_name} | Delete repository
134
+ *Harbor2Client::RepositoryApi* | [**get_repository**](docs/RepositoryApi.md#get_repository) | **GET** /projects/{project_name}/repositories/{repository_name} | Get repository
135
+ *Harbor2Client::RepositoryApi* | [**list_repositories**](docs/RepositoryApi.md#list_repositories) | **GET** /projects/{project_name}/repositories | List repositories
136
+ *Harbor2Client::RepositoryApi* | [**update_repository**](docs/RepositoryApi.md#update_repository) | **PUT** /projects/{project_name}/repositories/{repository_name} | Update repository
137
+ *Harbor2Client::ScanApi* | [**get_report_log**](docs/ScanApi.md#get_report_log) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log | Get the log of the scan report
138
+ *Harbor2Client::ScanApi* | [**scan_artifact**](docs/ScanApi.md#scan_artifact) | **POST** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan | Scan the artifact
139
+
140
+
141
+ ## Documentation for Models
142
+
143
+ - [Harbor2Client::AdditionLink](docs/AdditionLink.md)
144
+ - [Harbor2Client::AdditionLinks](docs/AdditionLinks.md)
145
+ - [Harbor2Client::Annotations](docs/Annotations.md)
146
+ - [Harbor2Client::Artifact](docs/Artifact.md)
147
+ - [Harbor2Client::AuditLog](docs/AuditLog.md)
148
+ - [Harbor2Client::CVEAllowlist](docs/CVEAllowlist.md)
149
+ - [Harbor2Client::CVEAllowlistItem](docs/CVEAllowlistItem.md)
150
+ - [Harbor2Client::Error](docs/Error.md)
151
+ - [Harbor2Client::Errors](docs/Errors.md)
152
+ - [Harbor2Client::Execution](docs/Execution.md)
153
+ - [Harbor2Client::ExtraAttrs](docs/ExtraAttrs.md)
154
+ - [Harbor2Client::Icon](docs/Icon.md)
155
+ - [Harbor2Client::Instance](docs/Instance.md)
156
+ - [Harbor2Client::Label](docs/Label.md)
157
+ - [Harbor2Client::Metadata](docs/Metadata.md)
158
+ - [Harbor2Client::Metrics](docs/Metrics.md)
159
+ - [Harbor2Client::NativeReportSummary](docs/NativeReportSummary.md)
160
+ - [Harbor2Client::Platform](docs/Platform.md)
161
+ - [Harbor2Client::PreheatPolicy](docs/PreheatPolicy.md)
162
+ - [Harbor2Client::Project](docs/Project.md)
163
+ - [Harbor2Client::ProjectDeletable](docs/ProjectDeletable.md)
164
+ - [Harbor2Client::ProjectMetadata](docs/ProjectMetadata.md)
165
+ - [Harbor2Client::ProjectReq](docs/ProjectReq.md)
166
+ - [Harbor2Client::ProjectSummary](docs/ProjectSummary.md)
167
+ - [Harbor2Client::ProjectSummaryQuota](docs/ProjectSummaryQuota.md)
168
+ - [Harbor2Client::ProviderUnderProject](docs/ProviderUnderProject.md)
169
+ - [Harbor2Client::Reference](docs/Reference.md)
170
+ - [Harbor2Client::Registry](docs/Registry.md)
171
+ - [Harbor2Client::RegistryCredential](docs/RegistryCredential.md)
172
+ - [Harbor2Client::Repository](docs/Repository.md)
173
+ - [Harbor2Client::ResourceList](docs/ResourceList.md)
174
+ - [Harbor2Client::ScanOverview](docs/ScanOverview.md)
175
+ - [Harbor2Client::Tag](docs/Tag.md)
176
+ - [Harbor2Client::Task](docs/Task.md)
177
+ - [Harbor2Client::VulnerabilitySummary](docs/VulnerabilitySummary.md)
178
+
179
+
180
+ ## Documentation for Authorization
181
+
182
+
183
+ ### basic
184
+
185
+ - **Type**: HTTP basic authentication
186
+
@@ -0,0 +1,8 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
6
+ rescue LoadError
7
+ # no rspec available
8
+ end
@@ -0,0 +1,9 @@
1
+ # Harbor2Client::AdditionLink
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **href** | **String** | The link of the addition | [optional]
7
+ **absolute** | **BOOLEAN** | Determine whether the link is an absolute URL or not | [optional]
8
+
9
+
@@ -0,0 +1,7 @@
1
+ # Harbor2Client::AdditionLinks
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,7 @@
1
+ # Harbor2Client::Annotations
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,25 @@
1
+ # Harbor2Client::Artifact
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | The ID of the artifact | [optional]
7
+ **type** | **String** | The type of the artifact, e.g. image, chart, etc | [optional]
8
+ **media_type** | **String** | The media type of the artifact | [optional]
9
+ **manifest_media_type** | **String** | The manifest media type of the artifact | [optional]
10
+ **project_id** | **Integer** | The ID of the project that the artifact belongs to | [optional]
11
+ **repository_id** | **Integer** | The ID of the repository that the artifact belongs to | [optional]
12
+ **digest** | **String** | The digest of the artifact | [optional]
13
+ **size** | **Integer** | The size of the artifact | [optional]
14
+ **icon** | **String** | The digest of the icon | [optional]
15
+ **push_time** | **DateTime** | The push time of the artifact | [optional]
16
+ **pull_time** | **DateTime** | The latest pull time of the artifact | [optional]
17
+ **extra_attrs** | [**ExtraAttrs**](ExtraAttrs.md) | | [optional]
18
+ **annotations** | [**Annotations**](Annotations.md) | | [optional]
19
+ **references** | [**Array<Reference>**](Reference.md) | | [optional]
20
+ **tags** | [**Array<Tag>**](Tag.md) | | [optional]
21
+ **addition_links** | [**AdditionLinks**](AdditionLinks.md) | | [optional]
22
+ **labels** | [**Array<Label>**](Label.md) | | [optional]
23
+ **scan_overview** | [**ScanOverview**](ScanOverview.md) | The overview of the scan result. | [optional]
24
+
25
+
@@ -0,0 +1,694 @@
1
+ # Harbor2Client::ArtifactApi
2
+
3
+ All URIs are relative to *http://localhost/api/v2.0*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**add_label**](ArtifactApi.md#add_label) | **POST** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels | Add label to artifact
8
+ [**copy_artifact**](ArtifactApi.md#copy_artifact) | **POST** /projects/{project_name}/repositories/{repository_name}/artifacts | Copy artifact
9
+ [**create_tag**](ArtifactApi.md#create_tag) | **POST** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags | Create tag
10
+ [**delete_artifact**](ArtifactApi.md#delete_artifact) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} | Delete the specific artifact
11
+ [**delete_tag**](ArtifactApi.md#delete_tag) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name} | Delete tag
12
+ [**get_addition**](ArtifactApi.md#get_addition) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition} | Get the addition of the specific artifact
13
+ [**get_artifact**](ArtifactApi.md#get_artifact) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} | Get the specific artifact
14
+ [**list_artifacts**](ArtifactApi.md#list_artifacts) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts | List artifacts
15
+ [**list_tags**](ArtifactApi.md#list_tags) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags | List tags
16
+ [**remove_label**](ArtifactApi.md#remove_label) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id} | Remove label from artifact
17
+
18
+
19
+ # **add_label**
20
+ > add_label(project_namerepository_name, reference, label, opts)
21
+
22
+ Add label to artifact
23
+
24
+ Add label to the specified artiact.
25
+
26
+ ### Example
27
+ ```ruby
28
+ # load the gem
29
+ require 'harbor2_client'
30
+ # setup authorization
31
+ Harbor2Client.configure do |config|
32
+ # Configure HTTP basic authorization: basic
33
+ config.username = 'YOUR USERNAME'
34
+ config.password = 'YOUR PASSWORD'
35
+ end
36
+
37
+ api_instance = Harbor2Client::ArtifactApi.new
38
+
39
+ project_name = 'project_name_example' # String | The name of the project
40
+
41
+ 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
42
+
43
+ reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
44
+
45
+ label = Harbor2Client::Label.new # Label | The label that added to the artifact. Only the ID property is needed.
46
+
47
+ opts = {
48
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
49
+ }
50
+
51
+ begin
52
+ #Add label to artifact
53
+ api_instance.add_label(project_namerepository_name, reference, label, opts)
54
+ rescue Harbor2Client::ApiError => e
55
+ puts "Exception when calling ArtifactApi->add_label: #{e}"
56
+ end
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+ Name | Type | Description | Notes
62
+ ------------- | ------------- | ------------- | -------------
63
+ **project_name** | **String**| The name of the project |
64
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
65
+ **reference** | **String**| The reference of the artifact, can be digest or tag |
66
+ **label** | [**Label**](Label.md)| The label that added to the artifact. Only the ID property is needed. |
67
+ **x_request_id** | **String**| An unique ID for the request | [optional]
68
+
69
+ ### Return type
70
+
71
+ nil (empty response body)
72
+
73
+ ### Authorization
74
+
75
+ [basic](../README.md#basic)
76
+
77
+ ### HTTP request headers
78
+
79
+ - **Content-Type**: application/json
80
+ - **Accept**: application/json
81
+
82
+
83
+
84
+ # **copy_artifact**
85
+ > copy_artifact(project_namerepository_name, from, opts)
86
+
87
+ Copy artifact
88
+
89
+ Copy the artifact specified in the \"from\" parameter to the repository.
90
+
91
+ ### Example
92
+ ```ruby
93
+ # load the gem
94
+ require 'harbor2_client'
95
+ # setup authorization
96
+ Harbor2Client.configure do |config|
97
+ # Configure HTTP basic authorization: basic
98
+ config.username = 'YOUR USERNAME'
99
+ config.password = 'YOUR PASSWORD'
100
+ end
101
+
102
+ api_instance = Harbor2Client::ArtifactApi.new
103
+
104
+ project_name = 'project_name_example' # String | The name of the project
105
+
106
+ 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
107
+
108
+ from = 'from_example' # String | The artifact from which the new artifact is copied from, the format should be \"project/repository:tag\" or \"project/repository@digest\".
109
+
110
+ opts = {
111
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
112
+ }
113
+
114
+ begin
115
+ #Copy artifact
116
+ api_instance.copy_artifact(project_namerepository_name, from, opts)
117
+ rescue Harbor2Client::ApiError => e
118
+ puts "Exception when calling ArtifactApi->copy_artifact: #{e}"
119
+ end
120
+ ```
121
+
122
+ ### Parameters
123
+
124
+ Name | Type | Description | Notes
125
+ ------------- | ------------- | ------------- | -------------
126
+ **project_name** | **String**| The name of the project |
127
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
128
+ **from** | **String**| The artifact from which the new artifact is copied from, the format should be \"project/repository:tag\" or \"project/repository@digest\". |
129
+ **x_request_id** | **String**| An unique ID for the request | [optional]
130
+
131
+ ### Return type
132
+
133
+ nil (empty response body)
134
+
135
+ ### Authorization
136
+
137
+ [basic](../README.md#basic)
138
+
139
+ ### HTTP request headers
140
+
141
+ - **Content-Type**: application/json
142
+ - **Accept**: application/json
143
+
144
+
145
+
146
+ # **create_tag**
147
+ > create_tag(project_namerepository_name, reference, tag, opts)
148
+
149
+ Create tag
150
+
151
+ Create a tag for the specified artifact
152
+
153
+ ### Example
154
+ ```ruby
155
+ # load the gem
156
+ require 'harbor2_client'
157
+ # setup authorization
158
+ Harbor2Client.configure do |config|
159
+ # Configure HTTP basic authorization: basic
160
+ config.username = 'YOUR USERNAME'
161
+ config.password = 'YOUR PASSWORD'
162
+ end
163
+
164
+ api_instance = Harbor2Client::ArtifactApi.new
165
+
166
+ project_name = 'project_name_example' # String | The name of the project
167
+
168
+ 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
169
+
170
+ reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
171
+
172
+ tag = Harbor2Client::Tag.new # Tag | The JSON object of tag.
173
+
174
+ opts = {
175
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
176
+ }
177
+
178
+ begin
179
+ #Create tag
180
+ api_instance.create_tag(project_namerepository_name, reference, tag, opts)
181
+ rescue Harbor2Client::ApiError => e
182
+ puts "Exception when calling ArtifactApi->create_tag: #{e}"
183
+ end
184
+ ```
185
+
186
+ ### Parameters
187
+
188
+ Name | Type | Description | Notes
189
+ ------------- | ------------- | ------------- | -------------
190
+ **project_name** | **String**| The name of the project |
191
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
192
+ **reference** | **String**| The reference of the artifact, can be digest or tag |
193
+ **tag** | [**Tag**](Tag.md)| The JSON object of tag. |
194
+ **x_request_id** | **String**| An unique ID for the request | [optional]
195
+
196
+ ### Return type
197
+
198
+ nil (empty response body)
199
+
200
+ ### Authorization
201
+
202
+ [basic](../README.md#basic)
203
+
204
+ ### HTTP request headers
205
+
206
+ - **Content-Type**: application/json
207
+ - **Accept**: application/json
208
+
209
+
210
+
211
+ # **delete_artifact**
212
+ > delete_artifact(project_namerepository_name, reference, , opts)
213
+
214
+ Delete the specific artifact
215
+
216
+ Delete the artifact specified by the reference under the project and repository. The reference can be digest or tag
217
+
218
+ ### Example
219
+ ```ruby
220
+ # load the gem
221
+ require 'harbor2_client'
222
+ # setup authorization
223
+ Harbor2Client.configure do |config|
224
+ # Configure HTTP basic authorization: basic
225
+ config.username = 'YOUR USERNAME'
226
+ config.password = 'YOUR PASSWORD'
227
+ end
228
+
229
+ api_instance = Harbor2Client::ArtifactApi.new
230
+
231
+ project_name = 'project_name_example' # String | The name of the project
232
+
233
+ 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
234
+
235
+ reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
236
+
237
+ opts = {
238
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
239
+ }
240
+
241
+ begin
242
+ #Delete the specific artifact
243
+ api_instance.delete_artifact(project_namerepository_name, reference, , opts)
244
+ rescue Harbor2Client::ApiError => e
245
+ puts "Exception when calling ArtifactApi->delete_artifact: #{e}"
246
+ end
247
+ ```
248
+
249
+ ### Parameters
250
+
251
+ Name | Type | Description | Notes
252
+ ------------- | ------------- | ------------- | -------------
253
+ **project_name** | **String**| The name of the project |
254
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
255
+ **reference** | **String**| The reference of the artifact, can be digest or tag |
256
+ **x_request_id** | **String**| An unique ID for the request | [optional]
257
+
258
+ ### Return type
259
+
260
+ nil (empty response body)
261
+
262
+ ### Authorization
263
+
264
+ [basic](../README.md#basic)
265
+
266
+ ### HTTP request headers
267
+
268
+ - **Content-Type**: application/json
269
+ - **Accept**: application/json
270
+
271
+
272
+
273
+ # **delete_tag**
274
+ > delete_tag(project_namerepository_name, reference, tag_name, opts)
275
+
276
+ Delete tag
277
+
278
+ Delete the tag of the specified artifact
279
+
280
+ ### Example
281
+ ```ruby
282
+ # load the gem
283
+ require 'harbor2_client'
284
+ # setup authorization
285
+ Harbor2Client.configure do |config|
286
+ # Configure HTTP basic authorization: basic
287
+ config.username = 'YOUR USERNAME'
288
+ config.password = 'YOUR PASSWORD'
289
+ end
290
+
291
+ api_instance = Harbor2Client::ArtifactApi.new
292
+
293
+ project_name = 'project_name_example' # String | The name of the project
294
+
295
+ 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
296
+
297
+ reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
298
+
299
+ tag_name = 'tag_name_example' # String | The name of the tag
300
+
301
+ opts = {
302
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
303
+ }
304
+
305
+ begin
306
+ #Delete tag
307
+ api_instance.delete_tag(project_namerepository_name, reference, tag_name, opts)
308
+ rescue Harbor2Client::ApiError => e
309
+ puts "Exception when calling ArtifactApi->delete_tag: #{e}"
310
+ end
311
+ ```
312
+
313
+ ### Parameters
314
+
315
+ Name | Type | Description | Notes
316
+ ------------- | ------------- | ------------- | -------------
317
+ **project_name** | **String**| The name of the project |
318
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
319
+ **reference** | **String**| The reference of the artifact, can be digest or tag |
320
+ **tag_name** | **String**| The name of the tag |
321
+ **x_request_id** | **String**| An unique ID for the request | [optional]
322
+
323
+ ### Return type
324
+
325
+ nil (empty response body)
326
+
327
+ ### Authorization
328
+
329
+ [basic](../README.md#basic)
330
+
331
+ ### HTTP request headers
332
+
333
+ - **Content-Type**: application/json
334
+ - **Accept**: application/json
335
+
336
+
337
+
338
+ # **get_addition**
339
+ > String get_addition(project_namerepository_name, reference, addition, opts)
340
+
341
+ Get the addition of the specific artifact
342
+
343
+ Get the addition of the artifact specified by the reference under the project and repository.
344
+
345
+ ### Example
346
+ ```ruby
347
+ # load the gem
348
+ require 'harbor2_client'
349
+ # setup authorization
350
+ Harbor2Client.configure do |config|
351
+ # Configure HTTP basic authorization: basic
352
+ config.username = 'YOUR USERNAME'
353
+ config.password = 'YOUR PASSWORD'
354
+ end
355
+
356
+ api_instance = Harbor2Client::ArtifactApi.new
357
+
358
+ project_name = 'project_name_example' # String | The name of the project
359
+
360
+ 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
361
+
362
+ reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
363
+
364
+ addition = 'addition_example' # String | The type of addition.
365
+
366
+ opts = {
367
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
368
+ }
369
+
370
+ begin
371
+ #Get the addition of the specific artifact
372
+ result = api_instance.get_addition(project_namerepository_name, reference, addition, opts)
373
+ p result
374
+ rescue Harbor2Client::ApiError => e
375
+ puts "Exception when calling ArtifactApi->get_addition: #{e}"
376
+ end
377
+ ```
378
+
379
+ ### Parameters
380
+
381
+ Name | Type | Description | Notes
382
+ ------------- | ------------- | ------------- | -------------
383
+ **project_name** | **String**| The name of the project |
384
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
385
+ **reference** | **String**| The reference of the artifact, can be digest or tag |
386
+ **addition** | **String**| The type of addition. |
387
+ **x_request_id** | **String**| An unique ID for the request | [optional]
388
+
389
+ ### Return type
390
+
391
+ **String**
392
+
393
+ ### Authorization
394
+
395
+ [basic](../README.md#basic)
396
+
397
+ ### HTTP request headers
398
+
399
+ - **Content-Type**: application/json
400
+ - **Accept**: application/json
401
+
402
+
403
+
404
+ # **get_artifact**
405
+ > Artifact get_artifact(project_namerepository_name, reference, , opts)
406
+
407
+ Get the specific artifact
408
+
409
+ Get the artifact specified by the reference under the project and repository. The reference can be digest or tag.
410
+
411
+ ### Example
412
+ ```ruby
413
+ # load the gem
414
+ require 'harbor2_client'
415
+ # setup authorization
416
+ Harbor2Client.configure do |config|
417
+ # Configure HTTP basic authorization: basic
418
+ config.username = 'YOUR USERNAME'
419
+ config.password = 'YOUR PASSWORD'
420
+ end
421
+
422
+ api_instance = Harbor2Client::ArtifactApi.new
423
+
424
+ project_name = 'project_name_example' # String | The name of the project
425
+
426
+ 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
427
+
428
+ reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
429
+
430
+ opts = {
431
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
432
+ page: 1, # Integer | The page number
433
+ page_size: 10, # Integer | The size of per page
434
+ with_tag: true, # BOOLEAN | Specify whether the tags are inclued inside the returning artifacts
435
+ with_label: false, # BOOLEAN | Specify whether the labels are inclued inside the returning artifacts
436
+ with_scan_overview: false, # BOOLEAN | Specify whether the scan overview is inclued inside the returning artifacts
437
+ with_signature: false, # BOOLEAN | Specify whether the signature is inclued inside the returning artifacts
438
+ with_immutable_status: false # BOOLEAN | Specify whether the immutable status is inclued inside the tags of the returning artifacts. Only works when setting \"with_tag=true\"
439
+ }
440
+
441
+ begin
442
+ #Get the specific artifact
443
+ result = api_instance.get_artifact(project_namerepository_name, reference, , opts)
444
+ p result
445
+ rescue Harbor2Client::ApiError => e
446
+ puts "Exception when calling ArtifactApi->get_artifact: #{e}"
447
+ end
448
+ ```
449
+
450
+ ### Parameters
451
+
452
+ Name | Type | Description | Notes
453
+ ------------- | ------------- | ------------- | -------------
454
+ **project_name** | **String**| The name of the project |
455
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
456
+ **reference** | **String**| The reference of the artifact, can be digest or tag |
457
+ **x_request_id** | **String**| An unique ID for the request | [optional]
458
+ **page** | **Integer**| The page number | [optional] [default to 1]
459
+ **page_size** | **Integer**| The size of per page | [optional] [default to 10]
460
+ **with_tag** | **BOOLEAN**| Specify whether the tags are inclued inside the returning artifacts | [optional] [default to true]
461
+ **with_label** | **BOOLEAN**| Specify whether the labels are inclued inside the returning artifacts | [optional] [default to false]
462
+ **with_scan_overview** | **BOOLEAN**| Specify whether the scan overview is inclued inside the returning artifacts | [optional] [default to false]
463
+ **with_signature** | **BOOLEAN**| Specify whether the signature is inclued inside the returning artifacts | [optional] [default to false]
464
+ **with_immutable_status** | **BOOLEAN**| Specify whether the immutable status is inclued inside the tags of the returning artifacts. Only works when setting \"with_tag=true\" | [optional] [default to false]
465
+
466
+ ### Return type
467
+
468
+ [**Artifact**](Artifact.md)
469
+
470
+ ### Authorization
471
+
472
+ [basic](../README.md#basic)
473
+
474
+ ### HTTP request headers
475
+
476
+ - **Content-Type**: application/json
477
+ - **Accept**: application/json
478
+
479
+
480
+
481
+ # **list_artifacts**
482
+ > Array<Artifact> list_artifacts(project_namerepository_name, , opts)
483
+
484
+ List artifacts
485
+
486
+ 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
487
+
488
+ ### Example
489
+ ```ruby
490
+ # load the gem
491
+ require 'harbor2_client'
492
+ # setup authorization
493
+ Harbor2Client.configure do |config|
494
+ # Configure HTTP basic authorization: basic
495
+ config.username = 'YOUR USERNAME'
496
+ config.password = 'YOUR PASSWORD'
497
+ end
498
+
499
+ api_instance = Harbor2Client::ArtifactApi.new
500
+
501
+ project_name = 'project_name_example' # String | The name of the project
502
+
503
+ 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
504
+
505
+ opts = {
506
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
507
+ q: 'q_example' # String | 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=[min~max]
508
+ page: 1, # Integer | The page number
509
+ page_size: 10, # Integer | The size of per page
510
+ with_tag: true, # BOOLEAN | Specify whether the tags are included inside the returning artifacts
511
+ with_label: false, # BOOLEAN | Specify whether the labels are included inside the returning artifacts
512
+ with_scan_overview: false, # BOOLEAN | Specify whether the scan overview is included inside the returning artifacts
513
+ with_signature: false, # BOOLEAN | Specify whether the signature is included inside the tags of the returning artifacts. Only works when setting \"with_tag=true\"
514
+ with_immutable_status: false # BOOLEAN | Specify whether the immutable status is included inside the tags of the returning artifacts. Only works when setting \"with_tag=true\"
515
+ }
516
+
517
+ begin
518
+ #List artifacts
519
+ result = api_instance.list_artifacts(project_namerepository_name, , opts)
520
+ p result
521
+ rescue Harbor2Client::ApiError => e
522
+ puts "Exception when calling ArtifactApi->list_artifacts: #{e}"
523
+ end
524
+ ```
525
+
526
+ ### Parameters
527
+
528
+ Name | Type | Description | Notes
529
+ ------------- | ------------- | ------------- | -------------
530
+ **project_name** | **String**| The name of the project |
531
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
532
+ **x_request_id** | **String**| An unique ID for the request | [optional]
533
+ **q** | **String**| 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=[min~max] | [optional]
534
+ **page** | **Integer**| The page number | [optional] [default to 1]
535
+ **page_size** | **Integer**| The size of per page | [optional] [default to 10]
536
+ **with_tag** | **BOOLEAN**| Specify whether the tags are included inside the returning artifacts | [optional] [default to true]
537
+ **with_label** | **BOOLEAN**| Specify whether the labels are included inside the returning artifacts | [optional] [default to false]
538
+ **with_scan_overview** | **BOOLEAN**| Specify whether the scan overview is included inside the returning artifacts | [optional] [default to false]
539
+ **with_signature** | **BOOLEAN**| Specify whether the signature is included inside the tags of the returning artifacts. Only works when setting \"with_tag=true\" | [optional] [default to false]
540
+ **with_immutable_status** | **BOOLEAN**| Specify whether the immutable status is included inside the tags of the returning artifacts. Only works when setting \"with_tag=true\" | [optional] [default to false]
541
+
542
+ ### Return type
543
+
544
+ [**Array<Artifact>**](Artifact.md)
545
+
546
+ ### Authorization
547
+
548
+ [basic](../README.md#basic)
549
+
550
+ ### HTTP request headers
551
+
552
+ - **Content-Type**: application/json
553
+ - **Accept**: application/json
554
+
555
+
556
+
557
+ # **list_tags**
558
+ > Array<Tag> list_tags(project_namerepository_name, reference, , opts)
559
+
560
+ List tags
561
+
562
+ List tags of the specific artifact
563
+
564
+ ### Example
565
+ ```ruby
566
+ # load the gem
567
+ require 'harbor2_client'
568
+ # setup authorization
569
+ Harbor2Client.configure do |config|
570
+ # Configure HTTP basic authorization: basic
571
+ config.username = 'YOUR USERNAME'
572
+ config.password = 'YOUR PASSWORD'
573
+ end
574
+
575
+ api_instance = Harbor2Client::ArtifactApi.new
576
+
577
+ project_name = 'project_name_example' # String | The name of the project
578
+
579
+ 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
580
+
581
+ reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
582
+
583
+ opts = {
584
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
585
+ q: 'q_example' # String | 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=[min~max]
586
+ page: 1, # Integer | The page number
587
+ page_size: 10, # Integer | The size of per page
588
+ with_signature: false, # BOOLEAN | Specify whether the signature is included inside the returning tags
589
+ with_immutable_status: false # BOOLEAN | Specify whether the immutable status is included inside the returning tags
590
+ }
591
+
592
+ begin
593
+ #List tags
594
+ result = api_instance.list_tags(project_namerepository_name, reference, , opts)
595
+ p result
596
+ rescue Harbor2Client::ApiError => e
597
+ puts "Exception when calling ArtifactApi->list_tags: #{e}"
598
+ end
599
+ ```
600
+
601
+ ### Parameters
602
+
603
+ Name | Type | Description | Notes
604
+ ------------- | ------------- | ------------- | -------------
605
+ **project_name** | **String**| The name of the project |
606
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
607
+ **reference** | **String**| The reference of the artifact, can be digest or tag |
608
+ **x_request_id** | **String**| An unique ID for the request | [optional]
609
+ **q** | **String**| 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=[min~max] | [optional]
610
+ **page** | **Integer**| The page number | [optional] [default to 1]
611
+ **page_size** | **Integer**| The size of per page | [optional] [default to 10]
612
+ **with_signature** | **BOOLEAN**| Specify whether the signature is included inside the returning tags | [optional] [default to false]
613
+ **with_immutable_status** | **BOOLEAN**| Specify whether the immutable status is included inside the returning tags | [optional] [default to false]
614
+
615
+ ### Return type
616
+
617
+ [**Array<Tag>**](Tag.md)
618
+
619
+ ### Authorization
620
+
621
+ [basic](../README.md#basic)
622
+
623
+ ### HTTP request headers
624
+
625
+ - **Content-Type**: application/json
626
+ - **Accept**: application/json
627
+
628
+
629
+
630
+ # **remove_label**
631
+ > remove_label(project_namerepository_name, reference, label_id, opts)
632
+
633
+ Remove label from artifact
634
+
635
+ Remove the label from the specified artiact.
636
+
637
+ ### Example
638
+ ```ruby
639
+ # load the gem
640
+ require 'harbor2_client'
641
+ # setup authorization
642
+ Harbor2Client.configure do |config|
643
+ # Configure HTTP basic authorization: basic
644
+ config.username = 'YOUR USERNAME'
645
+ config.password = 'YOUR PASSWORD'
646
+ end
647
+
648
+ api_instance = Harbor2Client::ArtifactApi.new
649
+
650
+ project_name = 'project_name_example' # String | The name of the project
651
+
652
+ 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
653
+
654
+ reference = 'reference_example' # String | The reference of the artifact, can be digest or tag
655
+
656
+ label_id = 789 # Integer | The ID of the label that removed from the artifact.
657
+
658
+ opts = {
659
+ x_request_id: 'x_request_id_example' # String | An unique ID for the request
660
+ }
661
+
662
+ begin
663
+ #Remove label from artifact
664
+ api_instance.remove_label(project_namerepository_name, reference, label_id, opts)
665
+ rescue Harbor2Client::ApiError => e
666
+ puts "Exception when calling ArtifactApi->remove_label: #{e}"
667
+ end
668
+ ```
669
+
670
+ ### Parameters
671
+
672
+ Name | Type | Description | Notes
673
+ ------------- | ------------- | ------------- | -------------
674
+ **project_name** | **String**| The name of the project |
675
+ **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb |
676
+ **reference** | **String**| The reference of the artifact, can be digest or tag |
677
+ **label_id** | **Integer**| The ID of the label that removed from the artifact. |
678
+ **x_request_id** | **String**| An unique ID for the request | [optional]
679
+
680
+ ### Return type
681
+
682
+ nil (empty response body)
683
+
684
+ ### Authorization
685
+
686
+ [basic](../README.md#basic)
687
+
688
+ ### HTTP request headers
689
+
690
+ - **Content-Type**: application/json
691
+ - **Accept**: application/json
692
+
693
+
694
+