TokensApi

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

MethodHTTP requestDescription

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

var result  = RegistriesTokensDelete(ctx, registryId, tokenId)
                      .Execute()

Delete token

Example

package main

import (
    "context"
    "fmt"
    "os"

    containerregistry "github.com/ionos-cloud/sdk-go-bundle/products/containerregistry"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    registryId := TODO // string | The unique ID of the registry
    tokenId := TODO // string | The unique ID of the token

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := containerregistry.NewAPIClient(configuration)
    resource, resp, err := apiClient.TokensApi.RegistriesTokensDelete(context.Background(), registryId, tokenId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TokensApi.RegistriesTokensDelete``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
}

Path Parameters

NameTypeDescriptionNotes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

registryId

The unique ID of the registry

tokenId

The unique ID of the token

Other Parameters

Other parameters are passed through a pointer to an apiRegistriesTokensDeleteRequest struct via the builder pattern

Return type

(empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

RegistriesTokensFindById

var result TokenResponse = RegistriesTokensFindById(ctx, registryId, tokenId)
                      .Execute()

Get token information

Example

package main

import (
    "context"
    "fmt"
    "os"

    containerregistry "github.com/ionos-cloud/sdk-go-bundle/products/containerregistry"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    registryId := TODO // string | The unique ID of the registry
    tokenId := TODO // string | The unique ID of the token

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := containerregistry.NewAPIClient(configuration)
    resource, resp, err := apiClient.TokensApi.RegistriesTokensFindById(context.Background(), registryId, tokenId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TokensApi.RegistriesTokensFindById``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `RegistriesTokensFindById`: TokenResponse
    fmt.Fprintf(os.Stdout, "Response from `TokensApi.RegistriesTokensFindById`: %v\n", resource)
}

Path Parameters

NameTypeDescriptionNotes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

registryId

The unique ID of the registry

tokenId

The unique ID of the token

Other Parameters

Other parameters are passed through a pointer to an apiRegistriesTokensFindByIdRequest struct via the builder pattern

Return type

TokenResponse

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

RegistriesTokensGet

var result TokensResponse = RegistriesTokensGet(ctx, registryId)
                      .Offset(offset)
                      .Limit(limit)
                      .Execute()

List all tokens for the container registry

Example

package main

import (
    "context"
    "fmt"
    "os"

    containerregistry "github.com/ionos-cloud/sdk-go-bundle/products/containerregistry"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    registryId := TODO // string | The unique ID of the registry
    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) (optional) (default to "0")
    limit := "limit_example" // string | The maximum number of elements to return (used together with offset for pagination) (optional) (default to "100")

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := containerregistry.NewAPIClient(configuration)
    resource, resp, err := apiClient.TokensApi.RegistriesTokensGet(context.Background(), registryId).Offset(offset).Limit(limit).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TokensApi.RegistriesTokensGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `RegistriesTokensGet`: TokensResponse
    fmt.Fprintf(os.Stdout, "Response from `TokensApi.RegistriesTokensGet`: %v\n", resource)
}

Path Parameters

NameTypeDescriptionNotes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

registryId

The unique ID of the registry

Other Parameters

Other parameters are passed through a pointer to an apiRegistriesTokensGetRequest struct via the builder pattern

NameTypeDescriptionNotes

offset

string

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

[default to "0"]

limit

string

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

[default to "100"]

Return type

TokensResponse

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

RegistriesTokensPatch

var result TokenResponse = RegistriesTokensPatch(ctx, registryId, tokenId)
                      .PatchTokenInput(patchTokenInput)
                      .Execute()

Update token

Example

package main

import (
    "context"
    "fmt"
    "os"

    containerregistry "github.com/ionos-cloud/sdk-go-bundle/products/containerregistry"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    registryId := TODO // string | The unique ID of the registry
    tokenId := TODO // string | The unique ID of the token
    patchTokenInput := *openapiclient.NewPatchTokenInput() // PatchTokenInput | 

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := containerregistry.NewAPIClient(configuration)
    resource, resp, err := apiClient.TokensApi.RegistriesTokensPatch(context.Background(), registryId, tokenId).PatchTokenInput(patchTokenInput).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TokensApi.RegistriesTokensPatch``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `RegistriesTokensPatch`: TokenResponse
    fmt.Fprintf(os.Stdout, "Response from `TokensApi.RegistriesTokensPatch`: %v\n", resource)
}

Path Parameters

NameTypeDescriptionNotes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

registryId

The unique ID of the registry

tokenId

The unique ID of the token

Other Parameters

Other parameters are passed through a pointer to an apiRegistriesTokensPatchRequest struct via the builder pattern

NameTypeDescriptionNotes

patchTokenInput

Return type

TokenResponse

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

RegistriesTokensPost

var result PostTokenOutput = RegistriesTokensPost(ctx, registryId)
                      .PostTokenInput(postTokenInput)
                      .Execute()

Create token

Example

package main

import (
    "context"
    "fmt"
    "os"

    containerregistry "github.com/ionos-cloud/sdk-go-bundle/products/containerregistry"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    registryId := TODO // string | The unique ID of the registry
    postTokenInput := *openapiclient.NewPostTokenInput(*openapiclient.NewPostTokenProperties("push-token")) // PostTokenInput | 

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := containerregistry.NewAPIClient(configuration)
    resource, resp, err := apiClient.TokensApi.RegistriesTokensPost(context.Background(), registryId).PostTokenInput(postTokenInput).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TokensApi.RegistriesTokensPost``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `RegistriesTokensPost`: PostTokenOutput
    fmt.Fprintf(os.Stdout, "Response from `TokensApi.RegistriesTokensPost`: %v\n", resource)
}

Path Parameters

NameTypeDescriptionNotes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

registryId

The unique ID of the registry

Other Parameters

Other parameters are passed through a pointer to an apiRegistriesTokensPostRequest struct via the builder pattern

NameTypeDescriptionNotes

postTokenInput

Return type

PostTokenOutput

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

RegistriesTokensPut

var result PutTokenOutput = RegistriesTokensPut(ctx, registryId, tokenId)
                      .PutTokenInput(putTokenInput)
                      .Execute()

Create or replace token

Example

package main

import (
    "context"
    "fmt"
    "os"

    containerregistry "github.com/ionos-cloud/sdk-go-bundle/products/containerregistry"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    registryId := TODO // string | The unique ID of the registry
    tokenId := "tokenId_example" // string | The unique ID of the token
    putTokenInput := *openapiclient.NewPutTokenInput(*openapiclient.NewPostTokenProperties("push-token")) // PutTokenInput | 

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := containerregistry.NewAPIClient(configuration)
    resource, resp, err := apiClient.TokensApi.RegistriesTokensPut(context.Background(), registryId, tokenId).PutTokenInput(putTokenInput).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TokensApi.RegistriesTokensPut``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `RegistriesTokensPut`: PutTokenOutput
    fmt.Fprintf(os.Stdout, "Response from `TokensApi.RegistriesTokensPut`: %v\n", resource)
}

Path Parameters

NameTypeDescriptionNotes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

registryId

The unique ID of the registry

tokenId

string

The unique ID of the token

Other Parameters

Other parameters are passed through a pointer to an apiRegistriesTokensPutRequest struct via the builder pattern

NameTypeDescriptionNotes

putTokenInput

Return type

PutTokenOutput

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

Last updated