# RegistriesApi

All URIs are relative to *<https://api.ionos.com/containerregistries>*

| Method                                                 | HTTP request                        | Description                            |
| ------------------------------------------------------ | ----------------------------------- | -------------------------------------- |
| [**registries\_delete**](#registries_delete)           | **DELETE** /registries/{registryId} | Delete registry                        |
| [**registries\_find\_by\_id**](#registries_find_by_id) | **GET** /registries/{registryId}    | Get a registry                         |
| [**registries\_get**](#registries_get)                 | **GET** /registries                 | List all container registries          |
| [**registries\_patch**](#registries_patch)             | **PATCH** /registries/{registryId}  | Update the properties of a registry    |
| [**registries\_post**](#registries_post)               | **POST** /registries                | Create container registry              |
| [**registries\_put**](#registries_put)                 | **PUT** /registries/{registryId}    | Create or replace a container registry |

## registries\_delete

> registries\_delete(registry\_id)

Delete registry

### Examples

```ruby
require 'time'
require 'ionoscloud-container-registry'
# setup authorization
IonoscloudContainerRegistry.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'
end

api_instance = IonoscloudContainerRegistry::RegistriesApi.new
registry_id = TODO # String | The unique ID of the registry

begin
  # Delete registry
  api_instance.registries_delete(registry_id)
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_delete: #{e}"
end
```

#### Using the registries\_delete\_with\_http\_info variant

This returns an Array which contains the response data (`nil` in this case), status code and headers.

> \<Array(nil, Integer, Hash)> registries\_delete\_with\_http\_info(registry\_id)

```ruby
begin
  # Delete registry
  data, status_code, headers = api_instance.registries_delete_with_http_info(registry_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_delete_with_http_info: #{e}"
end
```

### Parameters

| Name             | Type                                                                                                        | Description                   | Notes |
| ---------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------- | ----- |
| **registry\_id** | [**String**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/.md/README.md) | The unique ID of the registry |       |

### Return type

nil (empty response body)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## registries\_find\_by\_id

> registries\_find\_by\_id(registry\_id)

Get a registry

Get all information for a specific container registry

### Examples

```ruby
require 'time'
require 'ionoscloud-container-registry'
# setup authorization
IonoscloudContainerRegistry.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'
end

api_instance = IonoscloudContainerRegistry::RegistriesApi.new
registry_id = TODO # String | The unique ID of the registry

begin
  # Get a registry
  result = api_instance.registries_find_by_id(registry_id)
  p result
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_find_by_id: #{e}"
end
```

#### Using the registries\_find\_by\_id\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> registries\_find\_by\_id\_with\_http\_info(registry\_id)

```ruby
begin
  # Get a registry
  data, status_code, headers = api_instance.registries_find_by_id_with_http_info(registry_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RegistryResponse>
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_find_by_id_with_http_info: #{e}"
end
```

### Parameters

| Name             | Type                                                                                                        | Description                   | Notes |
| ---------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------- | ----- |
| **registry\_id** | [**String**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/.md/README.md) | The unique ID of the registry |       |

### Return type

[**RegistryResponse**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/RegistryResponse.md)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## registries\_get

> registries\_get(opts)

List all container registries

List all managed container registries for your account

### Examples

```ruby
require 'time'
require 'ionoscloud-container-registry'
# setup authorization
IonoscloudContainerRegistry.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'
end

api_instance = IonoscloudContainerRegistry::RegistriesApi.new
opts = {
  filter_name: 'my-registry', # String | The registry name to search for
  limit: 'limit_example', # String | The maximum number of elements to return (used together with nextPageToken for pagination)
  next_page_token: 'next_page_token_example' # String | The next page from the complete list of elements (used together with limit for pagination)
}

begin
  # List all container registries
  result = api_instance.registries_get(opts)
  p result
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_get: #{e}"
end
```

#### Using the registries\_get\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> registries\_get\_with\_http\_info(opts)

```ruby
begin
  # List all container registries
  data, status_code, headers = api_instance.registries_get_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RegistriesResponse>
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_get_with_http_info: #{e}"
end
```

### Parameters

| Name                  | Type       | Description                                                                                | Notes                          |
| --------------------- | ---------- | ------------------------------------------------------------------------------------------ | ------------------------------ |
| **filter\_name**      | **String** | The registry name to search for                                                            | \[optional]                    |
| **limit**             | **String** | The maximum number of elements to return (used together with nextPageToken for pagination) | \[optional]\[default to '100'] |
| **next\_page\_token** | **String** | The next page from the complete list of elements (used together with limit for pagination) | \[optional]                    |

### Return type

[**RegistriesResponse**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/RegistriesResponse.md)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## registries\_patch

> registries\_patch(registry\_id, patch\_registry\_input)

Update the properties of a registry

Update the properties of a registry - "garbageCollectionSchedule" time and days of the week for runs

### Examples

```ruby
require 'time'
require 'ionoscloud-container-registry'
# setup authorization
IonoscloudContainerRegistry.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'
end

api_instance = IonoscloudContainerRegistry::RegistriesApi.new
registry_id = TODO # String | The unique ID of the registry
patch_registry_input = IonoscloudContainerRegistry::PatchRegistryInput.new # PatchRegistryInput | 

begin
  # Update the properties of a registry
  result = api_instance.registries_patch(registry_id, patch_registry_input)
  p result
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_patch: #{e}"
end
```

#### Using the registries\_patch\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> registries\_patch\_with\_http\_info(registry\_id, patch\_registry\_input)

```ruby
begin
  # Update the properties of a registry
  data, status_code, headers = api_instance.registries_patch_with_http_info(registry_id, patch_registry_input)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RegistryResponse>
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_patch_with_http_info: #{e}"
end
```

### Parameters

| Name                       | Type                                                                                                                            | Description                   | Notes |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | ----- |
| **registry\_id**           | [**String**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/.md/README.md)                     | The unique ID of the registry |       |
| **patch\_registry\_input** | [**PatchRegistryInput**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/PatchRegistryInput.md) |                               |       |

### Return type

[**RegistryResponse**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/RegistryResponse.md)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

## registries\_post

> registries\_post(post\_registry\_input)

Create container registry

Create a registry to hold container images or OCI compliant artifacts - "name" must have passed validation - "location" must be one of the available location IDs - "garbageCollectionSchedule" time and days of the week for runs

### Examples

```ruby
require 'time'
require 'ionoscloud-container-registry'
# setup authorization
IonoscloudContainerRegistry.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'
end

api_instance = IonoscloudContainerRegistry::RegistriesApi.new
post_registry_input = IonoscloudContainerRegistry::PostRegistryInput.new({properties: IonoscloudContainerRegistry::PostRegistryProperties.new({location: 'de/txl', name: 'my-registry'})}) # PostRegistryInput | 

begin
  # Create container registry
  result = api_instance.registries_post(post_registry_input)
  p result
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_post: #{e}"
end
```

#### Using the registries\_post\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> registries\_post\_with\_http\_info(post\_registry\_input)

```ruby
begin
  # Create container registry
  data, status_code, headers = api_instance.registries_post_with_http_info(post_registry_input)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <PostRegistryOutput>
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_post_with_http_info: #{e}"
end
```

### Parameters

| Name                      | Type                                                                                                                          | Description | Notes |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------- | ----- |
| **post\_registry\_input** | [**PostRegistryInput**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/PostRegistryInput.md) |             |       |

### Return type

[**PostRegistryOutput**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/PostRegistryOutput.md)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

## registries\_put

> registries\_put(registry\_id, put\_registry\_input)

Create or replace a container registry

Create/replace a registry to hold container images or OCI compliant artifacts **On create** - "name" must have passed validation - "location" must be one of the available location IDs **On update** - "name" cannot be changed - "location" cannot be changed **On create or update** - "garbageCollectionSchedule": time and days of the week for runs

### Examples

```ruby
require 'time'
require 'ionoscloud-container-registry'
# setup authorization
IonoscloudContainerRegistry.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'
end

api_instance = IonoscloudContainerRegistry::RegistriesApi.new
registry_id = TODO # String | The unique ID of the registry
put_registry_input = IonoscloudContainerRegistry::PutRegistryInput.new({properties: IonoscloudContainerRegistry::PostRegistryProperties.new({location: 'de/txl', name: 'my-registry'})}) # PutRegistryInput | 

begin
  # Create or replace a container registry
  result = api_instance.registries_put(registry_id, put_registry_input)
  p result
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_put: #{e}"
end
```

#### Using the registries\_put\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> registries\_put\_with\_http\_info(registry\_id, put\_registry\_input)

```ruby
begin
  # Create or replace a container registry
  data, status_code, headers = api_instance.registries_put_with_http_info(registry_id, put_registry_input)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <PutRegistryOutput>
rescue IonoscloudContainerRegistry::ApiError => e
  puts "Error when calling RegistriesApi->registries_put_with_http_info: #{e}"
end
```

### Parameters

| Name                     | Type                                                                                                                        | Description                   | Notes |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | ----- |
| **registry\_id**         | [**String**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/.md/README.md)                 | The unique ID of the registry |       |
| **put\_registry\_input** | [**PutRegistryInput**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/PutRegistryInput.md) |                               |       |

### Return type

[**PutRegistryOutput**](https://github.com/ionos-cloud/sdk-ruby-container-registry/blob/master/docs/api/PutRegistryOutput.md)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json
