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.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +186 -0
- data/Rakefile +8 -0
- data/docs/AdditionLink.md +9 -0
- data/docs/AdditionLinks.md +7 -0
- data/docs/Annotations.md +7 -0
- data/docs/Artifact.md +25 -0
- data/docs/ArtifactApi.md +694 -0
- data/docs/AuditLog.md +13 -0
- data/docs/AuditlogApi.md +69 -0
- data/docs/CVEAllowlist.md +13 -0
- data/docs/CVEAllowlistItem.md +8 -0
- data/docs/Error.md +9 -0
- data/docs/Errors.md +8 -0
- data/docs/Execution.md +17 -0
- data/docs/ExtraAttrs.md +7 -0
- data/docs/Icon.md +9 -0
- data/docs/IconApi.md +66 -0
- data/docs/Instance.md +19 -0
- data/docs/Label.md +15 -0
- data/docs/Metadata.md +13 -0
- data/docs/Metrics.md +14 -0
- data/docs/NativeReportSummary.md +15 -0
- data/docs/Platform.md +12 -0
- data/docs/PreheatApi.md +1176 -0
- data/docs/PreheatPolicy.md +18 -0
- data/docs/Project.md +22 -0
- data/docs/ProjectApi.md +542 -0
- data/docs/ProjectDeletable.md +9 -0
- data/docs/ProjectMetadata.md +14 -0
- data/docs/ProjectReq.md +13 -0
- data/docs/ProjectSummary.md +16 -0
- data/docs/ProjectSummaryQuota.md +9 -0
- data/docs/ProviderUnderProject.md +11 -0
- data/docs/Reference.md +13 -0
- data/docs/Registry.md +17 -0
- data/docs/RegistryCredential.md +10 -0
- data/docs/Repository.md +15 -0
- data/docs/RepositoryApi.md +256 -0
- data/docs/ResourceList.md +7 -0
- data/docs/ScanApi.md +138 -0
- data/docs/ScanOverview.md +7 -0
- data/docs/Tag.md +15 -0
- data/docs/Task.md +17 -0
- data/docs/VulnerabilitySummary.md +10 -0
- data/git_push.sh +55 -0
- data/harbor2_client.gemspec +46 -0
- data/lib/harbor2_client.rb +81 -0
- data/lib/harbor2_client/api/artifact_api.rb +848 -0
- data/lib/harbor2_client/api/auditlog_api.rb +91 -0
- data/lib/harbor2_client/api/icon_api.rb +84 -0
- data/lib/harbor2_client/api/preheat_api.rb +1327 -0
- data/lib/harbor2_client/api/project_api.rb +601 -0
- data/lib/harbor2_client/api/repository_api.rb +302 -0
- data/lib/harbor2_client/api/scan_api.rb +174 -0
- data/lib/harbor2_client/api_client.rb +391 -0
- data/lib/harbor2_client/api_error.rb +38 -0
- data/lib/harbor2_client/configuration.rb +209 -0
- data/lib/harbor2_client/models/addition_link.rb +195 -0
- data/lib/harbor2_client/models/addition_links.rb +175 -0
- data/lib/harbor2_client/models/annotations.rb +175 -0
- data/lib/harbor2_client/models/artifact.rb +355 -0
- data/lib/harbor2_client/models/audit_log.rb +235 -0
- data/lib/harbor2_client/models/cve_allowlist.rb +237 -0
- data/lib/harbor2_client/models/cve_allowlist_item.rb +186 -0
- data/lib/harbor2_client/models/error.rb +196 -0
- data/lib/harbor2_client/models/errors.rb +187 -0
- data/lib/harbor2_client/models/execution.rb +273 -0
- data/lib/harbor2_client/models/extra_attrs.rb +175 -0
- data/lib/harbor2_client/models/icon.rb +195 -0
- data/lib/harbor2_client/models/instance.rb +297 -0
- data/lib/harbor2_client/models/label.rb +255 -0
- data/lib/harbor2_client/models/metadata.rb +237 -0
- data/lib/harbor2_client/models/metrics.rb +245 -0
- data/lib/harbor2_client/models/native_report_summary.rb +255 -0
- data/lib/harbor2_client/models/platform.rb +227 -0
- data/lib/harbor2_client/models/preheat_policy.rb +285 -0
- data/lib/harbor2_client/models/project.rb +327 -0
- data/lib/harbor2_client/models/project_deletable.rb +195 -0
- data/lib/harbor2_client/models/project_metadata.rb +245 -0
- data/lib/harbor2_client/models/project_req.rb +235 -0
- data/lib/harbor2_client/models/project_summary.rb +263 -0
- data/lib/harbor2_client/models/project_summary_quota.rb +195 -0
- data/lib/harbor2_client/models/provider_under_project.rb +211 -0
- data/lib/harbor2_client/models/reference.rb +235 -0
- data/lib/harbor2_client/models/registry.rb +274 -0
- data/lib/harbor2_client/models/registry_credential.rb +205 -0
- data/lib/harbor2_client/models/repository.rb +255 -0
- data/lib/harbor2_client/models/resource_list.rb +175 -0
- data/lib/harbor2_client/models/scan_overview.rb +176 -0
- data/lib/harbor2_client/models/tag.rb +255 -0
- data/lib/harbor2_client/models/task.rb +274 -0
- data/lib/harbor2_client/models/vulnerability_summary.rb +208 -0
- data/lib/harbor2_client/version.rb +15 -0
- data/spec/api/artifact_api_spec.rb +209 -0
- data/spec/api/auditlog_api_spec.rb +50 -0
- data/spec/api/icon_api_spec.rb +48 -0
- data/spec/api/preheat_api_spec.rb +311 -0
- data/spec/api/project_api_spec.rb +160 -0
- data/spec/api/repository_api_spec.rb +94 -0
- data/spec/api/scan_api_spec.rb +66 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/addition_link_spec.rb +47 -0
- data/spec/models/addition_links_spec.rb +35 -0
- data/spec/models/annotations_spec.rb +35 -0
- data/spec/models/artifact_spec.rb +143 -0
- data/spec/models/audit_log_spec.rb +71 -0
- data/spec/models/cve_allowlist_item_spec.rb +41 -0
- data/spec/models/cve_allowlist_spec.rb +71 -0
- data/spec/models/error_spec.rb +47 -0
- data/spec/models/errors_spec.rb +41 -0
- data/spec/models/execution_spec.rb +95 -0
- data/spec/models/extra_attrs_spec.rb +35 -0
- data/spec/models/icon_spec.rb +47 -0
- data/spec/models/instance_spec.rb +107 -0
- data/spec/models/label_spec.rb +83 -0
- data/spec/models/metadata_spec.rb +71 -0
- data/spec/models/metrics_spec.rb +77 -0
- data/spec/models/native_report_summary_spec.rb +83 -0
- data/spec/models/platform_spec.rb +65 -0
- data/spec/models/preheat_policy_spec.rb +101 -0
- data/spec/models/project_deletable_spec.rb +47 -0
- data/spec/models/project_metadata_spec.rb +77 -0
- data/spec/models/project_req_spec.rb +71 -0
- data/spec/models/project_spec.rb +125 -0
- data/spec/models/project_summary_quota_spec.rb +47 -0
- data/spec/models/project_summary_spec.rb +89 -0
- data/spec/models/provider_under_project_spec.rb +59 -0
- data/spec/models/reference_spec.rb +71 -0
- data/spec/models/registry_credential_spec.rb +53 -0
- data/spec/models/registry_spec.rb +95 -0
- data/spec/models/repository_spec.rb +83 -0
- data/spec/models/resource_list_spec.rb +35 -0
- data/spec/models/scan_overview_spec.rb +35 -0
- data/spec/models/tag_spec.rb +83 -0
- data/spec/models/task_spec.rb +95 -0
- data/spec/models/vulnerability_summary_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- metadata +428 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Harbor2Client::PreheatPolicy
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**id** | **Integer** | The ID of preheat policy | [optional]
|
|
7
|
+
**name** | **String** | The Name of preheat policy | [optional]
|
|
8
|
+
**description** | **String** | The Description of preheat policy | [optional]
|
|
9
|
+
**project_id** | **Integer** | The ID of preheat policy project | [optional]
|
|
10
|
+
**provider_id** | **Integer** | The ID of preheat policy provider | [optional]
|
|
11
|
+
**provider_name** | **String** | The Name of preheat policy provider | [optional]
|
|
12
|
+
**filters** | **String** | The Filters of preheat policy | [optional]
|
|
13
|
+
**trigger** | **String** | The Trigger of preheat policy | [optional]
|
|
14
|
+
**enabled** | **BOOLEAN** | Whether the preheat policy enabled | [optional]
|
|
15
|
+
**creation_time** | **DateTime** | The Create Time of preheat policy | [optional]
|
|
16
|
+
**update_time** | **DateTime** | The Update Time of preheat policy | [optional]
|
|
17
|
+
|
|
18
|
+
|
data/docs/Project.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Harbor2Client::Project
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**project_id** | **Integer** | Project ID | [optional]
|
|
7
|
+
**owner_id** | **Integer** | The owner ID of the project always means the creator of the project. | [optional]
|
|
8
|
+
**name** | **String** | The name of the project. | [optional]
|
|
9
|
+
**registry_id** | **Integer** | The ID of referenced registry when the project is a proxy cache project. | [optional]
|
|
10
|
+
**creation_time** | **DateTime** | The creation time of the project. | [optional]
|
|
11
|
+
**update_time** | **DateTime** | The update time of the project. | [optional]
|
|
12
|
+
**deleted** | **BOOLEAN** | A deletion mark of the project. | [optional]
|
|
13
|
+
**owner_name** | **String** | The owner name of the project. | [optional]
|
|
14
|
+
**togglable** | **BOOLEAN** | Correspond to the UI about whether the project's publicity is updatable (for UI) | [optional]
|
|
15
|
+
**current_user_role_id** | **Integer** | The role ID with highest permission of the current user who triggered the API (for UI). This attribute is deprecated and will be removed in future versions. | [optional]
|
|
16
|
+
**current_user_role_ids** | **Array<Integer>** | The list of role ID of the current user who triggered the API (for UI) | [optional]
|
|
17
|
+
**repo_count** | **Integer** | The number of the repositories under this project. | [optional]
|
|
18
|
+
**chart_count** | **Integer** | The total number of charts under this project. | [optional]
|
|
19
|
+
**metadata** | [**ProjectMetadata**](ProjectMetadata.md) | The metadata of the project. | [optional]
|
|
20
|
+
**cve_allowlist** | [**CVEAllowlist**](CVEAllowlist.md) | The CVE allowlist of this project. | [optional]
|
|
21
|
+
|
|
22
|
+
|
data/docs/ProjectApi.md
ADDED
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
# Harbor2Client::ProjectApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost/api/v2.0*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**create_project**](ProjectApi.md#create_project) | **POST** /projects | Create a new project.
|
|
8
|
+
[**delete_project**](ProjectApi.md#delete_project) | **DELETE** /projects/{project_id} | Delete project by projectID
|
|
9
|
+
[**get_logs**](ProjectApi.md#get_logs) | **GET** /projects/{project_name}/logs | Get recent logs of the projects
|
|
10
|
+
[**get_project**](ProjectApi.md#get_project) | **GET** /projects/{project_id} | Return specific project detail information
|
|
11
|
+
[**get_project_deletable**](ProjectApi.md#get_project_deletable) | **GET** /projects/{project_id}/_deletable | Get the deletable status of the project
|
|
12
|
+
[**get_project_summary**](ProjectApi.md#get_project_summary) | **GET** /projects/{project_id}/summary | Get summary of the project.
|
|
13
|
+
[**head_project**](ProjectApi.md#head_project) | **HEAD** /projects | Check if the project name user provided already exists.
|
|
14
|
+
[**list_projects**](ProjectApi.md#list_projects) | **GET** /projects | List projects
|
|
15
|
+
[**update_project**](ProjectApi.md#update_project) | **PUT** /projects/{project_id} | Update properties for a selected project.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# **create_project**
|
|
19
|
+
> create_project(project, opts)
|
|
20
|
+
|
|
21
|
+
Create a new project.
|
|
22
|
+
|
|
23
|
+
This endpoint is for user to create a new project.
|
|
24
|
+
|
|
25
|
+
### Example
|
|
26
|
+
```ruby
|
|
27
|
+
# load the gem
|
|
28
|
+
require 'harbor2_client'
|
|
29
|
+
# setup authorization
|
|
30
|
+
Harbor2Client.configure do |config|
|
|
31
|
+
# Configure HTTP basic authorization: basic
|
|
32
|
+
config.username = 'YOUR USERNAME'
|
|
33
|
+
config.password = 'YOUR PASSWORD'
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
api_instance = Harbor2Client::ProjectApi.new
|
|
37
|
+
|
|
38
|
+
project = Harbor2Client::ProjectReq.new # ProjectReq | New created project.
|
|
39
|
+
|
|
40
|
+
opts = {
|
|
41
|
+
x_request_id: 'x_request_id_example' # String | An unique ID for the request
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
begin
|
|
45
|
+
#Create a new project.
|
|
46
|
+
api_instance.create_project(project, opts)
|
|
47
|
+
rescue Harbor2Client::ApiError => e
|
|
48
|
+
puts "Exception when calling ProjectApi->create_project: #{e}"
|
|
49
|
+
end
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Parameters
|
|
53
|
+
|
|
54
|
+
Name | Type | Description | Notes
|
|
55
|
+
------------- | ------------- | ------------- | -------------
|
|
56
|
+
**project** | [**ProjectReq**](ProjectReq.md)| New created project. |
|
|
57
|
+
**x_request_id** | **String**| An unique ID for the request | [optional]
|
|
58
|
+
|
|
59
|
+
### Return type
|
|
60
|
+
|
|
61
|
+
nil (empty response body)
|
|
62
|
+
|
|
63
|
+
### Authorization
|
|
64
|
+
|
|
65
|
+
[basic](../README.md#basic)
|
|
66
|
+
|
|
67
|
+
### HTTP request headers
|
|
68
|
+
|
|
69
|
+
- **Content-Type**: application/json
|
|
70
|
+
- **Accept**: application/json
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# **delete_project**
|
|
75
|
+
> delete_project(project_id, opts)
|
|
76
|
+
|
|
77
|
+
Delete project by projectID
|
|
78
|
+
|
|
79
|
+
This endpoint is aimed to delete project by project ID.
|
|
80
|
+
|
|
81
|
+
### Example
|
|
82
|
+
```ruby
|
|
83
|
+
# load the gem
|
|
84
|
+
require 'harbor2_client'
|
|
85
|
+
# setup authorization
|
|
86
|
+
Harbor2Client.configure do |config|
|
|
87
|
+
# Configure HTTP basic authorization: basic
|
|
88
|
+
config.username = 'YOUR USERNAME'
|
|
89
|
+
config.password = 'YOUR PASSWORD'
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
api_instance = Harbor2Client::ProjectApi.new
|
|
93
|
+
|
|
94
|
+
project_id = 789 # Integer | The ID of the project
|
|
95
|
+
|
|
96
|
+
opts = {
|
|
97
|
+
x_request_id: 'x_request_id_example' # String | An unique ID for the request
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
begin
|
|
101
|
+
#Delete project by projectID
|
|
102
|
+
api_instance.delete_project(project_id, opts)
|
|
103
|
+
rescue Harbor2Client::ApiError => e
|
|
104
|
+
puts "Exception when calling ProjectApi->delete_project: #{e}"
|
|
105
|
+
end
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Parameters
|
|
109
|
+
|
|
110
|
+
Name | Type | Description | Notes
|
|
111
|
+
------------- | ------------- | ------------- | -------------
|
|
112
|
+
**project_id** | **Integer**| The ID of the project |
|
|
113
|
+
**x_request_id** | **String**| An unique ID for the request | [optional]
|
|
114
|
+
|
|
115
|
+
### Return type
|
|
116
|
+
|
|
117
|
+
nil (empty response body)
|
|
118
|
+
|
|
119
|
+
### Authorization
|
|
120
|
+
|
|
121
|
+
[basic](../README.md#basic)
|
|
122
|
+
|
|
123
|
+
### HTTP request headers
|
|
124
|
+
|
|
125
|
+
- **Content-Type**: application/json
|
|
126
|
+
- **Accept**: application/json
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
# **get_logs**
|
|
131
|
+
> Array<AuditLog> get_logs(project_name, opts)
|
|
132
|
+
|
|
133
|
+
Get recent logs of the projects
|
|
134
|
+
|
|
135
|
+
Get recent logs of the projects
|
|
136
|
+
|
|
137
|
+
### Example
|
|
138
|
+
```ruby
|
|
139
|
+
# load the gem
|
|
140
|
+
require 'harbor2_client'
|
|
141
|
+
# setup authorization
|
|
142
|
+
Harbor2Client.configure do |config|
|
|
143
|
+
# Configure HTTP basic authorization: basic
|
|
144
|
+
config.username = 'YOUR USERNAME'
|
|
145
|
+
config.password = 'YOUR PASSWORD'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
api_instance = Harbor2Client::ProjectApi.new
|
|
149
|
+
|
|
150
|
+
project_name = 'project_name_example' # String | The name of the project
|
|
151
|
+
|
|
152
|
+
opts = {
|
|
153
|
+
x_request_id: 'x_request_id_example' # String | An unique ID for the request
|
|
154
|
+
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]
|
|
155
|
+
page: 1, # Integer | The page number
|
|
156
|
+
page_size: 10, # Integer | The size of per page
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
begin
|
|
160
|
+
#Get recent logs of the projects
|
|
161
|
+
result = api_instance.get_logs(project_name, opts)
|
|
162
|
+
p result
|
|
163
|
+
rescue Harbor2Client::ApiError => e
|
|
164
|
+
puts "Exception when calling ProjectApi->get_logs: #{e}"
|
|
165
|
+
end
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Parameters
|
|
169
|
+
|
|
170
|
+
Name | Type | Description | Notes
|
|
171
|
+
------------- | ------------- | ------------- | -------------
|
|
172
|
+
**project_name** | **String**| The name of the project |
|
|
173
|
+
**x_request_id** | **String**| An unique ID for the request | [optional]
|
|
174
|
+
**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]
|
|
175
|
+
**page** | **Integer**| The page number | [optional] [default to 1]
|
|
176
|
+
**page_size** | **Integer**| The size of per page | [optional] [default to 10]
|
|
177
|
+
|
|
178
|
+
### Return type
|
|
179
|
+
|
|
180
|
+
[**Array<AuditLog>**](AuditLog.md)
|
|
181
|
+
|
|
182
|
+
### Authorization
|
|
183
|
+
|
|
184
|
+
[basic](../README.md#basic)
|
|
185
|
+
|
|
186
|
+
### HTTP request headers
|
|
187
|
+
|
|
188
|
+
- **Content-Type**: application/json
|
|
189
|
+
- **Accept**: application/json
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
# **get_project**
|
|
194
|
+
> Project get_project(project_id, opts)
|
|
195
|
+
|
|
196
|
+
Return specific project detail information
|
|
197
|
+
|
|
198
|
+
This endpoint returns specific project information by project ID.
|
|
199
|
+
|
|
200
|
+
### Example
|
|
201
|
+
```ruby
|
|
202
|
+
# load the gem
|
|
203
|
+
require 'harbor2_client'
|
|
204
|
+
# setup authorization
|
|
205
|
+
Harbor2Client.configure do |config|
|
|
206
|
+
# Configure HTTP basic authorization: basic
|
|
207
|
+
config.username = 'YOUR USERNAME'
|
|
208
|
+
config.password = 'YOUR PASSWORD'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
api_instance = Harbor2Client::ProjectApi.new
|
|
212
|
+
|
|
213
|
+
project_id = 789 # Integer | The ID of the project
|
|
214
|
+
|
|
215
|
+
opts = {
|
|
216
|
+
x_request_id: 'x_request_id_example' # String | An unique ID for the request
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
begin
|
|
220
|
+
#Return specific project detail information
|
|
221
|
+
result = api_instance.get_project(project_id, opts)
|
|
222
|
+
p result
|
|
223
|
+
rescue Harbor2Client::ApiError => e
|
|
224
|
+
puts "Exception when calling ProjectApi->get_project: #{e}"
|
|
225
|
+
end
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Parameters
|
|
229
|
+
|
|
230
|
+
Name | Type | Description | Notes
|
|
231
|
+
------------- | ------------- | ------------- | -------------
|
|
232
|
+
**project_id** | **Integer**| The ID of the project |
|
|
233
|
+
**x_request_id** | **String**| An unique ID for the request | [optional]
|
|
234
|
+
|
|
235
|
+
### Return type
|
|
236
|
+
|
|
237
|
+
[**Project**](Project.md)
|
|
238
|
+
|
|
239
|
+
### Authorization
|
|
240
|
+
|
|
241
|
+
[basic](../README.md#basic)
|
|
242
|
+
|
|
243
|
+
### HTTP request headers
|
|
244
|
+
|
|
245
|
+
- **Content-Type**: application/json
|
|
246
|
+
- **Accept**: application/json
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
# **get_project_deletable**
|
|
251
|
+
> ProjectDeletable get_project_deletable(project_id, opts)
|
|
252
|
+
|
|
253
|
+
Get the deletable status of the project
|
|
254
|
+
|
|
255
|
+
Get the deletable status of the project
|
|
256
|
+
|
|
257
|
+
### Example
|
|
258
|
+
```ruby
|
|
259
|
+
# load the gem
|
|
260
|
+
require 'harbor2_client'
|
|
261
|
+
# setup authorization
|
|
262
|
+
Harbor2Client.configure do |config|
|
|
263
|
+
# Configure HTTP basic authorization: basic
|
|
264
|
+
config.username = 'YOUR USERNAME'
|
|
265
|
+
config.password = 'YOUR PASSWORD'
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
api_instance = Harbor2Client::ProjectApi.new
|
|
269
|
+
|
|
270
|
+
project_id = 789 # Integer | The ID of the project
|
|
271
|
+
|
|
272
|
+
opts = {
|
|
273
|
+
x_request_id: 'x_request_id_example' # String | An unique ID for the request
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
begin
|
|
277
|
+
#Get the deletable status of the project
|
|
278
|
+
result = api_instance.get_project_deletable(project_id, opts)
|
|
279
|
+
p result
|
|
280
|
+
rescue Harbor2Client::ApiError => e
|
|
281
|
+
puts "Exception when calling ProjectApi->get_project_deletable: #{e}"
|
|
282
|
+
end
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Parameters
|
|
286
|
+
|
|
287
|
+
Name | Type | Description | Notes
|
|
288
|
+
------------- | ------------- | ------------- | -------------
|
|
289
|
+
**project_id** | **Integer**| The ID of the project |
|
|
290
|
+
**x_request_id** | **String**| An unique ID for the request | [optional]
|
|
291
|
+
|
|
292
|
+
### Return type
|
|
293
|
+
|
|
294
|
+
[**ProjectDeletable**](ProjectDeletable.md)
|
|
295
|
+
|
|
296
|
+
### Authorization
|
|
297
|
+
|
|
298
|
+
[basic](../README.md#basic)
|
|
299
|
+
|
|
300
|
+
### HTTP request headers
|
|
301
|
+
|
|
302
|
+
- **Content-Type**: application/json
|
|
303
|
+
- **Accept**: application/json
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
# **get_project_summary**
|
|
308
|
+
> ProjectSummary get_project_summary(project_id, opts)
|
|
309
|
+
|
|
310
|
+
Get summary of the project.
|
|
311
|
+
|
|
312
|
+
Get summary of the project.
|
|
313
|
+
|
|
314
|
+
### Example
|
|
315
|
+
```ruby
|
|
316
|
+
# load the gem
|
|
317
|
+
require 'harbor2_client'
|
|
318
|
+
# setup authorization
|
|
319
|
+
Harbor2Client.configure do |config|
|
|
320
|
+
# Configure HTTP basic authorization: basic
|
|
321
|
+
config.username = 'YOUR USERNAME'
|
|
322
|
+
config.password = 'YOUR PASSWORD'
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
api_instance = Harbor2Client::ProjectApi.new
|
|
326
|
+
|
|
327
|
+
project_id = 789 # Integer | The ID of the project
|
|
328
|
+
|
|
329
|
+
opts = {
|
|
330
|
+
x_request_id: 'x_request_id_example' # String | An unique ID for the request
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
begin
|
|
334
|
+
#Get summary of the project.
|
|
335
|
+
result = api_instance.get_project_summary(project_id, opts)
|
|
336
|
+
p result
|
|
337
|
+
rescue Harbor2Client::ApiError => e
|
|
338
|
+
puts "Exception when calling ProjectApi->get_project_summary: #{e}"
|
|
339
|
+
end
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Parameters
|
|
343
|
+
|
|
344
|
+
Name | Type | Description | Notes
|
|
345
|
+
------------- | ------------- | ------------- | -------------
|
|
346
|
+
**project_id** | **Integer**| The ID of the project |
|
|
347
|
+
**x_request_id** | **String**| An unique ID for the request | [optional]
|
|
348
|
+
|
|
349
|
+
### Return type
|
|
350
|
+
|
|
351
|
+
[**ProjectSummary**](ProjectSummary.md)
|
|
352
|
+
|
|
353
|
+
### Authorization
|
|
354
|
+
|
|
355
|
+
[basic](../README.md#basic)
|
|
356
|
+
|
|
357
|
+
### HTTP request headers
|
|
358
|
+
|
|
359
|
+
- **Content-Type**: application/json
|
|
360
|
+
- **Accept**: application/json
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
# **head_project**
|
|
365
|
+
> head_project(project_name, opts)
|
|
366
|
+
|
|
367
|
+
Check if the project name user provided already exists.
|
|
368
|
+
|
|
369
|
+
This endpoint is used to check if the project name provided already exist.
|
|
370
|
+
|
|
371
|
+
### Example
|
|
372
|
+
```ruby
|
|
373
|
+
# load the gem
|
|
374
|
+
require 'harbor2_client'
|
|
375
|
+
# setup authorization
|
|
376
|
+
Harbor2Client.configure do |config|
|
|
377
|
+
# Configure HTTP basic authorization: basic
|
|
378
|
+
config.username = 'YOUR USERNAME'
|
|
379
|
+
config.password = 'YOUR PASSWORD'
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
api_instance = Harbor2Client::ProjectApi.new
|
|
383
|
+
|
|
384
|
+
project_name = 'project_name_example' # String | Project name for checking exists.
|
|
385
|
+
|
|
386
|
+
opts = {
|
|
387
|
+
x_request_id: 'x_request_id_example' # String | An unique ID for the request
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
begin
|
|
391
|
+
#Check if the project name user provided already exists.
|
|
392
|
+
api_instance.head_project(project_name, opts)
|
|
393
|
+
rescue Harbor2Client::ApiError => e
|
|
394
|
+
puts "Exception when calling ProjectApi->head_project: #{e}"
|
|
395
|
+
end
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Parameters
|
|
399
|
+
|
|
400
|
+
Name | Type | Description | Notes
|
|
401
|
+
------------- | ------------- | ------------- | -------------
|
|
402
|
+
**project_name** | **String**| Project name for checking exists. |
|
|
403
|
+
**x_request_id** | **String**| An unique ID for the request | [optional]
|
|
404
|
+
|
|
405
|
+
### Return type
|
|
406
|
+
|
|
407
|
+
nil (empty response body)
|
|
408
|
+
|
|
409
|
+
### Authorization
|
|
410
|
+
|
|
411
|
+
[basic](../README.md#basic)
|
|
412
|
+
|
|
413
|
+
### HTTP request headers
|
|
414
|
+
|
|
415
|
+
- **Content-Type**: application/json
|
|
416
|
+
- **Accept**: application/json
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
# **list_projects**
|
|
421
|
+
> Array<Project> list_projects(opts)
|
|
422
|
+
|
|
423
|
+
List projects
|
|
424
|
+
|
|
425
|
+
This endpoint returns projects created by Harbor.
|
|
426
|
+
|
|
427
|
+
### Example
|
|
428
|
+
```ruby
|
|
429
|
+
# load the gem
|
|
430
|
+
require 'harbor2_client'
|
|
431
|
+
# setup authorization
|
|
432
|
+
Harbor2Client.configure do |config|
|
|
433
|
+
# Configure HTTP basic authorization: basic
|
|
434
|
+
config.username = 'YOUR USERNAME'
|
|
435
|
+
config.password = 'YOUR PASSWORD'
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
api_instance = Harbor2Client::ProjectApi.new
|
|
439
|
+
|
|
440
|
+
opts = {
|
|
441
|
+
x_request_id: 'x_request_id_example' # String | An unique ID for the request
|
|
442
|
+
page: 1, # Integer | The page number
|
|
443
|
+
page_size: 10, # Integer | The size of per page
|
|
444
|
+
name: 'name_example', # String | The name of project.
|
|
445
|
+
public: true, # BOOLEAN | The project is public or private.
|
|
446
|
+
owner: 'owner_example' # String | The name of project owner.
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
begin
|
|
450
|
+
#List projects
|
|
451
|
+
result = api_instance.list_projects(opts)
|
|
452
|
+
p result
|
|
453
|
+
rescue Harbor2Client::ApiError => e
|
|
454
|
+
puts "Exception when calling ProjectApi->list_projects: #{e}"
|
|
455
|
+
end
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Parameters
|
|
459
|
+
|
|
460
|
+
Name | Type | Description | Notes
|
|
461
|
+
------------- | ------------- | ------------- | -------------
|
|
462
|
+
**x_request_id** | **String**| An unique ID for the request | [optional]
|
|
463
|
+
**page** | **Integer**| The page number | [optional] [default to 1]
|
|
464
|
+
**page_size** | **Integer**| The size of per page | [optional] [default to 10]
|
|
465
|
+
**name** | **String**| The name of project. | [optional]
|
|
466
|
+
**public** | **BOOLEAN**| The project is public or private. | [optional]
|
|
467
|
+
**owner** | **String**| The name of project owner. | [optional]
|
|
468
|
+
|
|
469
|
+
### Return type
|
|
470
|
+
|
|
471
|
+
[**Array<Project>**](Project.md)
|
|
472
|
+
|
|
473
|
+
### Authorization
|
|
474
|
+
|
|
475
|
+
[basic](../README.md#basic)
|
|
476
|
+
|
|
477
|
+
### HTTP request headers
|
|
478
|
+
|
|
479
|
+
- **Content-Type**: application/json
|
|
480
|
+
- **Accept**: application/json
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
# **update_project**
|
|
485
|
+
> update_project(project_idproject, opts)
|
|
486
|
+
|
|
487
|
+
Update properties for a selected project.
|
|
488
|
+
|
|
489
|
+
This endpoint is aimed to update the properties of a project.
|
|
490
|
+
|
|
491
|
+
### Example
|
|
492
|
+
```ruby
|
|
493
|
+
# load the gem
|
|
494
|
+
require 'harbor2_client'
|
|
495
|
+
# setup authorization
|
|
496
|
+
Harbor2Client.configure do |config|
|
|
497
|
+
# Configure HTTP basic authorization: basic
|
|
498
|
+
config.username = 'YOUR USERNAME'
|
|
499
|
+
config.password = 'YOUR PASSWORD'
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
api_instance = Harbor2Client::ProjectApi.new
|
|
503
|
+
|
|
504
|
+
project_id = 789 # Integer | The ID of the project
|
|
505
|
+
|
|
506
|
+
project = Harbor2Client::ProjectReq.new # ProjectReq | Updates of project.
|
|
507
|
+
|
|
508
|
+
opts = {
|
|
509
|
+
x_request_id: 'x_request_id_example' # String | An unique ID for the request
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
begin
|
|
513
|
+
#Update properties for a selected project.
|
|
514
|
+
api_instance.update_project(project_idproject, opts)
|
|
515
|
+
rescue Harbor2Client::ApiError => e
|
|
516
|
+
puts "Exception when calling ProjectApi->update_project: #{e}"
|
|
517
|
+
end
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
### Parameters
|
|
521
|
+
|
|
522
|
+
Name | Type | Description | Notes
|
|
523
|
+
------------- | ------------- | ------------- | -------------
|
|
524
|
+
**project_id** | **Integer**| The ID of the project |
|
|
525
|
+
**project** | [**ProjectReq**](ProjectReq.md)| Updates of project. |
|
|
526
|
+
**x_request_id** | **String**| An unique ID for the request | [optional]
|
|
527
|
+
|
|
528
|
+
### Return type
|
|
529
|
+
|
|
530
|
+
nil (empty response body)
|
|
531
|
+
|
|
532
|
+
### Authorization
|
|
533
|
+
|
|
534
|
+
[basic](../README.md#basic)
|
|
535
|
+
|
|
536
|
+
### HTTP request headers
|
|
537
|
+
|
|
538
|
+
- **Content-Type**: application/json
|
|
539
|
+
- **Accept**: application/json
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|