ionoscloud-container-registry 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +70 -0
- data/LICENSE +201 -0
- data/README.md +54 -0
- data/Rakefile +10 -0
- data/docs/api/LocationsApi.md +78 -0
- data/docs/api/NamesApi.md +82 -0
- data/docs/api/RegistriesApi.md +470 -0
- data/docs/api/RepositoriesApi.md +84 -0
- data/docs/api/TokensApi.md +478 -0
- data/docs/models/ApiErrorMessage.md +20 -0
- data/docs/models/ApiErrorResponse.md +20 -0
- data/docs/models/ApiResourceMetadata.md +30 -0
- data/docs/models/Credentials.md +20 -0
- data/docs/models/Day.md +15 -0
- data/docs/models/Location.md +18 -0
- data/docs/models/LocationsResponse.md +24 -0
- data/docs/models/PaginationLinks.md +22 -0
- data/docs/models/PatchRegistryInput.md +18 -0
- data/docs/models/PatchTokenInput.md +22 -0
- data/docs/models/PostRegistryInput.md +18 -0
- data/docs/models/PostRegistryOutput.md +26 -0
- data/docs/models/PostRegistryProperties.md +22 -0
- data/docs/models/PostTokenInput.md +18 -0
- data/docs/models/PostTokenOutput.md +26 -0
- data/docs/models/PostTokenProperties.md +24 -0
- data/docs/models/PutRegistryInput.md +18 -0
- data/docs/models/PutRegistryOutput.md +26 -0
- data/docs/models/PutTokenInput.md +18 -0
- data/docs/models/PutTokenOutput.md +26 -0
- data/docs/models/RegistriesResponse.md +30 -0
- data/docs/models/RegistryProperties.md +26 -0
- data/docs/models/RegistryResponse.md +26 -0
- data/docs/models/Scope.md +22 -0
- data/docs/models/StorageUsage.md +20 -0
- data/docs/models/TokenProperties.md +26 -0
- data/docs/models/TokenResponse.md +26 -0
- data/docs/models/TokensResponse.md +34 -0
- data/docs/models/WeeklySchedule.md +20 -0
- data/docs/summary.md +44 -0
- data/git_push.sh +56 -0
- data/ionoscloud-container-registry.gemspec +38 -0
- data/lib/ionoscloud-container-registry/api/locations_api.rb +77 -0
- data/lib/ionoscloud-container-registry/api/names_api.rb +90 -0
- data/lib/ionoscloud-container-registry/api/registries_api.rb +439 -0
- data/lib/ionoscloud-container-registry/api/repositories_api.rb +99 -0
- data/lib/ionoscloud-container-registry/api/tokens_api.rb +500 -0
- data/lib/ionoscloud-container-registry/api_client.rb +471 -0
- data/lib/ionoscloud-container-registry/api_error.rb +57 -0
- data/lib/ionoscloud-container-registry/configuration.rb +276 -0
- data/lib/ionoscloud-container-registry/models/api_error_message.rb +237 -0
- data/lib/ionoscloud-container-registry/models/api_error_response.rb +233 -0
- data/lib/ionoscloud-container-registry/models/api_resource_metadata.rb +293 -0
- data/lib/ionoscloud-container-registry/models/credentials.rb +237 -0
- data/lib/ionoscloud-container-registry/models/day.rb +42 -0
- data/lib/ionoscloud-container-registry/models/location.rb +218 -0
- data/lib/ionoscloud-container-registry/models/locations_response.rb +246 -0
- data/lib/ionoscloud-container-registry/models/pagination_links.rb +251 -0
- data/lib/ionoscloud-container-registry/models/patch_registry_input.rb +219 -0
- data/lib/ionoscloud-container-registry/models/patch_token_input.rb +272 -0
- data/lib/ionoscloud-container-registry/models/post_registry_input.rb +223 -0
- data/lib/ionoscloud-container-registry/models/post_registry_output.rb +256 -0
- data/lib/ionoscloud-container-registry/models/post_registry_properties.rb +268 -0
- data/lib/ionoscloud-container-registry/models/post_token_input.rb +223 -0
- data/lib/ionoscloud-container-registry/models/post_token_output.rb +256 -0
- data/lib/ionoscloud-container-registry/models/post_token_properties.rb +316 -0
- data/lib/ionoscloud-container-registry/models/put_registry_input.rb +223 -0
- data/lib/ionoscloud-container-registry/models/put_registry_output.rb +256 -0
- data/lib/ionoscloud-container-registry/models/put_token_input.rb +223 -0
- data/lib/ionoscloud-container-registry/models/put_token_output.rb +256 -0
- data/lib/ionoscloud-container-registry/models/registries_response.rb +288 -0
- data/lib/ionoscloud-container-registry/models/registry_properties.rb +287 -0
- data/lib/ionoscloud-container-registry/models/registry_response.rb +256 -0
- data/lib/ionoscloud-container-registry/models/scope.rb +247 -0
- data/lib/ionoscloud-container-registry/models/storage_usage.rb +229 -0
- data/lib/ionoscloud-container-registry/models/token_properties.rb +326 -0
- data/lib/ionoscloud-container-registry/models/token_response.rb +256 -0
- data/lib/ionoscloud-container-registry/models/tokens_response.rb +316 -0
- data/lib/ionoscloud-container-registry/models/weekly_schedule.rb +234 -0
- data/lib/ionoscloud-container-registry/version.rb +15 -0
- data/lib/ionoscloud-container-registry.rb +73 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/spec_helper.rb +111 -0
- metadata +173 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
=begin
|
2
|
+
#Container Registry service
|
3
|
+
|
4
|
+
#Container Registry service enables IONOS clients to manage docker and OCI compliant registries for use by their managed Kubernetes clusters. Use a Container Registry to ensure you have a privately accessed registry to efficiently support image pulls.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@cloud.ionos.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module IonoscloudContainerRegistry
|
16
|
+
class RepositoriesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Delete repository
|
23
|
+
# Delete all repository contents The registry V2 API allows manifests and blobs to be deleted individually but it is not possible to remove an entire repository. This operation is provided for convenience
|
24
|
+
# @param registry_id [String] The unique ID of the registry
|
25
|
+
# @param name [String] The name of the repository
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [nil]
|
28
|
+
def registries_repositories_delete(registry_id, name, opts = {})
|
29
|
+
registries_repositories_delete_with_http_info(registry_id, name, opts)
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
|
33
|
+
# Delete repository
|
34
|
+
# Delete all repository contents The registry V2 API allows manifests and blobs to be deleted individually but it is not possible to remove an entire repository. This operation is provided for convenience
|
35
|
+
# @param registry_id [String] The unique ID of the registry
|
36
|
+
# @param name [String] The name of the repository
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
39
|
+
def registries_repositories_delete_with_http_info(registry_id, name, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: RepositoriesApi.registries_repositories_delete ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'registry_id' is set
|
44
|
+
if @api_client.config.client_side_validation && registry_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'registry_id' when calling RepositoriesApi.registries_repositories_delete"
|
46
|
+
end
|
47
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
48
|
+
if @api_client.config.client_side_validation && registry_id !~ pattern
|
49
|
+
fail ArgumentError, "invalid value for 'registry_id' when calling RepositoriesApi.registries_repositories_delete, must conform to the pattern #{pattern}."
|
50
|
+
end
|
51
|
+
|
52
|
+
# verify the required parameter 'name' is set
|
53
|
+
if @api_client.config.client_side_validation && name.nil?
|
54
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling RepositoriesApi.registries_repositories_delete"
|
55
|
+
end
|
56
|
+
pattern = Regexp.new(/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/)
|
57
|
+
if @api_client.config.client_side_validation && name !~ pattern
|
58
|
+
fail ArgumentError, "invalid value for 'name' when calling RepositoriesApi.registries_repositories_delete, must conform to the pattern #{pattern}."
|
59
|
+
end
|
60
|
+
|
61
|
+
# resource path
|
62
|
+
local_var_path = '/registries/{registryId}/repositories/{name}'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))
|
63
|
+
|
64
|
+
# query parameters
|
65
|
+
query_params = opts[:query_params] || {}
|
66
|
+
|
67
|
+
# header parameters
|
68
|
+
header_params = opts[:header_params] || {}
|
69
|
+
|
70
|
+
# form parameters
|
71
|
+
form_params = opts[:form_params] || {}
|
72
|
+
|
73
|
+
# http body (model)
|
74
|
+
post_body = opts[:debug_body]
|
75
|
+
|
76
|
+
# return_type
|
77
|
+
return_type = opts[:debug_return_type]
|
78
|
+
|
79
|
+
# auth_names
|
80
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
|
81
|
+
|
82
|
+
new_options = opts.merge(
|
83
|
+
:operation => :"RepositoriesApi.registries_repositories_delete",
|
84
|
+
:header_params => header_params,
|
85
|
+
:query_params => query_params,
|
86
|
+
:form_params => form_params,
|
87
|
+
:body => post_body,
|
88
|
+
:auth_names => auth_names,
|
89
|
+
:return_type => return_type
|
90
|
+
)
|
91
|
+
|
92
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
93
|
+
if @api_client.config.debugging
|
94
|
+
@api_client.config.logger.debug "API called: RepositoriesApi#registries_repositories_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
95
|
+
end
|
96
|
+
return data, status_code, headers
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,500 @@
|
|
1
|
+
=begin
|
2
|
+
#Container Registry service
|
3
|
+
|
4
|
+
#Container Registry service enables IONOS clients to manage docker and OCI compliant registries for use by their managed Kubernetes clusters. Use a Container Registry to ensure you have a privately accessed registry to efficiently support image pulls.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@cloud.ionos.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module IonoscloudContainerRegistry
|
16
|
+
class TokensApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Delete token
|
23
|
+
# @param registry_id [String] The unique ID of the registry
|
24
|
+
# @param token_id [String] The unique ID of the token
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [nil]
|
27
|
+
def registries_tokens_delete(registry_id, token_id, opts = {})
|
28
|
+
registries_tokens_delete_with_http_info(registry_id, token_id, opts)
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# Delete token
|
33
|
+
# @param registry_id [String] The unique ID of the registry
|
34
|
+
# @param token_id [String] The unique ID of the token
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
37
|
+
def registries_tokens_delete_with_http_info(registry_id, token_id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_delete ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'registry_id' is set
|
42
|
+
if @api_client.config.client_side_validation && registry_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_delete"
|
44
|
+
end
|
45
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
46
|
+
if @api_client.config.client_side_validation && registry_id !~ pattern
|
47
|
+
fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_delete, must conform to the pattern #{pattern}."
|
48
|
+
end
|
49
|
+
|
50
|
+
# verify the required parameter 'token_id' is set
|
51
|
+
if @api_client.config.client_side_validation && token_id.nil?
|
52
|
+
fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApi.registries_tokens_delete"
|
53
|
+
end
|
54
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
55
|
+
if @api_client.config.client_side_validation && token_id !~ pattern
|
56
|
+
fail ArgumentError, "invalid value for 'token_id' when calling TokensApi.registries_tokens_delete, must conform to the pattern #{pattern}."
|
57
|
+
end
|
58
|
+
|
59
|
+
# resource path
|
60
|
+
local_var_path = '/registries/{registryId}/tokens/{tokenId}'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_id.to_s))
|
61
|
+
|
62
|
+
# query parameters
|
63
|
+
query_params = opts[:query_params] || {}
|
64
|
+
|
65
|
+
# header parameters
|
66
|
+
header_params = opts[:header_params] || {}
|
67
|
+
# HTTP header 'Accept' (if needed)
|
68
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
69
|
+
|
70
|
+
# form parameters
|
71
|
+
form_params = opts[:form_params] || {}
|
72
|
+
|
73
|
+
# http body (model)
|
74
|
+
post_body = opts[:debug_body]
|
75
|
+
|
76
|
+
# return_type
|
77
|
+
return_type = opts[:debug_return_type]
|
78
|
+
|
79
|
+
# auth_names
|
80
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
|
81
|
+
|
82
|
+
new_options = opts.merge(
|
83
|
+
:operation => :"TokensApi.registries_tokens_delete",
|
84
|
+
:header_params => header_params,
|
85
|
+
:query_params => query_params,
|
86
|
+
:form_params => form_params,
|
87
|
+
:body => post_body,
|
88
|
+
:auth_names => auth_names,
|
89
|
+
:return_type => return_type
|
90
|
+
)
|
91
|
+
|
92
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
93
|
+
if @api_client.config.debugging
|
94
|
+
@api_client.config.logger.debug "API called: TokensApi#registries_tokens_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
95
|
+
end
|
96
|
+
return data, status_code, headers
|
97
|
+
end
|
98
|
+
|
99
|
+
# Get token information
|
100
|
+
# Gets all information for a specific token used to access a container registry
|
101
|
+
# @param registry_id [String] The unique ID of the registry
|
102
|
+
# @param token_id [String] The unique ID of the token
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @return [TokenResponse]
|
105
|
+
def registries_tokens_find_by_id(registry_id, token_id, opts = {})
|
106
|
+
data, _status_code, _headers = registries_tokens_find_by_id_with_http_info(registry_id, token_id, opts)
|
107
|
+
data
|
108
|
+
end
|
109
|
+
|
110
|
+
# Get token information
|
111
|
+
# Gets all information for a specific token used to access a container registry
|
112
|
+
# @param registry_id [String] The unique ID of the registry
|
113
|
+
# @param token_id [String] The unique ID of the token
|
114
|
+
# @param [Hash] opts the optional parameters
|
115
|
+
# @return [Array<(TokenResponse, Integer, Hash)>] TokenResponse data, response status code and response headers
|
116
|
+
def registries_tokens_find_by_id_with_http_info(registry_id, token_id, opts = {})
|
117
|
+
if @api_client.config.debugging
|
118
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_find_by_id ...'
|
119
|
+
end
|
120
|
+
# verify the required parameter 'registry_id' is set
|
121
|
+
if @api_client.config.client_side_validation && registry_id.nil?
|
122
|
+
fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_find_by_id"
|
123
|
+
end
|
124
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
125
|
+
if @api_client.config.client_side_validation && registry_id !~ pattern
|
126
|
+
fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_find_by_id, must conform to the pattern #{pattern}."
|
127
|
+
end
|
128
|
+
|
129
|
+
# verify the required parameter 'token_id' is set
|
130
|
+
if @api_client.config.client_side_validation && token_id.nil?
|
131
|
+
fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApi.registries_tokens_find_by_id"
|
132
|
+
end
|
133
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
134
|
+
if @api_client.config.client_side_validation && token_id !~ pattern
|
135
|
+
fail ArgumentError, "invalid value for 'token_id' when calling TokensApi.registries_tokens_find_by_id, must conform to the pattern #{pattern}."
|
136
|
+
end
|
137
|
+
|
138
|
+
# resource path
|
139
|
+
local_var_path = '/registries/{registryId}/tokens/{tokenId}'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_id.to_s))
|
140
|
+
|
141
|
+
# query parameters
|
142
|
+
query_params = opts[:query_params] || {}
|
143
|
+
|
144
|
+
# header parameters
|
145
|
+
header_params = opts[:header_params] || {}
|
146
|
+
# HTTP header 'Accept' (if needed)
|
147
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
148
|
+
|
149
|
+
# form parameters
|
150
|
+
form_params = opts[:form_params] || {}
|
151
|
+
|
152
|
+
# http body (model)
|
153
|
+
post_body = opts[:debug_body]
|
154
|
+
|
155
|
+
# return_type
|
156
|
+
return_type = opts[:debug_return_type] || 'TokenResponse'
|
157
|
+
|
158
|
+
# auth_names
|
159
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
|
160
|
+
|
161
|
+
new_options = opts.merge(
|
162
|
+
:operation => :"TokensApi.registries_tokens_find_by_id",
|
163
|
+
:header_params => header_params,
|
164
|
+
:query_params => query_params,
|
165
|
+
:form_params => form_params,
|
166
|
+
:body => post_body,
|
167
|
+
:auth_names => auth_names,
|
168
|
+
:return_type => return_type
|
169
|
+
)
|
170
|
+
|
171
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
172
|
+
if @api_client.config.debugging
|
173
|
+
@api_client.config.logger.debug "API called: TokensApi#registries_tokens_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
174
|
+
end
|
175
|
+
return data, status_code, headers
|
176
|
+
end
|
177
|
+
|
178
|
+
# List all tokens for the container registry
|
179
|
+
# @param registry_id [String] The unique ID of the registry
|
180
|
+
# @param [Hash] opts the optional parameters
|
181
|
+
# @option opts [String] :offset The first element (from the complete list of the elements) to include in the response (used together with limit for pagination) (default to '0')
|
182
|
+
# @option opts [String] :limit The maximum number of elements to return (used together with offset for pagination) (default to '100')
|
183
|
+
# @return [TokensResponse]
|
184
|
+
def registries_tokens_get(registry_id, opts = {})
|
185
|
+
data, _status_code, _headers = registries_tokens_get_with_http_info(registry_id, opts)
|
186
|
+
data
|
187
|
+
end
|
188
|
+
|
189
|
+
# List all tokens for the container registry
|
190
|
+
# @param registry_id [String] The unique ID of the registry
|
191
|
+
# @param [Hash] opts the optional parameters
|
192
|
+
# @option opts [String] :offset The first element (from the complete list of the elements) to include in the response (used together with limit for pagination)
|
193
|
+
# @option opts [String] :limit The maximum number of elements to return (used together with offset for pagination)
|
194
|
+
# @return [Array<(TokensResponse, Integer, Hash)>] TokensResponse data, response status code and response headers
|
195
|
+
def registries_tokens_get_with_http_info(registry_id, opts = {})
|
196
|
+
if @api_client.config.debugging
|
197
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_get ...'
|
198
|
+
end
|
199
|
+
# verify the required parameter 'registry_id' is set
|
200
|
+
if @api_client.config.client_side_validation && registry_id.nil?
|
201
|
+
fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_get"
|
202
|
+
end
|
203
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
204
|
+
if @api_client.config.client_side_validation && registry_id !~ pattern
|
205
|
+
fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_get, must conform to the pattern #{pattern}."
|
206
|
+
end
|
207
|
+
|
208
|
+
# resource path
|
209
|
+
local_var_path = '/registries/{registryId}/tokens'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s))
|
210
|
+
|
211
|
+
# query parameters
|
212
|
+
query_params = opts[:query_params] || {}
|
213
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
214
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
215
|
+
|
216
|
+
# header parameters
|
217
|
+
header_params = opts[:header_params] || {}
|
218
|
+
# HTTP header 'Accept' (if needed)
|
219
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
220
|
+
|
221
|
+
# form parameters
|
222
|
+
form_params = opts[:form_params] || {}
|
223
|
+
|
224
|
+
# http body (model)
|
225
|
+
post_body = opts[:debug_body]
|
226
|
+
|
227
|
+
# return_type
|
228
|
+
return_type = opts[:debug_return_type] || 'TokensResponse'
|
229
|
+
|
230
|
+
# auth_names
|
231
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
|
232
|
+
|
233
|
+
new_options = opts.merge(
|
234
|
+
:operation => :"TokensApi.registries_tokens_get",
|
235
|
+
:header_params => header_params,
|
236
|
+
:query_params => query_params,
|
237
|
+
:form_params => form_params,
|
238
|
+
:body => post_body,
|
239
|
+
:auth_names => auth_names,
|
240
|
+
:return_type => return_type
|
241
|
+
)
|
242
|
+
|
243
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
244
|
+
if @api_client.config.debugging
|
245
|
+
@api_client.config.logger.debug "API called: TokensApi#registries_tokens_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
246
|
+
end
|
247
|
+
return data, status_code, headers
|
248
|
+
end
|
249
|
+
|
250
|
+
# Update token
|
251
|
+
# Update token properties, for example: - change status to 'enabled' or 'disabled' - change expiry date
|
252
|
+
# @param registry_id [String] The unique ID of the registry
|
253
|
+
# @param token_id [String] The unique ID of the token
|
254
|
+
# @param patch_token_input [PatchTokenInput]
|
255
|
+
# @param [Hash] opts the optional parameters
|
256
|
+
# @return [TokenResponse]
|
257
|
+
def registries_tokens_patch(registry_id, token_id, patch_token_input, opts = {})
|
258
|
+
data, _status_code, _headers = registries_tokens_patch_with_http_info(registry_id, token_id, patch_token_input, opts)
|
259
|
+
data
|
260
|
+
end
|
261
|
+
|
262
|
+
# Update token
|
263
|
+
# Update token properties, for example: - change status to 'enabled' or 'disabled' - change expiry date
|
264
|
+
# @param registry_id [String] The unique ID of the registry
|
265
|
+
# @param token_id [String] The unique ID of the token
|
266
|
+
# @param patch_token_input [PatchTokenInput]
|
267
|
+
# @param [Hash] opts the optional parameters
|
268
|
+
# @return [Array<(TokenResponse, Integer, Hash)>] TokenResponse data, response status code and response headers
|
269
|
+
def registries_tokens_patch_with_http_info(registry_id, token_id, patch_token_input, opts = {})
|
270
|
+
if @api_client.config.debugging
|
271
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_patch ...'
|
272
|
+
end
|
273
|
+
# verify the required parameter 'registry_id' is set
|
274
|
+
if @api_client.config.client_side_validation && registry_id.nil?
|
275
|
+
fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_patch"
|
276
|
+
end
|
277
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
278
|
+
if @api_client.config.client_side_validation && registry_id !~ pattern
|
279
|
+
fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_patch, must conform to the pattern #{pattern}."
|
280
|
+
end
|
281
|
+
|
282
|
+
# verify the required parameter 'token_id' is set
|
283
|
+
if @api_client.config.client_side_validation && token_id.nil?
|
284
|
+
fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApi.registries_tokens_patch"
|
285
|
+
end
|
286
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
287
|
+
if @api_client.config.client_side_validation && token_id !~ pattern
|
288
|
+
fail ArgumentError, "invalid value for 'token_id' when calling TokensApi.registries_tokens_patch, must conform to the pattern #{pattern}."
|
289
|
+
end
|
290
|
+
|
291
|
+
# verify the required parameter 'patch_token_input' is set
|
292
|
+
if @api_client.config.client_side_validation && patch_token_input.nil?
|
293
|
+
fail ArgumentError, "Missing the required parameter 'patch_token_input' when calling TokensApi.registries_tokens_patch"
|
294
|
+
end
|
295
|
+
# resource path
|
296
|
+
local_var_path = '/registries/{registryId}/tokens/{tokenId}'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_id.to_s))
|
297
|
+
|
298
|
+
# query parameters
|
299
|
+
query_params = opts[:query_params] || {}
|
300
|
+
|
301
|
+
# header parameters
|
302
|
+
header_params = opts[:header_params] || {}
|
303
|
+
# HTTP header 'Accept' (if needed)
|
304
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
305
|
+
# HTTP header 'Content-Type'
|
306
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
307
|
+
|
308
|
+
# form parameters
|
309
|
+
form_params = opts[:form_params] || {}
|
310
|
+
|
311
|
+
# http body (model)
|
312
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_token_input)
|
313
|
+
|
314
|
+
# return_type
|
315
|
+
return_type = opts[:debug_return_type] || 'TokenResponse'
|
316
|
+
|
317
|
+
# auth_names
|
318
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
|
319
|
+
|
320
|
+
new_options = opts.merge(
|
321
|
+
:operation => :"TokensApi.registries_tokens_patch",
|
322
|
+
:header_params => header_params,
|
323
|
+
:query_params => query_params,
|
324
|
+
:form_params => form_params,
|
325
|
+
:body => post_body,
|
326
|
+
:auth_names => auth_names,
|
327
|
+
:return_type => return_type
|
328
|
+
)
|
329
|
+
|
330
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
331
|
+
if @api_client.config.debugging
|
332
|
+
@api_client.config.logger.debug "API called: TokensApi#registries_tokens_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
333
|
+
end
|
334
|
+
return data, status_code, headers
|
335
|
+
end
|
336
|
+
|
337
|
+
# Create token
|
338
|
+
# Create a token - password is only available once in the POST response
|
339
|
+
# @param registry_id [String] The unique ID of the registry
|
340
|
+
# @param post_token_input [PostTokenInput]
|
341
|
+
# @param [Hash] opts the optional parameters
|
342
|
+
# @return [PostTokenOutput]
|
343
|
+
def registries_tokens_post(registry_id, post_token_input, opts = {})
|
344
|
+
data, _status_code, _headers = registries_tokens_post_with_http_info(registry_id, post_token_input, opts)
|
345
|
+
data
|
346
|
+
end
|
347
|
+
|
348
|
+
# Create token
|
349
|
+
# Create a token - password is only available once in the POST response
|
350
|
+
# @param registry_id [String] The unique ID of the registry
|
351
|
+
# @param post_token_input [PostTokenInput]
|
352
|
+
# @param [Hash] opts the optional parameters
|
353
|
+
# @return [Array<(PostTokenOutput, Integer, Hash)>] PostTokenOutput data, response status code and response headers
|
354
|
+
def registries_tokens_post_with_http_info(registry_id, post_token_input, opts = {})
|
355
|
+
if @api_client.config.debugging
|
356
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_post ...'
|
357
|
+
end
|
358
|
+
# verify the required parameter 'registry_id' is set
|
359
|
+
if @api_client.config.client_side_validation && registry_id.nil?
|
360
|
+
fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_post"
|
361
|
+
end
|
362
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
363
|
+
if @api_client.config.client_side_validation && registry_id !~ pattern
|
364
|
+
fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_post, must conform to the pattern #{pattern}."
|
365
|
+
end
|
366
|
+
|
367
|
+
# verify the required parameter 'post_token_input' is set
|
368
|
+
if @api_client.config.client_side_validation && post_token_input.nil?
|
369
|
+
fail ArgumentError, "Missing the required parameter 'post_token_input' when calling TokensApi.registries_tokens_post"
|
370
|
+
end
|
371
|
+
# resource path
|
372
|
+
local_var_path = '/registries/{registryId}/tokens'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s))
|
373
|
+
|
374
|
+
# query parameters
|
375
|
+
query_params = opts[:query_params] || {}
|
376
|
+
|
377
|
+
# header parameters
|
378
|
+
header_params = opts[:header_params] || {}
|
379
|
+
# HTTP header 'Accept' (if needed)
|
380
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
381
|
+
# HTTP header 'Content-Type'
|
382
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
383
|
+
|
384
|
+
# form parameters
|
385
|
+
form_params = opts[:form_params] || {}
|
386
|
+
|
387
|
+
# http body (model)
|
388
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(post_token_input)
|
389
|
+
|
390
|
+
# return_type
|
391
|
+
return_type = opts[:debug_return_type] || 'PostTokenOutput'
|
392
|
+
|
393
|
+
# auth_names
|
394
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
|
395
|
+
|
396
|
+
new_options = opts.merge(
|
397
|
+
:operation => :"TokensApi.registries_tokens_post",
|
398
|
+
:header_params => header_params,
|
399
|
+
:query_params => query_params,
|
400
|
+
:form_params => form_params,
|
401
|
+
:body => post_body,
|
402
|
+
:auth_names => auth_names,
|
403
|
+
:return_type => return_type
|
404
|
+
)
|
405
|
+
|
406
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
407
|
+
if @api_client.config.debugging
|
408
|
+
@api_client.config.logger.debug "API called: TokensApi#registries_tokens_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
409
|
+
end
|
410
|
+
return data, status_code, headers
|
411
|
+
end
|
412
|
+
|
413
|
+
# Create or replace token
|
414
|
+
# Create/replace a token - password is only available once in the create response - \"name\" cannot be changed
|
415
|
+
# @param registry_id [String] The unique ID of the registry
|
416
|
+
# @param token_id [String] The unique ID of the token
|
417
|
+
# @param put_token_input [PutTokenInput]
|
418
|
+
# @param [Hash] opts the optional parameters
|
419
|
+
# @return [PutTokenOutput]
|
420
|
+
def registries_tokens_put(registry_id, token_id, put_token_input, opts = {})
|
421
|
+
data, _status_code, _headers = registries_tokens_put_with_http_info(registry_id, token_id, put_token_input, opts)
|
422
|
+
data
|
423
|
+
end
|
424
|
+
|
425
|
+
# Create or replace token
|
426
|
+
# Create/replace a token - password is only available once in the create response - \"name\" cannot be changed
|
427
|
+
# @param registry_id [String] The unique ID of the registry
|
428
|
+
# @param token_id [String] The unique ID of the token
|
429
|
+
# @param put_token_input [PutTokenInput]
|
430
|
+
# @param [Hash] opts the optional parameters
|
431
|
+
# @return [Array<(PutTokenOutput, Integer, Hash)>] PutTokenOutput data, response status code and response headers
|
432
|
+
def registries_tokens_put_with_http_info(registry_id, token_id, put_token_input, opts = {})
|
433
|
+
if @api_client.config.debugging
|
434
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_put ...'
|
435
|
+
end
|
436
|
+
# verify the required parameter 'registry_id' is set
|
437
|
+
if @api_client.config.client_side_validation && registry_id.nil?
|
438
|
+
fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_put"
|
439
|
+
end
|
440
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
441
|
+
if @api_client.config.client_side_validation && registry_id !~ pattern
|
442
|
+
fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_put, must conform to the pattern #{pattern}."
|
443
|
+
end
|
444
|
+
|
445
|
+
# verify the required parameter 'token_id' is set
|
446
|
+
if @api_client.config.client_side_validation && token_id.nil?
|
447
|
+
fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApi.registries_tokens_put"
|
448
|
+
end
|
449
|
+
pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
|
450
|
+
if @api_client.config.client_side_validation && token_id !~ pattern
|
451
|
+
fail ArgumentError, "invalid value for 'token_id' when calling TokensApi.registries_tokens_put, must conform to the pattern #{pattern}."
|
452
|
+
end
|
453
|
+
|
454
|
+
# verify the required parameter 'put_token_input' is set
|
455
|
+
if @api_client.config.client_side_validation && put_token_input.nil?
|
456
|
+
fail ArgumentError, "Missing the required parameter 'put_token_input' when calling TokensApi.registries_tokens_put"
|
457
|
+
end
|
458
|
+
# resource path
|
459
|
+
local_var_path = '/registries/{registryId}/tokens/{tokenId}'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_id.to_s))
|
460
|
+
|
461
|
+
# query parameters
|
462
|
+
query_params = opts[:query_params] || {}
|
463
|
+
|
464
|
+
# header parameters
|
465
|
+
header_params = opts[:header_params] || {}
|
466
|
+
# HTTP header 'Accept' (if needed)
|
467
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
468
|
+
# HTTP header 'Content-Type'
|
469
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
470
|
+
|
471
|
+
# form parameters
|
472
|
+
form_params = opts[:form_params] || {}
|
473
|
+
|
474
|
+
# http body (model)
|
475
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(put_token_input)
|
476
|
+
|
477
|
+
# return_type
|
478
|
+
return_type = opts[:debug_return_type] || 'PutTokenOutput'
|
479
|
+
|
480
|
+
# auth_names
|
481
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
|
482
|
+
|
483
|
+
new_options = opts.merge(
|
484
|
+
:operation => :"TokensApi.registries_tokens_put",
|
485
|
+
:header_params => header_params,
|
486
|
+
:query_params => query_params,
|
487
|
+
:form_params => form_params,
|
488
|
+
:body => post_body,
|
489
|
+
:auth_names => auth_names,
|
490
|
+
:return_type => return_type
|
491
|
+
)
|
492
|
+
|
493
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
494
|
+
if @api_client.config.debugging
|
495
|
+
@api_client.config.logger.debug "API called: TokensApi#registries_tokens_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
496
|
+
end
|
497
|
+
return data, status_code, headers
|
498
|
+
end
|
499
|
+
end
|
500
|
+
end
|