TokensApi

TokensApi

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

Method
HTTP request
Description

DELETE /registries/{registryId}/tokens/{tokenId}

Delete token

GET /registries/{registryId}/tokens/{tokenId}

Get token information

GET /registries/{registryId}/tokens

List all tokens for the container registry

PATCH /registries/{registryId}/tokens/{tokenId}

Update token

POST /registries/{registryId}/tokens

Create token

PUT /registries/{registryId}/tokens/{tokenId}

Create or replace token

registriesTokensDelete

registriesTokensDelete(registryId, tokenId)

Delete token

Example

// Import classes:
import com.ionoscloud.containerregistry.ApiClient;
import com.ionoscloud.containerregistry.ApiException;
import com.ionoscloud.containerregistry.ApiResponse;
import com.ionoscloud.containerregistry.Configuration;
import com.ionoscloud.containerregistry.auth.*;
import com.ionoscloud.containerregistry.model.*;
import com.ionoscloud.containerregistry.api.TokensApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: basicAuth
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    TokensApi apiInstance = new TokensApi(defaultClient);
    UUID registryId = new UUID(); // UUID | The unique ID of the registry
    UUID tokenId = new UUID(); // UUID | The unique ID of the token
    try {
      apiInstance.registriesTokensDeleteWithHttpInfo(registryId, tokenId);
    } catch (ApiException e) {
      System.err.println("Exception when calling TokensApi#registriesTokensDelete");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

⚠️ Note: for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.

Parameters

Name
Type
Description
Notes

registryId

The unique ID of the registry

tokenId

The unique ID of the token

Return type

null (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

registriesTokensFindById

TokenResponse registriesTokensFindById(registryId, tokenId)

Get token information

Gets all information for a specific token used to access a container registry

Example

// Import classes:
import com.ionoscloud.containerregistry.ApiClient;
import com.ionoscloud.containerregistry.ApiException;
import com.ionoscloud.containerregistry.ApiResponse;
import com.ionoscloud.containerregistry.Configuration;
import com.ionoscloud.containerregistry.auth.*;
import com.ionoscloud.containerregistry.model.*;
import com.ionoscloud.containerregistry.api.TokensApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: basicAuth
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    TokensApi apiInstance = new TokensApi(defaultClient);
    UUID registryId = new UUID(); // UUID | The unique ID of the registry
    UUID tokenId = new UUID(); // UUID | The unique ID of the token
    try {
      ApiResponse<TokenResponse> result = apiInstance.registriesTokensFindByIdWithHttpInfo(registryId, tokenId);
      System.out.println("Response: " + result.getData());
      System.out.println("Status Code: " + result.getStatusCode());
      System.out.println("Headers: " + result.getHeaders());
    } catch (ApiException e) {
      System.err.println("Exception when calling TokensApi#registriesTokensFindById");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

⚠️ Note: for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.

Parameters

Name
Type
Description
Notes

registryId

The unique ID of the registry

tokenId

The unique ID of the token

Return type

TokenResponse

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

registriesTokensGet

TokensResponse registriesTokensGet(registryId, offset, limit)

List all tokens for the container registry

Example

// Import classes:
import com.ionoscloud.containerregistry.ApiClient;
import com.ionoscloud.containerregistry.ApiException;
import com.ionoscloud.containerregistry.ApiResponse;
import com.ionoscloud.containerregistry.Configuration;
import com.ionoscloud.containerregistry.auth.*;
import com.ionoscloud.containerregistry.model.*;
import com.ionoscloud.containerregistry.api.TokensApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: basicAuth
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    TokensApi apiInstance = new TokensApi(defaultClient);
    UUID registryId = new UUID(); // UUID | The unique ID of the registry
    String offset = "0"; // String | The first element (from the complete list of the elements) to include in the response (used together with limit for pagination)
    String limit = "100"; // String | The maximum number of elements to return (used together with offset for pagination)
    String orderBy = "orderBy_example"; // String | Order by field
    Integer maxResults = "maxResults_example"; // Integer | Maximum number of results to return
    try {
      ApiResponse<TokensResponse> result = apiInstance.registriesTokensGetWithHttpInfo(registryId, offset, limit, orderBy, maxResults, filters);
      System.out.println("Response: " + result.getData());
      System.out.println("Status Code: " + result.getStatusCode());
      System.out.println("Headers: " + result.getHeaders());
    } catch (ApiException e) {
      System.err.println("Exception when calling TokensApi#registriesTokensGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

⚠️ Note: for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.

Parameters

Name
Type
Description
Notes

registryId

The unique ID of the registry

offset

String

The first element (from the complete list of the elements) to include in the response (used together with limit for pagination)

[optional] [default to 0]

limit

String

The maximum number of elements to return (used together with offset for pagination)

[optional] [default to 100]

Return type

TokensResponse

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

registriesTokensPatch

TokenResponse registriesTokensPatch(registryId, tokenId, patchTokenInput)

Update token

Update token properties, for example: - change status to 'enabled' or 'disabled' - change expiry date

Example

// Import classes:
import com.ionoscloud.containerregistry.ApiClient;
import com.ionoscloud.containerregistry.ApiException;
import com.ionoscloud.containerregistry.ApiResponse;
import com.ionoscloud.containerregistry.Configuration;
import com.ionoscloud.containerregistry.auth.*;
import com.ionoscloud.containerregistry.model.*;
import com.ionoscloud.containerregistry.api.TokensApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: basicAuth
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    TokensApi apiInstance = new TokensApi(defaultClient);
    UUID registryId = new UUID(); // UUID | The unique ID of the registry
    UUID tokenId = new UUID(); // UUID | The unique ID of the token
    PatchTokenInput patchTokenInput = new PatchTokenInput(); // PatchTokenInput | 
    try {
      ApiResponse<TokenResponse> result = apiInstance.registriesTokensPatchWithHttpInfo(registryId, tokenId, patchTokenInput);
      System.out.println("Response: " + result.getData());
      System.out.println("Status Code: " + result.getStatusCode());
      System.out.println("Headers: " + result.getHeaders());
    } catch (ApiException e) {
      System.err.println("Exception when calling TokensApi#registriesTokensPatch");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

⚠️ Note: for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.

Parameters

Name
Type
Description
Notes

registryId

The unique ID of the registry

tokenId

The unique ID of the token

patchTokenInput

Return type

TokenResponse

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

registriesTokensPost

PostTokenOutput registriesTokensPost(registryId, postTokenInput)

Create token

Create a token - password is only available once in the POST response

Example

// Import classes:
import com.ionoscloud.containerregistry.ApiClient;
import com.ionoscloud.containerregistry.ApiException;
import com.ionoscloud.containerregistry.ApiResponse;
import com.ionoscloud.containerregistry.Configuration;
import com.ionoscloud.containerregistry.auth.*;
import com.ionoscloud.containerregistry.model.*;
import com.ionoscloud.containerregistry.api.TokensApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: basicAuth
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    TokensApi apiInstance = new TokensApi(defaultClient);
    UUID registryId = new UUID(); // UUID | The unique ID of the registry
    PostTokenInput postTokenInput = new PostTokenInput(); // PostTokenInput | 
    try {
      ApiResponse<PostTokenOutput> result = apiInstance.registriesTokensPostWithHttpInfo(registryId, postTokenInput);
      System.out.println("Response: " + result.getData());
      System.out.println("Status Code: " + result.getStatusCode());
      System.out.println("Headers: " + result.getHeaders());
    } catch (ApiException e) {
      System.err.println("Exception when calling TokensApi#registriesTokensPost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

⚠️ Note: for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.

Parameters

Name
Type
Description
Notes

registryId

The unique ID of the registry

postTokenInput

Return type

PostTokenOutput

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

registriesTokensPut

PutTokenOutput registriesTokensPut(registryId, tokenId, putTokenInput)

Create or replace token

Create/replace a token - password is only available once in the create response - &quot;name&quot; cannot be changed

Example

// Import classes:
import com.ionoscloud.containerregistry.ApiClient;
import com.ionoscloud.containerregistry.ApiException;
import com.ionoscloud.containerregistry.ApiResponse;
import com.ionoscloud.containerregistry.Configuration;
import com.ionoscloud.containerregistry.auth.*;
import com.ionoscloud.containerregistry.model.*;
import com.ionoscloud.containerregistry.api.TokensApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: basicAuth
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    TokensApi apiInstance = new TokensApi(defaultClient);
    UUID registryId = new UUID(); // UUID | The unique ID of the registry
    String tokenId = "tokenId_example"; // String | The unique ID of the token
    PutTokenInput putTokenInput = new PutTokenInput(); // PutTokenInput | 
    try {
      ApiResponse<PutTokenOutput> result = apiInstance.registriesTokensPutWithHttpInfo(registryId, tokenId, putTokenInput);
      System.out.println("Response: " + result.getData());
      System.out.println("Status Code: " + result.getStatusCode());
      System.out.println("Headers: " + result.getHeaders());
    } catch (ApiException e) {
      System.err.println("Exception when calling TokensApi#registriesTokensPut");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

⚠️ Note: for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.

Parameters

Name
Type
Description
Notes

registryId

The unique ID of the registry

tokenId

String

The unique ID of the token

putTokenInput

Return type

PutTokenOutput

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

Last updated