require'time'require'ionoscloud-container-registry'# setup authorizationIonoscloudContainerRegistry.configure do|config|# Configure HTTP basic authorization: basicAuth config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: tokenAuth config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =IonoscloudContainerRegistry::TokensApi.newregistry_id =TODO# String | The unique ID of the registrytoken_id =TODO# String | The unique ID of the tokenbegin# Delete token api_instance.registries_tokens_delete(registry_id, token_id)rescueIonoscloudContainerRegistry::ApiError=> eputs"Error when calling TokensApi->registries_tokens_delete: #{e}"end
Using the registries_tokens_delete_with_http_info variant
This returns an Array which contains the response data (nil in this case), status code and headers.
Gets all information for a specific token used to access a container registry
Examples
require'time'require'ionoscloud-container-registry'# setup authorizationIonoscloudContainerRegistry.configure do|config|# Configure HTTP basic authorization: basicAuth config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: tokenAuth config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =IonoscloudContainerRegistry::TokensApi.newregistry_id =TODO# String | The unique ID of the registrytoken_id =TODO# String | The unique ID of the tokenbegin# Get token information result = api_instance.registries_tokens_find_by_id(registry_id, token_id)p resultrescueIonoscloudContainerRegistry::ApiError=> eputs"Error when calling TokensApi->registries_tokens_find_by_id: #{e}"end
Using the registries_tokens_find_by_id_with_http_info variant
This returns an Array which contains the response data, status code and headers.
require'time'require'ionoscloud-container-registry'# setup authorizationIonoscloudContainerRegistry.configure do|config|# Configure HTTP basic authorization: basicAuth config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: tokenAuth config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =IonoscloudContainerRegistry::TokensApi.newregistry_id =TODO# String | The unique ID of the registryopts = { offset: 'offset_example', # String | The first element (from the complete list of the elements) to include in the response (used together with limit for pagination)
limit: 'limit_example'# String | The maximum number of elements to return (used together with offset for pagination)}begin# List all tokens for the container registry result = api_instance.registries_tokens_get(registry_id, opts)p resultrescueIonoscloudContainerRegistry::ApiError=> eputs"Error when calling TokensApi->registries_tokens_get: #{e}"end
Using the registries_tokens_get_with_http_info variant
This returns an Array which contains the response data, status code and headers.
Update token properties, for example: - change status to 'enabled' or 'disabled' - change expiry date
Examples
require'time'require'ionoscloud-container-registry'# setup authorizationIonoscloudContainerRegistry.configure do|config|# Configure HTTP basic authorization: basicAuth config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: tokenAuth config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =IonoscloudContainerRegistry::TokensApi.newregistry_id =TODO# String | The unique ID of the registrytoken_id =TODO# String | The unique ID of the tokenpatch_token_input =IonoscloudContainerRegistry::PatchTokenInput.new# PatchTokenInput | begin# Update token result = api_instance.registries_tokens_patch(registry_id, token_id, patch_token_input)p resultrescueIonoscloudContainerRegistry::ApiError=> eputs"Error when calling TokensApi->registries_tokens_patch: #{e}"end
Using the registries_tokens_patch_with_http_info variant
This returns an Array which contains the response data, status code and headers.
Create a token - password is only available once in the POST response
Examples
require'time'require'ionoscloud-container-registry'# setup authorizationIonoscloudContainerRegistry.configure do|config|# Configure HTTP basic authorization: basicAuth config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: tokenAuth config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =IonoscloudContainerRegistry::TokensApi.newregistry_id =TODO# String | The unique ID of the registrypost_token_input = IonoscloudContainerRegistry::PostTokenInput.new({properties: IonoscloudContainerRegistry::PostTokenProperties.new({name: 'push-token'})}) # PostTokenInput |
begin# Create token result = api_instance.registries_tokens_post(registry_id, post_token_input)p resultrescueIonoscloudContainerRegistry::ApiError=> eputs"Error when calling TokensApi->registries_tokens_post: #{e}"end
Using the registries_tokens_post_with_http_info variant
This returns an Array which contains the response data, status code and headers.
Create/replace a token - password is only available once in the create response - "name" cannot be changed
Examples
require'time'require'ionoscloud-container-registry'# setup authorizationIonoscloudContainerRegistry.configure do|config|# Configure HTTP basic authorization: basicAuth config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: tokenAuth config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =IonoscloudContainerRegistry::TokensApi.newregistry_id =TODO# String | The unique ID of the registrytoken_id ='token_id_example'# String | The unique ID of the tokenput_token_input = IonoscloudContainerRegistry::PutTokenInput.new({properties: IonoscloudContainerRegistry::PostTokenProperties.new({name: 'push-token'})}) # PutTokenInput |
begin# Create or replace token result = api_instance.registries_tokens_put(registry_id, token_id, put_token_input)p resultrescueIonoscloudContainerRegistry::ApiError=> eputs"Error when calling TokensApi->registries_tokens_put: #{e}"end
Using the registries_tokens_put_with_http_info variant
This returns an Array which contains the response data, status code and headers.