IBM Cloud Container Registry

Introduction

IBM Cloud™ Container Registry provides a multi-tenant, highly available, and scalable private image registry that is hosted and managed by IBM. You can use the private registry by setting up your own image namespace and pushing container images to your namespace.

For more information about IBM Cloud Container Registry, see About IBM Cloud Container Registry.

For more information about IBM Cloud Kubernetes Service, see Getting started with IBM Cloud Kubernetes Service.

The code examples on this tab use the client library that is provided for Node.js.

npm install @ibm-cloud/ibm-container-registry

GitHub

The code examples on this tab use the client library that is provided for Go.

go get -u github.com/IBM/container-registry-go-sdk

GitHub

The code examples on this tab use the client library that is provided for Python.

pip install --upgrade "ibm-container-registry"

GitHub

The code examples on this tab use the client library that is provided for Java.

Gradle

compile group: 'com.ibm.cloud', name: 'container-registry', version: '0.+'

Maven

GitHub

Endpoint URL

The endpoint for the IBM Cloud Container Registry API is in the format: https://<registry_dns_name> For example, the API endpoint for Dallas is: https://us.icr.io To find out about the available IBM Cloud Container Registry DNS names, see Regions.

If you want to find the endpoint for the registry that you are currently targeting, run the ibmcloud cr api command.

Authentication

Access to IBM Cloud Container Registry is controlled by using IBM Cloud Identity and Access Management (IAM), which provides a unified approach to managing user identities and access control across your IBM Cloud services and applications.

This API requires IBM Cloud Identity and Access Management (IAM) authentication. You must pass an IAM token in the Authorization header of the request. You can retrieve your IAM access token, which is prefixed with Bearer, by running the ibmcloud iam oauth-tokens command. You must also set the Account header to the unique ID for your IBM Cloud account. You can retrieve your Account ID by running the ibmcloud account show command.

To call each method, you must be assigned a role that includes the required IAM actions. Each method lists the associated action. For more information about IAM actions and how they map to roles, see Managing access for IBM Cloud Container Registry.

Auditing

You can monitor API activity within your account by using the IBM Cloud Activity Tracker service. Whenever an API method is called, an event is generated that you can then track and audit from within Activity Tracker. The specific event type is listed for each individual method. For more information about how to track IBM Cloud Container Registry activity, see Auditing the events for Container Registry.

For more information about IAM actions and Activity Tracker actions by API method, see IAM and Activity Tracker actions by API method.

Error handling

The IBM Cloud Container Registry service uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response always indicates success. A 400 type response indicates a failure, and a 500 type response usually indicates an internal system error.

Methods

Get authorization options

Get authorization options for the targeted account.

Get authorization options for the targeted account.

Get authorization options for the targeted account.

Get authorization options for the targeted account.

Get authorization options for the targeted account.

GET /api/v1/auth
(containerRegistry *ContainerRegistryV1) GetAuth(getAuthOptions *GetAuthOptions) (result *AuthOptions, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) GetAuthWithContext(ctx context.Context, getAuthOptions *GetAuthOptions) (result *AuthOptions, response *core.DetailedResponse, err error)
getAuth(params)
get_auth(self,
        **kwargs
    ) -> DetailedResponse
ServiceCall<AuthOptions> getAuth(GetAuthOptions getAuthOptions)

Request

Instantiate the GetAuthOptions struct and set the fields to provide parameter values for the GetAuth method.

Use the GetAuthOptions.Builder to create a GetAuthOptions object that contains the parameter values for the getAuth method.

Custom Headers

  • The unique ID for your IBM Cloud account.

WithContext method only

parameters

  • The unique ID for your IBM Cloud account.

parameters

  • The unique ID for your IBM Cloud account.

  • curl -X GET   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   --url 'https://us.icr.io/api/v1/auth' 
    
  • getAuthOptions := containerRegistryService.NewGetAuthOptions()
    
    authOptions, response, err := containerRegistryService.GetAuth(getAuthOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(authOptions, "", "  ")
    fmt.Println(string(b))
  • containerRegistryService.getAuth({})
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • auth_options = container_registry_service.get_auth().get_result()
    
    print(json.dumps(auth_options, indent=2))
  • GetAuthOptions getAuthOptions = new GetAuthOptions();
    
    Response<AuthOptions> response = service.getAuth(getAuthOptions).execute();
    AuthOptions authOptions = response.getResult();
    
    System.out.println(authOptions);

Response

The authorization options for the targeted IBM Cloud account

The authorization options for the targeted IBM Cloud account.

The authorization options for the targeted IBM Cloud account.

The authorization options for the targeted IBM Cloud account.

The authorization options for the targeted IBM Cloud account.

Status Code

  • Success

  • A required header is missing. Correct the request and try again.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "iam_authz": true,
      "private_only": false
    }
  • {
      "iam_authz": true,
      "private_only": false
    }

Update authorization options

Update authorization options for the targeted account.

Update authorization options for the targeted account.

Update authorization options for the targeted account.

Update authorization options for the targeted account.

Update authorization options for the targeted account.

PATCH /api/v1/auth
(containerRegistry *ContainerRegistryV1) UpdateAuth(updateAuthOptions *UpdateAuthOptions) (response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) UpdateAuthWithContext(ctx context.Context, updateAuthOptions *UpdateAuthOptions) (response *core.DetailedResponse, err error)
updateAuth(params)
update_auth(self,
        *,
        iam_authz: bool = None,
        private_only: bool = None,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Void> updateAuth(UpdateAuthOptions updateAuthOptions)

Request

Instantiate the UpdateAuthOptions struct and set the fields to provide parameter values for the UpdateAuth method.

Use the UpdateAuthOptions.Builder to create a UpdateAuthOptions object that contains the parameter values for the updateAuth method.

Custom Headers

  • The unique ID for your IBM Cloud account.

A JSON document containing the requested updates.

Examples:
View

WithContext method only

The UpdateAuth options.

parameters

  • The unique ID for your IBM Cloud account.

  • Enable role based authorization when authenticating with IBM Cloud IAM.

    Examples:
    value
    _source
    _lines
    _html
  • Restrict account to only be able to push and pull images over private connections.

parameters

  • The unique ID for your IBM Cloud account.

  • Enable role based authorization when authenticating with IBM Cloud IAM.

    Examples:
    value
    _source
    _lines
    _html
  • Restrict account to only be able to push and pull images over private connections.

The updateAuth options.

  • curl -X PATCH   -H "Content-Type: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -d "{\"iam_authz\":true}"   --url 'https://us.icr.io/api/v1/auth' 
    
  • updateAuthOptions := containerRegistryService.NewUpdateAuthOptions()
    updateAuthOptions.SetIamAuthz(true)
    
    response, err := containerRegistryService.UpdateAuth(updateAuthOptions)
    if err != nil {
      panic(err)
    }
  • const params = {
      iamAuthz: true,
    };
    
    containerRegistryService.updateAuth(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • response = container_registry_service.update_auth(
      iam_authz=True
    ).get_result()
    
    print(json.dumps(response, indent=2))
  • UpdateAuthOptions updateAuthOptions = new UpdateAuthOptions.Builder()
      .iamAuthz(true)
      .build();
    
    service.updateAuth(updateAuthOptions).execute();

Response

Status Code

  • Success

  • A required header is missing or invalid. Correct the request and try again.

  • You do not have access to perform the requested operation. You must have either Manager or Billing Manager roles on the targeted account to perform this action.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

No Sample Response

This method does not specify any sample responses.

Build a container image

Similar to the API for docker build. Builds an image in the cloud and pushes to one of your namespaces in the registry.

POST /api/v1/builds

Request

Custom Headers

  • The IBM Cloud IAM refresh token that you receive when you log in to IBM Cloud. Your refresh token is stored in your IBM Cloud config file: ~/.bluemix/config.json

  • The unique ID for your IBM Cloud account.

Query Parameters

  • The full name for the image that you want to build, including the registry URL and namespace.

  • Specify the location of the Dockerfile relative to the build context. If not specified, the default is 'PATH/Dockerfile', where PATH is the root of the build context.

  • If set to true, cached image layers from previous builds are not used in this build. Use this option if you expect the result of commands that run in the build to change.

  • If set to true, the base image is pulled even if an image with a matching tag already exists on the build host. The base image is specified by using the FROM keyword in your Dockerfile. Use this option to update the version of the base image on the build host.

  • If set to true, the filesystem of the built image is reduced to one layer before it is pushed to the registry. Use this option if the number of layers in your image is close to the maximum for your storage driver.

  • A JSON key-value structure that contains build arguments. The value of the build arguments are available as environment variables when you specify an ARG line which matches the key in your Dockerfile.

  • If set to true, build output is suppressed unless an error occurs.

Response

The output from the build host

Status Code

  • A stream of JSON objects that contain the output from the build host.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

No Sample Response

This method does not specify any sample responses.

List images

List all images in namespaces in a targeted IBM Cloud account.

List all images in namespaces in a targeted IBM Cloud account.

List all images in namespaces in a targeted IBM Cloud account.

List all images in namespaces in a targeted IBM Cloud account.

List all images in namespaces in a targeted IBM Cloud account.

GET /api/v1/images
(containerRegistry *ContainerRegistryV1) ListImages(listImagesOptions *ListImagesOptions) (result []RemoteAPIImage, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) ListImagesWithContext(ctx context.Context, listImagesOptions *ListImagesOptions) (result []RemoteAPIImage, response *core.DetailedResponse, err error)
listImages(params)
list_images(self,
        *,
        namespace: str = None,
        include_ibm: bool = None,
        include_private: bool = None,
        include_manifest_lists: bool = None,
        vulnerabilities: bool = None,
        repository: str = None,
        **kwargs
    ) -> DetailedResponse
ServiceCall<List<RemoteAPIImage>> listImages(ListImagesOptions listImagesOptions)

Request

Instantiate the ListImagesOptions struct and set the fields to provide parameter values for the ListImages method.

Use the ListImagesOptions.Builder to create a ListImagesOptions object that contains the parameter values for the listImages method.

Custom Headers

  • The unique ID for your IBM Cloud account.

Query Parameters

  • Lists images that are stored in the specified namespace only. Query multiple namespaces by specifying this option for each namespace. If this option is not specified, images from all namespaces in the specified IBM Cloud account are listed.

  • Includes IBM-provided public images in the list of images. If this option is not specified, private images are listed only. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Includes private images in the list of images. If this option is not specified, private images are listed. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Includes tags that reference multi-architecture manifest lists in the image list. If this option is not specified, tagged manifest lists are not shown in the list. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Displays Vulnerability Advisor status for the listed images. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Lists images that are stored in the specified repository, under your namespaces. Query multiple repositories by specifying this option for each repository. If this option is not specified, images from all repos are listed.

WithContext method only

The ListImages options.

parameters

  • The unique ID for your IBM Cloud account.

  • Lists images that are stored in the specified namespace only. Query multiple namespaces by specifying this option for each namespace. If this option is not specified, images from all namespaces in the specified IBM Cloud account are listed.

  • Includes IBM-provided public images in the list of images. If this option is not specified, private images are listed only. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Includes private images in the list of images. If this option is not specified, private images are listed. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Includes tags that reference multi-architecture manifest lists in the image list. If this option is not specified, tagged manifest lists are not shown in the list. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Displays Vulnerability Advisor status for the listed images. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Lists images that are stored in the specified repository, under your namespaces. Query multiple repositories by specifying this option for each repository. If this option is not specified, images from all repos are listed.

parameters

  • The unique ID for your IBM Cloud account.

  • Lists images that are stored in the specified namespace only. Query multiple namespaces by specifying this option for each namespace. If this option is not specified, images from all namespaces in the specified IBM Cloud account are listed.

  • Includes IBM-provided public images in the list of images. If this option is not specified, private images are listed only. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Includes private images in the list of images. If this option is not specified, private images are listed. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Includes tags that reference multi-architecture manifest lists in the image list. If this option is not specified, tagged manifest lists are not shown in the list. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Displays Vulnerability Advisor status for the listed images. If this option is specified more than once, the last parsed setting is the setting that is used.

  • Lists images that are stored in the specified repository, under your namespaces. Query multiple repositories by specifying this option for each repository. If this option is not specified, images from all repos are listed.

The listImages options.

  • curl -X GET   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   --url 'https://us.icr.io/api/v1/images?includeIBM=false&includePrivate=true&includeManifestLists=true&vulnerabilities=true' 
    
  • listImagesOptions := containerRegistryService.NewListImagesOptions()
    
    remoteApiImage, response, err := containerRegistryService.ListImages(listImagesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(remoteApiImage, "", "  ")
    fmt.Println(string(b))
  • containerRegistryService.listImages({})
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • list_remote_api_image = container_registry_service.list_images().get_result()
    
    print(json.dumps(list_remote_api_image, indent=2))
  • ListImagesOptions listImagesOptions = new ListImagesOptions.Builder()
      .build();
    
    Response<List<RemoteAPIImage>> response = service.listImages(listImagesOptions).execute();
    List<RemoteAPIImage> listRemoteApiImage = response.getResult();
    
    System.out.println(listRemoteApiImage);

Response

Response type: []RemoteAPIImage

Response type: RemoteAPIImage[]

Response type: List[RemoteAPIImage]

Response type: List<RemoteAPIImage>

Information about an image, in a format consistent with the Docker Remote API format.

Status Code

  • Success

  • A required header is missing. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • You do not have access to the specified namespace. Choose another namespace.

  • No namespaces were found for the targeted account. Add a namespace or target a different account. Alternatively, specify the option to include IBM-provided public images.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • [
      {
        "Id": "sha256:11106fafa8005fdcf4641634220afe7bda9e6d86136d0c47902ff17d3324aaaa",
        "ParentId": "",
        "DigestTags": {
          "sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bbbb": [
            "us.icr.io/birds/woodpecker:greaterspotted"
          ]
        },
        "RepoTags": [
          "us.icr.io/birds/woodpecker:greaterspotted"
        ],
        "RepoDigests": [
          "us.icr.io/birds/woodpecker@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bbbb"
        ],
        "Created": 1588672695,
        "Size": 760854,
        "VirtualSize": 760854,
        "Labels": {
          "key": "value"
        },
        "Vulnerable": "true",
        "VulnerabilityCount": 3,
        "ConfigurationIssueCount": 0,
        "IssueCount": 3,
        "ExemptIssueCount": 0,
        "ManifestType": "application/vnd.docker.distribution.manifest.v2+json"
      },
      {
        "Id": "sha256:25877264d5cb6b656bd630431369c01a0969cb16c88103792036ed2a6599cccc",
        "ParentId": "",
        "DigestTags": {
          "sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd": [
            "us.icr.io/birds/woodpecker:green",
            "us.icr.io/birds/woodpecker:latest",
            "us.icr.io/birds/bird:greenwoodpecker",
            "us.icr.io/favouritebirds/woodpecker:green"
          ]
        },
        "RepoTags": [
          "us.icr.io/birds/woodpecker:green",
          "us.icr.io/birds/woodpecker:latest",
          "us.icr.io/birds/bird:greenwoodpecker",
          "us.icr.io/favouritebirds/woodpecker:green"
        ],
        "RepoDigests": [
          "us.icr.io/birds/woodpecker@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd",
          "us.icr.io/birds/bird@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd",
          "us.icr.io/favouritebirds/woodpecker@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd"
        ],
        "Created": 1520977035,
        "Size": 9541618,
        "VirtualSize": 9541618,
        "Labels": {
          "key": "value"
        },
        "Vulnerable": "false",
        "VulnerabilityCount": 0,
        "ConfigurationIssueCount": 0,
        "IssueCount": 0,
        "ExemptIssueCount": 0,
        "ManifestType": "application/vnd.docker.distribution.manifest.v2+json"
      }
    ]
  • [
      {
        "Id": "sha256:11106fafa8005fdcf4641634220afe7bda9e6d86136d0c47902ff17d3324aaaa",
        "ParentId": "",
        "DigestTags": {
          "sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bbbb": [
            "us.icr.io/birds/woodpecker:greaterspotted"
          ]
        },
        "RepoTags": [
          "us.icr.io/birds/woodpecker:greaterspotted"
        ],
        "RepoDigests": [
          "us.icr.io/birds/woodpecker@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bbbb"
        ],
        "Created": 1588672695,
        "Size": 760854,
        "VirtualSize": 760854,
        "Labels": {
          "key": "value"
        },
        "Vulnerable": "true",
        "VulnerabilityCount": 3,
        "ConfigurationIssueCount": 0,
        "IssueCount": 3,
        "ExemptIssueCount": 0,
        "ManifestType": "application/vnd.docker.distribution.manifest.v2+json"
      },
      {
        "Id": "sha256:25877264d5cb6b656bd630431369c01a0969cb16c88103792036ed2a6599cccc",
        "ParentId": "",
        "DigestTags": {
          "sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd": [
            "us.icr.io/birds/woodpecker:green",
            "us.icr.io/birds/woodpecker:latest",
            "us.icr.io/birds/bird:greenwoodpecker",
            "us.icr.io/favouritebirds/woodpecker:green"
          ]
        },
        "RepoTags": [
          "us.icr.io/birds/woodpecker:green",
          "us.icr.io/birds/woodpecker:latest",
          "us.icr.io/birds/bird:greenwoodpecker",
          "us.icr.io/favouritebirds/woodpecker:green"
        ],
        "RepoDigests": [
          "us.icr.io/birds/woodpecker@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd",
          "us.icr.io/birds/bird@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd",
          "us.icr.io/favouritebirds/woodpecker@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd"
        ],
        "Created": 1520977035,
        "Size": 9541618,
        "VirtualSize": 9541618,
        "Labels": {
          "key": "value"
        },
        "Vulnerable": "false",
        "VulnerabilityCount": 0,
        "ConfigurationIssueCount": 0,
        "IssueCount": 0,
        "ExemptIssueCount": 0,
        "ManifestType": "application/vnd.docker.distribution.manifest.v2+json"
      }
    ]

Bulk delete images

Remove multiple container images from the registry.

Remove multiple container images from the registry.

Remove multiple container images from the registry.

Remove multiple container images from the registry.

Remove multiple container images from the registry.

POST /api/v1/images/bulkdelete
(containerRegistry *ContainerRegistryV1) BulkDeleteImages(bulkDeleteImagesOptions *BulkDeleteImagesOptions) (result *ImageBulkDeleteResult, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) BulkDeleteImagesWithContext(ctx context.Context, bulkDeleteImagesOptions *BulkDeleteImagesOptions) (result *ImageBulkDeleteResult, response *core.DetailedResponse, err error)
bulkDeleteImages(params)
bulk_delete_images(self,
        bulk_delete: List[str],
        **kwargs
    ) -> DetailedResponse
ServiceCall<ImageBulkDeleteResult> bulkDeleteImages(BulkDeleteImagesOptions bulkDeleteImagesOptions)

Request

Instantiate the BulkDeleteImagesOptions struct and set the fields to provide parameter values for the BulkDeleteImages method.

Use the BulkDeleteImagesOptions.Builder to create a BulkDeleteImagesOptions object that contains the parameter values for the bulkDeleteImages method.

Custom Headers

  • The unique ID for your IBM Cloud account.

The full IBM Cloud registry path to the images that you want to delete, including its digest. All tags for the supplied digest are removed.

Examples:
View

WithContext method only

The BulkDeleteImages options.

parameters

  • The unique ID for your IBM Cloud account.

  • The full IBM Cloud registry path to the images that you want to delete, including its digest. All tags for the supplied digest are removed.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The unique ID for your IBM Cloud account.

  • The full IBM Cloud registry path to the images that you want to delete, including its digest. All tags for the supplied digest are removed.

    Examples:
    value
    _source
    _lines
    _html

The bulkDeleteImages options.

  • curl -X POST   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -H "Content-Type: application/json"   -d "[\"us.icr.io/birds/woodpecker@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bbbb\",\"us.icr.io/birds/bird@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd\"]"   --url 'https://us.icr.io/api/v1/images/bulkdelete' 
    
  • bulkDeleteImagesOptions := containerRegistryService.NewBulkDeleteImagesOptions(
      []string{"image name"},
    )
    
    imageBulkDeleteResult, response, err := containerRegistryService.BulkDeleteImages(bulkDeleteImagesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(imageBulkDeleteResult, "", "  ")
    fmt.Println(string(b))
  • const params = {
      bulkDelete: ['image name'],
    };
    
    containerRegistryService.bulkDeleteImages(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • image_bulk_delete_result = container_registry_service.bulk_delete_images(
      bulk_delete=['image name']
    ).get_result()
    
    print(json.dumps(image_bulk_delete_result, indent=2))
  • BulkDeleteImagesOptions bulkDeleteImagesOptions = new BulkDeleteImagesOptions.Builder()
      .bulkDelete(new java.util.ArrayList<String>(java.util.Arrays.asList("image name")))
      .build();
    
    Response<ImageBulkDeleteResult> response = service.bulkDeleteImages(bulkDeleteImagesOptions).execute();
    ImageBulkDeleteResult imageBulkDeleteResult = response.getResult();
    
    System.out.println(imageBulkDeleteResult);

Response

The results of a bulk image delete request.

The results of a bulk image delete request.

The results of a bulk image delete request.

The results of a bulk image delete request.

The results of a bulk image delete request.

Status Code

  • Success

  • A required header is missing. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "success": [
        "us.icr.io/birds/woodpecker@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bbbb"
      ],
      "error": {
        "us.icr.io/birds/bird@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bdbd": {
          "code": "CRI0103E",
          "message": "The image was not found. Correct the image name or digest reference, and try again."
        }
      }
    }
  • {
      "success": [
        "us.icr.io/birds/woodpecker@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bbbb"
      ],
      "error": {
        "us.icr.io/birds/bird@sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bdbd": {
          "code": "CRI0103E",
          "message": "The image was not found. Correct the image name or digest reference, and try again."
        }
      }
    }

List images by digest

List all images by digest in namespaces in a targeted IBM Cloud account.

List all images by digest in namespaces in a targeted IBM Cloud account.

List all images by digest in namespaces in a targeted IBM Cloud account.

List all images by digest in namespaces in a targeted IBM Cloud account.

List all images by digest in namespaces in a targeted IBM Cloud account.

POST /api/v1/images/digests
(containerRegistry *ContainerRegistryV1) ListImageDigests(listImageDigestsOptions *ListImageDigestsOptions) (result []ImageDigest, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) ListImageDigestsWithContext(ctx context.Context, listImageDigestsOptions *ListImageDigestsOptions) (result []ImageDigest, response *core.DetailedResponse, err error)
listImageDigests(params)
list_image_digests(self,
        *,
        exclude_tagged: bool = None,
        exclude_va: bool = None,
        include_ibm: bool = None,
        repositories: List[str] = None,
        **kwargs
    ) -> DetailedResponse
ServiceCall<List<ImageDigest>> listImageDigests(ListImageDigestsOptions listImageDigestsOptions)

Request

Instantiate the ListImageDigestsOptions struct and set the fields to provide parameter values for the ListImageDigests method.

Use the ListImageDigestsOptions.Builder to create a ListImageDigestsOptions object that contains the parameter values for the listImageDigests method.

Custom Headers

  • The unique ID for your IBM Cloud account.

A JSON document containing the list options.

Examples:
View

WithContext method only

The ListImageDigests options.

parameters

  • The unique ID for your IBM Cloud account.

  • ExcludeTagged returns only untagged digests.

    Examples:
    value
    _source
    _lines
    _html
  • ExcludeVA returns the digest list with no VA scan results.

    Examples:
    value
    _source
    _lines
    _html
  • When true, API will return the IBM public images if they exist in the targeted region.

    Examples:
    value
    _source
    _lines
    _html
  • Repositories in which to restrict the output. If left empty all images for the account will be returned.

parameters

  • The unique ID for your IBM Cloud account.

  • ExcludeTagged returns only untagged digests.

    Examples:
    value
    _source
    _lines
    _html
  • ExcludeVA returns the digest list with no VA scan results.

    Examples:
    value
    _source
    _lines
    _html
  • When true, API will return the IBM public images if they exist in the targeted region.

    Examples:
    value
    _source
    _lines
    _html
  • Repositories in which to restrict the output. If left empty all images for the account will be returned.

The listImageDigests options.

  • curl -X POST   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -H "Content-Type: application/json"   -d "{\"exclude_tagged\":false,\"exclude_va\":false,\"include_ibm\":false,\"repositories\":null}"   --url 'https://us.icr.io/api/v1/images/digests' 
    
  • listImageDigestsOptions := containerRegistryService.NewListImageDigestsOptions()
    listImageDigestsOptions.SetExcludeTagged(false)
    listImageDigestsOptions.SetExcludeVa(false)
    listImageDigestsOptions.SetIncludeIBM(false)
    
    digestListImage, response, err := containerRegistryService.ListImageDigests(listImageDigestsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(digestListImage, "", "  ")
    fmt.Println(string(b))
  • const params = {
      excludeTagged: false,
      excludeVa: false,
      includeIbm: false,
    };
    
    containerRegistryService.listImageDigests(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • list_image_digest = container_registry_service.list_image_digests(
      exclude_tagged=False,
      exclude_va=False,
      include_ibm=False
    ).get_result()
    
    print(json.dumps(list_image_digest, indent=2))
  • ListImageDigestsOptions listImageDigestsOptions = new ListImageDigestsOptions.Builder()
      .excludeTagged(false)
      .excludeVa(false)
      .includeIbm(false)
      .build();
    
    Response<List<ImageDigest>> response = service.listImageDigests(listImageDigestsOptions).execute();
    List<ImageDigest> listImageDigest = response.getResult();
    
    System.out.println(listImageDigest);

Response

Response type: []ImageDigest

Response type: ImageDigest[]

Response type: List[ImageDigest]

Response type: List<ImageDigest>

An array of image objects

Status Code

  • Success

  • A required header is missing. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • You do not have access to the specified namespace. Choose another namespace.

  • No namespaces were found for the targeted account. Add a namespace or target a different account. Alternatively, specify the option to include IBM-provided public images.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • [
      {
        "id": "sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bbbb",
        "repoTags": {
          "us.icr.io/birds/woodpecker": {
            "greaterspotted": {
              "vulnerable": "true",
              "vulnerabilityCount": 3,
              "configurationIssueCount": 0,
              "issueCount": 3,
              "exemptIssueCount": 0
            }
          }
        },
        "created": 1568815884,
        "size": 6762886,
        "manifestType": "application/vnd.docker.distribution.manifest.v2+json"
      },
      {
        "id": "sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd",
        "repoTags": {
          "us.icr.io/birds/woodpecker": {
            "green": {
              "vulnerable": "false",
              "vulnerabilityCount": 0,
              "configurationIssueCount": 0,
              "issueCount": 0,
              "exemptIssueCount": 0
            },
            "latest": {
              "vulnerable": "false",
              "vulnerabilityCount": 0,
              "configurationIssueCount": 0,
              "issueCount": 0,
              "exemptIssueCount": 0
            }
          },
          "us.icr.io/birds/bird": {
            "greenwoodpecker": {
              "vulnerable": "false",
              "vulnerabilityCount": 0,
              "configurationIssueCount": 0,
              "issueCount": 0,
              "exemptIssueCount": 0
            }
          },
          "us.icr.io/favouritebirds/woodpecker": {
            "green": {
              "vulnerable": "false",
              "vulnerabilityCount": 0,
              "configurationIssueCount": 0,
              "issueCount": 0,
              "exemptIssueCount": 0
            }
          }
        },
        "created": 1546305670,
        "size": 755724,
        "manifestType": "application/vnd.docker.distribution.manifest.v2+json"
      }
    ]
  • [
      {
        "id": "sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4bbbb",
        "repoTags": {
          "us.icr.io/birds/woodpecker": {
            "greaterspotted": {
              "vulnerable": "true",
              "vulnerabilityCount": 3,
              "configurationIssueCount": 0,
              "issueCount": 3,
              "exemptIssueCount": 0
            }
          }
        },
        "created": 1568815884,
        "size": 6762886,
        "manifestType": "application/vnd.docker.distribution.manifest.v2+json"
      },
      {
        "id": "sha256:38f97dd92769b18ca82ad9ab6667af47306e66fea5b446937eea68b10ab4dddd",
        "repoTags": {
          "us.icr.io/birds/woodpecker": {
            "green": {
              "vulnerable": "false",
              "vulnerabilityCount": 0,
              "configurationIssueCount": 0,
              "issueCount": 0,
              "exemptIssueCount": 0
            },
            "latest": {
              "vulnerable": "false",
              "vulnerabilityCount": 0,
              "configurationIssueCount": 0,
              "issueCount": 0,
              "exemptIssueCount": 0
            }
          },
          "us.icr.io/birds/bird": {
            "greenwoodpecker": {
              "vulnerable": "false",
              "vulnerabilityCount": 0,
              "configurationIssueCount": 0,
              "issueCount": 0,
              "exemptIssueCount": 0
            }
          },
          "us.icr.io/favouritebirds/woodpecker": {
            "green": {
              "vulnerable": "false",
              "vulnerabilityCount": 0,
              "configurationIssueCount": 0,
              "issueCount": 0,
              "exemptIssueCount": 0
            }
          }
        },
        "created": 1546305670,
        "size": 755724,
        "manifestType": "application/vnd.docker.distribution.manifest.v2+json"
      }
    ]

Create tag

Create a new tag in a private registry that refers to an existing image in the same region. If the fromimage has Red Hat® signatures and the toimage is in a different repository, those signatures are copied to that repository.

Create a new tag in a private registry that refers to an existing image in the same region.

Create a new tag in a private registry that refers to an existing image in the same region.

Create a new tag in a private registry that refers to an existing image in the same region.

Create a new tag in a private registry that refers to an existing image in the same region.

POST /api/v1/images/tags
(containerRegistry *ContainerRegistryV1) TagImage(tagImageOptions *TagImageOptions) (response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) TagImageWithContext(ctx context.Context, tagImageOptions *TagImageOptions) (response *core.DetailedResponse, err error)
tagImage(params)
tag_image(self,
        fromimage: str,
        toimage: str,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Void> tagImage(TagImageOptions tagImageOptions)

Request

Instantiate the TagImageOptions struct and set the fields to provide parameter values for the TagImage method.

Use the TagImageOptions.Builder to create a TagImageOptions object that contains the parameter values for the tagImage method.

Custom Headers

  • The unique ID for your IBM Cloud account.

Query Parameters

  • The name of the image that you want to create a new tag for, in the format <REPOSITORY>:<TAG>. Run ibmcloud cr images or call the GET /images/json endpoint to review images that are in the registry.

  • The new tag for the image, in the format <REPOSITORY>:<TAG>.

WithContext method only

The TagImage options.

parameters

  • The unique ID for your IBM Cloud account.

  • The name of the image that you want to create a new tag for, in the format <REPOSITORY>:<TAG>. Run ibmcloud cr images or call the GET /images/json endpoint to review images that are in the registry.

  • The new tag for the image, in the format <REPOSITORY>:<TAG>.

parameters

  • The unique ID for your IBM Cloud account.

  • The name of the image that you want to create a new tag for, in the format <REPOSITORY>:<TAG>. Run ibmcloud cr images or call the GET /images/json endpoint to review images that are in the registry.

  • The new tag for the image, in the format <REPOSITORY>:<TAG>.

The tagImage options.

  • curl -X POST   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -H "Content-Type: application/json"   --url 'https://us.icr.io/api/v1/images/tags?fromimage=us.icr.io%2Fbirds%2Fwoodpecker%3Agreen&toimage=us.icr.io%2Fbirds%2Fwoodpecker%3Alatest' 
    
  • tagImageOptions := containerRegistryService.NewTagImageOptions(
      "from image name",
      "to image name",
    )
    
    response, err := containerRegistryService.TagImage(tagImageOptions)
    if err != nil {
      panic(err)
    }
  • const params = {
      fromimage: 'from image name',
      toimage: 'to image name',
    };
    
    containerRegistryService.tagImage(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • response = container_registry_service.tag_image(
      fromimage='from image name',
      toimage='to image name'
    ).get_result()
    
    print(json.dumps(response, indent=2))
  • TagImageOptions tagImageOptions = new TagImageOptions.Builder()
      .fromimage("from image name")
      .toimage("to image name")
      .build();
    
    service.tagImage(tagImageOptions).execute();

Response

Status Code

  • Success

  • There was a problem with the input. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • You do not have authorization to access the specified namespace.

  • An internal server error occurred

No Sample Response

This method does not specify any sample responses.

Delete image

Delete a container image from the registry.

Delete a container image from the registry.

Delete a container image from the registry.

Delete a container image from the registry.

Delete a container image from the registry.

DELETE /api/v1/images/{image}
(containerRegistry *ContainerRegistryV1) DeleteImage(deleteImageOptions *DeleteImageOptions) (result *ImageDeleteResult, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) DeleteImageWithContext(ctx context.Context, deleteImageOptions *DeleteImageOptions) (result *ImageDeleteResult, response *core.DetailedResponse, err error)
deleteImage(params)
delete_image(self,
        image: str,
        **kwargs
    ) -> DetailedResponse
ServiceCall<ImageDeleteResult> deleteImage(DeleteImageOptions deleteImageOptions)

Request

Instantiate the DeleteImageOptions struct and set the fields to provide parameter values for the DeleteImage method.

Use the DeleteImageOptions.Builder to create a DeleteImageOptions object that contains the parameter values for the deleteImage method.

Custom Headers

  • The unique ID for your IBM Cloud account.

Path Parameters

  • The full IBM Cloud registry path to the image that you want to delete, including its tag. If you do not provide a specific tag, the version with the latest tag is removed.

WithContext method only

The DeleteImage options.

parameters

  • The unique ID for your IBM Cloud account.

  • The full IBM Cloud registry path to the image that you want to delete, including its tag. If you do not provide a specific tag, the version with the latest tag is removed.

parameters

  • The unique ID for your IBM Cloud account.

  • The full IBM Cloud registry path to the image that you want to delete, including its tag. If you do not provide a specific tag, the version with the latest tag is removed.

The deleteImage options.

  • curl -X DELETE   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -H "accept: application/json"   --url 'https://us.icr.io/api/v1/images/us.icr.io%2Fbirds%2Fdodo%3Alatest' 
    
  • deleteImageOptions := containerRegistryService.NewDeleteImageOptions(
      "image name",
    )
    
    imageDeleteResult, response, err := containerRegistryService.DeleteImage(deleteImageOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(imageDeleteResult, "", "  ")
    fmt.Println(string(b))
  • const params = {
      image: 'image name',
    };
    
    containerRegistryService.deleteImage(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • image_delete_result = container_registry_service.delete_image(
      image='image name'
    ).get_result()
    
    print(json.dumps(image_delete_result, indent=2))
  • DeleteImageOptions deleteImageOptions = new DeleteImageOptions.Builder()
      .image("image name")
      .build();
    
    Response<ImageDeleteResult> response = service.deleteImage(deleteImageOptions).execute();
    ImageDeleteResult imageDeleteResult = response.getResult();
    
    System.out.println(imageDeleteResult);

Response

Status Code

  • Success

  • A required header is missing. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • You do not have authorization to access the specified namespace.

  • The specified image was not found. Check the spelling of the specified image.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "Untagged": "sha256:b44b210e565c7871aed1c1155527ca0782be82153f9ebe12786e7b992151dddd"
    }
  • {
      "Untagged": "sha256:b44b210e565c7871aed1c1155527ca0782be82153f9ebe12786e7b992151dddd"
    }

Inspect an image

Inspect a container image in the private registry.

Inspect a container image in the private registry.

Inspect a container image in the private registry.

Inspect a container image in the private registry.

Inspect a container image in the private registry.

GET /api/v1/images/{image}/json
(containerRegistry *ContainerRegistryV1) InspectImage(inspectImageOptions *InspectImageOptions) (result *ImageInspection, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) InspectImageWithContext(ctx context.Context, inspectImageOptions *InspectImageOptions) (result *ImageInspection, response *core.DetailedResponse, err error)
inspectImage(params)
inspect_image(self,
        image: str,
        **kwargs
    ) -> DetailedResponse
ServiceCall<ImageInspection> inspectImage(InspectImageOptions inspectImageOptions)

Request

Instantiate the InspectImageOptions struct and set the fields to provide parameter values for the InspectImage method.

Use the InspectImageOptions.Builder to create a InspectImageOptions object that contains the parameter values for the inspectImage method.

Custom Headers

  • The unique ID for your IBM Cloud account.

Path Parameters

  • The full IBM Cloud registry path to the image that you want to inspect. Run ibmcloud cr images or call the GET /images/json endpoint to review images that are in the registry.

WithContext method only

The InspectImage options.

parameters

  • The unique ID for your IBM Cloud account.

  • The full IBM Cloud registry path to the image that you want to inspect. Run ibmcloud cr images or call the GET /images/json endpoint to review images that are in the registry.

parameters

  • The unique ID for your IBM Cloud account.

  • The full IBM Cloud registry path to the image that you want to inspect. Run ibmcloud cr images or call the GET /images/json endpoint to review images that are in the registry.

The inspectImage options.

  • curl -X GET   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -H "accept: application/json"   --url 'https://us.icr.io/api/v1/images/us.icr.io%2Fbirds%2Fwoodpecker%3Agreen/json' 
    
  • inspectImageOptions := containerRegistryService.NewInspectImageOptions(
      "image name",
    )
    
    imageInspection, response, err := containerRegistryService.InspectImage(inspectImageOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(imageInspection, "", "  ")
    fmt.Println(string(b))
  • const params = {
      image: 'image name',
    };
    
    containerRegistryService.inspectImage(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • image_inspection = container_registry_service.inspect_image(
      image='image name'
    ).get_result()
    
    print(json.dumps(image_inspection, indent=2))
  • InspectImageOptions inspectImageOptions = new InspectImageOptions.Builder()
      .image("image name")
      .build();
    
    Response<ImageInspection> response = service.inspectImage(inspectImageOptions).execute();
    ImageInspection imageInspection = response.getResult();
    
    System.out.println(imageInspection);

Response

An image JSON output consistent with the Docker Remote API

An image JSON output consistent with the Docker Remote API.

An image JSON output consistent with the Docker Remote API.

An image JSON output consistent with the Docker Remote API.

An image JSON output consistent with the Docker Remote API.

Status Code

  • Success

  • A required header is missing. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • You do not have authorization to access the specified namespace.

  • The specified image was not found. Check the spelling of the specified image.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "Id": "sha256:11106fafa8005fdcf4641634220afe7bda9e6d86136d0c47902ff17d3324aaaa",
      "Parent": "",
      "Comment": "",
      "Created": "2020-05-05T09:58:15.763923649Z",
      "Container": "3a23849e2c3e754193c5148caa67ce83cd05541d162b05e39a02cdf9261cbbbb",
      "ContainerConfig": {
        "Hostname": "3a23849ecccc",
        "Domainname": "",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": false,
        "AttachStderr": false,
        "ExposedPorts": {
          "1234/tcp": {},
          "5678/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
          "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
          "/bin/sh",
          "-c",
          "#(nop) ",
          "LABEL key=value"
        ],
        "Image": "sha256:b44b210e565c7871aed1c1155527ca0782be82153f9ebe12786e7b992151dddd",
        "Volumes": {
          "/etc/apache2": {},
          "/var/log/apache2": {},
          "/var/www": {}
        },
        "WorkingDir": "",
        "Entrypoint": [
          "/usr/sbin/somecmd",
          "-D",
          "FOREGROUND"
        ],
        "OnBuild": [
          "RUN echo example"
        ],
        "Labels": {
          "key": "value"
        }
      },
      "DockerVersion": "19.03.5",
      "Author": "",
      "Config": {
        "Hostname": "",
        "Domainname": "",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": false,
        "AttachStderr": false,
        "ExposedPorts": {
          "1234/tcp": {},
          "5678/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
          "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Image": "sha256:b44b210e565c7871aed1c1155527ca0782be82153f9ebe12786e7b992151dddd",
        "Volumes": {
          "/etc/apache2": {},
          "/var/log/apache2": {},
          "/var/www": {}
        },
        "WorkingDir": "",
        "Entrypoint": [
          "/usr/sbin/somecmd",
          "-D",
          "FOREGROUND"
        ],
        "OnBuild": [
          "RUN echo example"
        ],
        "Labels": {
          "key": "value"
        }
      },
      "Architecture": "amd64",
      "Os": "linux",
      "Size": 760854,
      "VirtualSize": 760854,
      "RootFS": {
        "Type": "layers",
        "Layers": [
          "sha256:5b0d2d635df829f65d0ffb45eab2c3124a470c4f385d6602bda0c21c5248eeee"
        ]
      },
      "ManifestType": "application/vnd.docker.distribution.manifest.v2+json"
    }
  • {
      "Id": "sha256:11106fafa8005fdcf4641634220afe7bda9e6d86136d0c47902ff17d3324aaaa",
      "Parent": "",
      "Comment": "",
      "Created": "2020-05-05T09:58:15.763923649Z",
      "Container": "3a23849e2c3e754193c5148caa67ce83cd05541d162b05e39a02cdf9261cbbbb",
      "ContainerConfig": {
        "Hostname": "3a23849ecccc",
        "Domainname": "",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": false,
        "AttachStderr": false,
        "ExposedPorts": {
          "1234/tcp": {},
          "5678/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
          "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
          "/bin/sh",
          "-c",
          "#(nop) ",
          "LABEL key=value"
        ],
        "Image": "sha256:b44b210e565c7871aed1c1155527ca0782be82153f9ebe12786e7b992151dddd",
        "Volumes": {
          "/etc/apache2": {},
          "/var/log/apache2": {},
          "/var/www": {}
        },
        "WorkingDir": "",
        "Entrypoint": [
          "/usr/sbin/somecmd",
          "-D",
          "FOREGROUND"
        ],
        "OnBuild": [
          "RUN echo example"
        ],
        "Labels": {
          "key": "value"
        }
      },
      "DockerVersion": "19.03.5",
      "Author": "",
      "Config": {
        "Hostname": "",
        "Domainname": "",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": false,
        "AttachStderr": false,
        "ExposedPorts": {
          "1234/tcp": {},
          "5678/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
          "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Image": "sha256:b44b210e565c7871aed1c1155527ca0782be82153f9ebe12786e7b992151dddd",
        "Volumes": {
          "/etc/apache2": {},
          "/var/log/apache2": {},
          "/var/www": {}
        },
        "WorkingDir": "",
        "Entrypoint": [
          "/usr/sbin/somecmd",
          "-D",
          "FOREGROUND"
        ],
        "OnBuild": [
          "RUN echo example"
        ],
        "Labels": {
          "key": "value"
        }
      },
      "Architecture": "amd64",
      "Os": "linux",
      "Size": 760854,
      "VirtualSize": 760854,
      "RootFS": {
        "Type": "layers",
        "Layers": [
          "sha256:5b0d2d635df829f65d0ffb45eab2c3124a470c4f385d6602bda0c21c5248eeee"
        ]
      },
      "ManifestType": "application/vnd.docker.distribution.manifest.v2+json"
    }

Get image manifest

Get the manifest for a container image in the private registry.

Get the manifest for a container image in the private registry.

Get the manifest for a container image in the private registry.

Get the manifest for a container image in the private registry.

Get the manifest for a container image in the private registry.

GET /api/v1/images/{image}/manifest
(containerRegistry *ContainerRegistryV1) GetImageManifest(getImageManifestOptions *GetImageManifestOptions) (result map[string]interface{}, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) GetImageManifestWithContext(ctx context.Context, getImageManifestOptions *GetImageManifestOptions) (result map[string]interface{}, response *core.DetailedResponse, err error)
getImageManifest(params)
get_image_manifest(self,
        image: str,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Map<String, Object>> getImageManifest(GetImageManifestOptions getImageManifestOptions)

Request

Instantiate the GetImageManifestOptions struct and set the fields to provide parameter values for the GetImageManifest method.

Use the GetImageManifestOptions.Builder to create a GetImageManifestOptions object that contains the parameter values for the getImageManifest method.

Custom Headers

  • The unique ID for your IBM Cloud account.

Path Parameters

  • The full IBM Cloud registry path to the image that you want to inspect. Run ibmcloud cr images or call the GET /images/json endpoint to review images that are in the registry.

WithContext method only

The GetImageManifest options.

parameters

  • The unique ID for your IBM Cloud account.

  • The full IBM Cloud registry path to the image that you want to inspect. Run ibmcloud cr images or call the GET /images/json endpoint to review images that are in the registry.

parameters

  • The unique ID for your IBM Cloud account.

  • The full IBM Cloud registry path to the image that you want to inspect. Run ibmcloud cr images or call the GET /images/json endpoint to review images that are in the registry.

The getImageManifest options.

  • curl -X GET   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -H "accept: application/json"   --url 'https://us.icr.io/api/v1/images/us.icr.io%2Fbirds%2Fwoodpecker%3Agreen/manifest' 
    
  • getImageManifestOptions := containerRegistryService.NewGetImageManifestOptions(
      "image name",
    )
    
    result, response, err := containerRegistryService.GetImageManifest(getImageManifestOptions)
    if err != nil {
      panic(err)
    }
    // result contains a map[string]interface{} representation of the manifest
    // The following test will simply check that it is a V2 manifest
    Expect(result["schemaVersion"]).To(Equal(float64(2)))
  • const params = {
      image: 'image name',
    };
    
    containerRegistryService.getImageManifest(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • response = container_registry_service.get_image_manifest(
      image='image name'
    ).get_result()
    
    print(json.dumps(response, indent=2))
  • GetImageManifestOptions getImageManifestOptions = new GetImageManifestOptions.Builder()
      .image("image name")
      .build();
    
    Response<Map<String, Object>> response = service.getImageManifest(getImageManifestOptions).execute();
    Map<String, Object> imageManifest = response.getResult();
    
    System.out.println(imageManifest);

Response

Response type: map[string]interface{}

Response type: JsonObject

Response type: dict

Response type: Map<String, Object>

A container image manifest in JSON format. Check the Content-Type response header for the manifest type.

Status Code

  • Success

  • A required header is missing. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • You do not have authorization to access the specified namespace.

  • The specified image was not found. Check the spelling of the specified image.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "schemaVersion": 2,
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "config": {
        "mediaType": "application/vnd.docker.container.image.v1+json",
        "size": 2297,
        "digest": "sha256:11106fafa8005fdcf4641634220afe7bda9e6d86136d0c47902ff17d3324aaaa"
      },
      "layers": [
        {
          "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
          "size": 760854,
          "digest": "sha256:e2334dd9fee4b77e48a8f2d793904118a3acf26f1f2e72a3d79c6cae993ebbbb"
        }
      ]
    }
  • {
      "schemaVersion": 2,
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "config": {
        "mediaType": "application/vnd.docker.container.image.v1+json",
        "size": 2297,
        "digest": "sha256:11106fafa8005fdcf4641634220afe7bda9e6d86136d0c47902ff17d3324aaaa"
      },
      "layers": [
        {
          "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
          "size": 760854,
          "digest": "sha256:e2334dd9fee4b77e48a8f2d793904118a3acf26f1f2e72a3d79c6cae993ebbbb"
        }
      ]
    }

Get messages

Return any published system messages.

Return any published system messages.

Return any published system messages.

Return any published system messages.

Return any published system messages.

GET /api/v1/messages
(containerRegistry *ContainerRegistryV1) GetMessages(getMessagesOptions *GetMessagesOptions) (result *string, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) GetMessagesWithContext(ctx context.Context, getMessagesOptions *GetMessagesOptions) (result *string, response *core.DetailedResponse, err error)
getMessages(params)
get_messages(self,
        **kwargs
    ) -> DetailedResponse
ServiceCall<String> getMessages()

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET   --url 'https://icr.io/api/v1/messages' 
    
  • getMessagesOptions := containerRegistryService.NewGetMessagesOptions()
    
    getMessagesResponse, response, err := containerRegistryService.GetMessages(getMessagesOptions)
    if err != nil {
      panic(err)
    }
    if getMessagesResponse != nil {
      b, _ := json.MarshalIndent(getMessagesResponse, "", "  ")
      fmt.Println(string(b))
    }
  • containerRegistryService.getMessages({})
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • get_messages_response = container_registry_service.get_messages().get_result()
    
    print(json.dumps(get_messages_response, indent=2))
  • GetMessagesOptions getMessagesOptions = new GetMessagesOptions();
    
    Response<String> response = service.getMessages(getMessagesOptions).execute();
    String getMessagesResponse = response.getResult();
    
    System.out.println(getMessagesResponse);

Response

Response type: string

Response type: string

Response type: str

Response type: String

Status Code

  • Success.

  • There are no messages to display.

  • A required header is missing. Correct the request and try again.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • Hello, world!
  • Hello, world!

List namespaces

List authorized namespaces in the targeted IBM Cloud account.

List authorized namespaces in the targeted IBM Cloud account.

List authorized namespaces in the targeted IBM Cloud account.

List authorized namespaces in the targeted IBM Cloud account.

List authorized namespaces in the targeted IBM Cloud account.

GET /api/v1/namespaces
(containerRegistry *ContainerRegistryV1) ListNamespaces(listNamespacesOptions *ListNamespacesOptions) (result []string, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) ListNamespacesWithContext(ctx context.Context, listNamespacesOptions *ListNamespacesOptions) (result []string, response *core.DetailedResponse, err error)
listNamespaces(params)
list_namespaces(self,
        **kwargs
    ) -> DetailedResponse
ServiceCall<List<String>> listNamespaces(ListNamespacesOptions listNamespacesOptions)

Request

Instantiate the ListNamespacesOptions struct and set the fields to provide parameter values for the ListNamespaces method.

Use the ListNamespacesOptions.Builder to create a ListNamespacesOptions object that contains the parameter values for the listNamespaces method.

Custom Headers

  • The unique ID for your IBM Cloud account.

WithContext method only

parameters

  • The unique ID for your IBM Cloud account.

parameters

  • The unique ID for your IBM Cloud account.

  • curl -X GET   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   --url 'https://us.icr.io/api/v1/namespaces' 
    
  • listNamespacesOptions := containerRegistryService.NewListNamespacesOptions()
    
    result, response, err := containerRegistryService.ListNamespaces(listNamespacesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(result, "", "  ")
    fmt.Println(string(b))
  • containerRegistryService.listNamespaces({})
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • result = container_registry_service.list_namespaces().get_result()
    
    print(json.dumps(result, indent=2))
  • ListNamespacesOptions listNamespacesOptions = new ListNamespacesOptions();
    
    Response<List<String>> response = service.listNamespaces(listNamespacesOptions).execute();
    List<String> result = response.getResult();
    
    System.out.println(result);

Response

Response type: []string

Response type: string[]

Response type: List[str]

Response type: List<String>

A list of authorized namespaces in the targeted IBM Cloud account

Status Code

  • Success

  • A required header is missing. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • [
      "birds",
      "favouritebirds"
    ]
  • [
      "birds",
      "favouritebirds"
    ]

Detailed namespace list

Retrieves details, such as resource group, for all your namespaces in the targeted registry.

Retrieves details, such as resource group, for all your namespaces in the targeted registry.

Retrieves details, such as resource group, for all your namespaces in the targeted registry.

Retrieves details, such as resource group, for all your namespaces in the targeted registry.

Retrieves details, such as resource group, for all your namespaces in the targeted registry.

GET /api/v1/namespaces/details
(containerRegistry *ContainerRegistryV1) ListNamespaceDetails(listNamespaceDetailsOptions *ListNamespaceDetailsOptions) (result []NamespaceDetails, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) ListNamespaceDetailsWithContext(ctx context.Context, listNamespaceDetailsOptions *ListNamespaceDetailsOptions) (result []NamespaceDetails, response *core.DetailedResponse, err error)
listNamespaceDetails(params)
list_namespace_details(self,
        **kwargs
    ) -> DetailedResponse
ServiceCall<List<NamespaceDetails>> listNamespaceDetails(ListNamespaceDetailsOptions listNamespaceDetailsOptions)

Request

Instantiate the ListNamespaceDetailsOptions struct and set the fields to provide parameter values for the ListNamespaceDetails method.

Use the ListNamespaceDetailsOptions.Builder to create a ListNamespaceDetailsOptions object that contains the parameter values for the listNamespaceDetails method.

Custom Headers

  • The unique ID for your IBM Cloud account.

WithContext method only

parameters

  • The unique ID for your IBM Cloud account.

parameters

  • The unique ID for your IBM Cloud account.

  • curl -X GET   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   --url 'https://us.icr.io/api/v1/namespaces/details' 
    
  • listNamespaceDetailsOptions := containerRegistryService.NewListNamespaceDetailsOptions()
    
    namespaceDetail, response, err := containerRegistryService.ListNamespaceDetails(listNamespaceDetailsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(namespaceDetail, "", "  ")
    fmt.Println(string(b))
  • containerRegistryService.listNamespaceDetails({})
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • list_namespace_details = container_registry_service.list_namespace_details().get_result()
    
    print(json.dumps(list_namespace_details, indent=2))
  • ListNamespaceDetailsOptions listNamespaceDetailsOptions = new ListNamespaceDetailsOptions();
    
    Response<List<NamespaceDetails>> response = service.listNamespaceDetails(listNamespaceDetailsOptions).execute();
    List<NamespaceDetails> listNamespaceDetails = response.getResult();
    
    System.out.println(listNamespaceDetails);

Response

Response type: []NamespaceDetails

Response type: NamespaceDetails[]

Response type: List[NamespaceDetails]

Response type: List<NamespaceDetails>

Details of authorized namespaces in the targeted IBM Cloud account

Status Code

  • Success

  • A required header is missing. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • [
      {
        "name": "birds",
        "account": "79c6d1c71fb1cbedc38ffc251ba2ffff",
        "created_date": "2020-07-03 08:49:37",
        "updated_date": "2020-07-03 08:49:37"
      },
      {
        "name": "favouritebirds",
        "account": "79c6d1c71fb1cbedc38ffc251ba2ffff",
        "crn": "crn:v1:bluemix:public:container-registry:us-south:a/79c6d1c71fb1cbedc38ffc251ba2ffff::namespace:favouritebirds",
        "resource_group": "c9cbad60c221eb1add958e1b14dcaaaa",
        "resource_created_date": "2020-06-05 12:59:00",
        "created_date": "2020-05-07 12:49:56",
        "updated_date": "2020-06-05 12:59:00"
      }
    ]
  • [
      {
        "name": "birds",
        "account": "79c6d1c71fb1cbedc38ffc251ba2ffff",
        "created_date": "2020-07-03 08:49:37",
        "updated_date": "2020-07-03 08:49:37"
      },
      {
        "name": "favouritebirds",
        "account": "79c6d1c71fb1cbedc38ffc251ba2ffff",
        "crn": "crn:v1:bluemix:public:container-registry:us-south:a/79c6d1c71fb1cbedc38ffc251ba2ffff::namespace:favouritebirds",
        "resource_group": "c9cbad60c221eb1add958e1b14dcaaaa",
        "resource_created_date": "2020-06-05 12:59:00",
        "created_date": "2020-05-07 12:49:56",
        "updated_date": "2020-06-05 12:59:00"
      }
    ]

Create namespace

Add a namespace to the targeted IBM Cloud account.

Add a namespace to the targeted IBM Cloud account.

Add a namespace to the targeted IBM Cloud account.

Add a namespace to the targeted IBM Cloud account.

Add a namespace to the targeted IBM Cloud account.

PUT /api/v1/namespaces/{name}
(containerRegistry *ContainerRegistryV1) CreateNamespace(createNamespaceOptions *CreateNamespaceOptions) (result *Namespace, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) CreateNamespaceWithContext(ctx context.Context, createNamespaceOptions *CreateNamespaceOptions) (result *Namespace, response *core.DetailedResponse, err error)
createNamespace(params)
create_namespace(self,
        name: str,
        *,
        x_auth_resource_group: str = None,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Namespace> createNamespace(CreateNamespaceOptions createNamespaceOptions)

Request

Instantiate the CreateNamespaceOptions struct and set the fields to provide parameter values for the CreateNamespace method.

Use the CreateNamespaceOptions.Builder to create a CreateNamespaceOptions object that contains the parameter values for the createNamespace method.

Custom Headers

  • The unique ID for your IBM Cloud account.

  • The ID of the resource group that the namespace will be created within.

Path Parameters

  • The name of the namespace.

    Possible values: 4 ≤ length ≤ 30, Value must match regular expression ^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$

WithContext method only

The CreateNamespace options.

parameters

  • The unique ID for your IBM Cloud account.

  • The name of the namespace.

    Possible values: 4 ≤ length ≤ 30, Value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/

  • The ID of the resource group that the namespace will be created within.

parameters

  • The unique ID for your IBM Cloud account.

  • The name of the namespace.

    Possible values: 4 ≤ length ≤ 30, Value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/

  • The ID of the resource group that the namespace will be created within.

The createNamespace options.

  • curl -X PUT   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -H "X-Auth-Resource-Group: <resource_group_ID>"   --url 'https://us.icr.io/api/v1/namespaces/birds' 
    
  • createNamespaceOptions := containerRegistryService.NewCreateNamespaceOptions(
      "my_example_namespace",
    )
    
    namespace, response, err := containerRegistryService.CreateNamespace(createNamespaceOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(namespace, "", "  ")
    fmt.Println(string(b))
  • const params = {
      name: 'my_example_namespace',
    };
    
    containerRegistryService.createNamespace(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • namespace = container_registry_service.create_namespace(
      name='my_example_namespace'
    ).get_result()
    
    print(json.dumps(namespace, indent=2))
  • CreateNamespaceOptions createNamespaceOptions = new CreateNamespaceOptions.Builder()
      .name("my_example_namespace")
      .build();
    
    Response<Namespace> response = service.createNamespace(createNamespaceOptions).execute();
    Namespace namespace = response.getResult();
    
    System.out.println(namespace);

Response

Status Code

  • The namespace is already assigned to your IBM Cloud account.

  • The namespace was successfully added to your IBM Cloud account.

  • A required header is missing or invalid. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • The requested namespace is blocklisted. Correct the request and try again.

  • The requested namespace is already in use. Request a different namespace.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "namespace": "birds"
    }
  • {
      "namespace": "birds"
    }
  • {
      "namespace": "birds"
    }
  • {
      "namespace": "birds"
    }

Assign namespace

Assign a namespace to the specified resource group in the targeted IBM Cloud account.

Assign a namespace to the specified resource group in the targeted IBM Cloud account.

Assign a namespace to the specified resource group in the targeted IBM Cloud account.

Assign a namespace to the specified resource group in the targeted IBM Cloud account.

Assign a namespace to the specified resource group in the targeted IBM Cloud account.

PATCH /api/v1/namespaces/{name}
(containerRegistry *ContainerRegistryV1) AssignNamespace(assignNamespaceOptions *AssignNamespaceOptions) (result *Namespace, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) AssignNamespaceWithContext(ctx context.Context, assignNamespaceOptions *AssignNamespaceOptions) (result *Namespace, response *core.DetailedResponse, err error)
assignNamespace(params)
assign_namespace(self,
        x_auth_resource_group: str,
        name: str,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Namespace> assignNamespace(AssignNamespaceOptions assignNamespaceOptions)

Request

Instantiate the AssignNamespaceOptions struct and set the fields to provide parameter values for the AssignNamespace method.

Use the AssignNamespaceOptions.Builder to create a AssignNamespaceOptions object that contains the parameter values for the assignNamespace method.

Custom Headers

  • The unique ID for your IBM Cloud account.

  • The ID of the resource group that the namespace will be created within.

Path Parameters

  • The name of the namespace to be updated.

WithContext method only

The AssignNamespace options.

parameters

  • The unique ID for your IBM Cloud account.

  • The ID of the resource group that the namespace will be created within.

  • The name of the namespace to be updated.

parameters

  • The unique ID for your IBM Cloud account.

  • The ID of the resource group that the namespace will be created within.

  • The name of the namespace to be updated.

The assignNamespace options.

  • curl -X PATCH   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -H "X-Auth-Resource-Group: <resource_group_ID>"   --url 'https://us.icr.io/api/v1/namespaces/birds' 
    
  • assignNamespaceOptions := containerRegistryService.NewAssignNamespaceOptions(
      "Resource Group ID",
      namespaceLink,
    )
    
    namespace, response, err := containerRegistryService.AssignNamespace(assignNamespaceOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(namespace, "", "  ")
    fmt.Println(string(b))
  • const params = {
      xAuthResourceGroup: 'Resource Group ID',
      name: namespaceLink,
    };
    
    containerRegistryService.assignNamespace(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • namespace = container_registry_service.assign_namespace(
      x_auth_resource_group='Resource Group ID',
      name=namespace_link
    ).get_result()
    
    print(json.dumps(namespace, indent=2))
  • AssignNamespaceOptions assignNamespaceOptions = new AssignNamespaceOptions.Builder()
      .xAuthResourceGroup("Resource Group ID")
      .name(namespaceLink)
      .build();
    
    Response<Namespace> response = service.assignNamespace(assignNamespaceOptions).execute();
    Namespace namespace = response.getResult();
    
    System.out.println(namespace);

Response

Status Code

  • The namespace was successfully assigned to the resource group.

  • A required header is missing or invalid. Correct the request and try again.

  • You are not authorized to view the requested resource, or your IBM Cloud bearer token is invalid. Correct the request and try again.

  • The requested account does not own a namespace with the requested name. Correct the request and try again.

  • The requested namespace is already assigned to a resource group. Namespaces cannot be reassigned.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "namespace": "birds"
    }
  • {
      "namespace": "birds"
    }

Delete namespace

Delete the IBM Cloud Container Registry namespace from the targeted IBM Cloud account, and removes all images that were in that namespace.

Delete the IBM Cloud Container Registry namespace from the targeted IBM Cloud account, and removes all images that were in that namespace.

Delete the IBM Cloud Container Registry namespace from the targeted IBM Cloud account, and removes all images that were in that namespace.

Delete the IBM Cloud Container Registry namespace from the targeted IBM Cloud account, and removes all images that were in that namespace.

Delete the IBM Cloud Container Registry namespace from the targeted IBM Cloud account, and removes all images that were in that namespace.

DELETE /api/v1/namespaces/{name}
(containerRegistry *ContainerRegistryV1) DeleteNamespace(deleteNamespaceOptions *DeleteNamespaceOptions) (response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) DeleteNamespaceWithContext(ctx context.Context, deleteNamespaceOptions *DeleteNamespaceOptions) (response *core.DetailedResponse, err error)
deleteNamespace(params)
delete_namespace(self,
        name: str,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Void> deleteNamespace(DeleteNamespaceOptions deleteNamespaceOptions)

Request

Instantiate the DeleteNamespaceOptions struct and set the fields to provide parameter values for the DeleteNamespace method.

Use the DeleteNamespaceOptions.Builder to create a DeleteNamespaceOptions object that contains the parameter values for the deleteNamespace method.

Custom Headers

  • The unique ID for your IBM Cloud account.

Path Parameters

  • The name of the namespace that you want to delete.

WithContext method only

The DeleteNamespace options.

parameters

  • The unique ID for your IBM Cloud account.

  • The name of the namespace that you want to delete.

parameters

  • The unique ID for your IBM Cloud account.

  • The name of the namespace that you want to delete.

The deleteNamespace options.

  • curl -X DELETE   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   --url 'https://us.icr.io/api/v1/namespaces/birds' 
    
  • deleteNamespaceOptions := containerRegistryService.NewDeleteNamespaceOptions(
      namespaceLink,
    )
    
    response, err := containerRegistryService.DeleteNamespace(deleteNamespaceOptions)
    if err != nil {
      panic(err)
    }
  • const params = {
      name: namespaceLink,
    };
    
    containerRegistryService.deleteNamespace(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • response = container_registry_service.delete_namespace(
      name=namespace_link
    ).get_result()
    
    print(json.dumps(response, indent=2))
  • DeleteNamespaceOptions deleteNamespaceOptions = new DeleteNamespaceOptions.Builder()
      .name(namespaceLink)
      .build();
    
    service.deleteNamespace(deleteNamespaceOptions).execute();

Response

Status Code

  • Success.

  • A required header is missing. Correct the request and try again.

  • Your IBM Cloud bearer token is not valid for the targeted account. Correct the request and try again.

  • The specified namespace is not owned by the targeted account.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

No Sample Response

This method does not specify any sample responses.

Get plans

Get plans for the targeted account.

Get plans for the targeted account.

Get plans for the targeted account.

Get plans for the targeted account.

Get plans for the targeted account.

GET /api/v1/plans
(containerRegistry *ContainerRegistryV1) GetPlans(getPlansOptions *GetPlansOptions) (result *Plan, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) GetPlansWithContext(ctx context.Context, getPlansOptions *GetPlansOptions) (result *Plan, response *core.DetailedResponse, err error)
getPlans(params)
get_plans(self,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Plan> getPlans(GetPlansOptions getPlansOptions)

Request

Instantiate the GetPlansOptions struct and set the fields to provide parameter values for the GetPlans method.

Use the GetPlansOptions.Builder to create a GetPlansOptions object that contains the parameter values for the getPlans method.

Custom Headers

  • The unique ID for your IBM Cloud account.

WithContext method only

parameters

  • The unique ID for your IBM Cloud account.

parameters

  • The unique ID for your IBM Cloud account.

  • curl -X GET   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   --url 'https://us.icr.io/api/v1/plans' 
    
  • getPlansOptions := containerRegistryService.NewGetPlansOptions()
    
    plan, response, err := containerRegistryService.GetPlans(getPlansOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(plan, "", "  ")
    fmt.Println(string(b))
  • containerRegistryService.getPlans({})
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • plan = container_registry_service.get_plans().get_result()
    
    print(json.dumps(plan, indent=2))
  • GetPlansOptions getPlansOptions = new GetPlansOptions();
    
    Response<Plan> response = service.getPlans(getPlansOptions).execute();
    Plan plan = response.getResult();
    
    System.out.println(plan);

Response

The plan for the targeted IBM Cloud account

The plan for the targeted IBM Cloud account.

The plan for the targeted IBM Cloud account.

The plan for the targeted IBM Cloud account.

The plan for the targeted IBM Cloud account.

Status Code

  • Success.

  • A required header is missing. Correct the request and try again.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "plan": "Free"
    }
  • {
      "plan": "Free"
    }

Update plans

Update plans for the targeted account.

Update plans for the targeted account.

Update plans for the targeted account.

Update plans for the targeted account.

Update plans for the targeted account.

PATCH /api/v1/plans
(containerRegistry *ContainerRegistryV1) UpdatePlans(updatePlansOptions *UpdatePlansOptions) (response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) UpdatePlansWithContext(ctx context.Context, updatePlansOptions *UpdatePlansOptions) (response *core.DetailedResponse, err error)
updatePlans(params)
update_plans(self,
        *,
        plan: str = None,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Void> updatePlans(UpdatePlansOptions updatePlansOptions)

Request

Instantiate the UpdatePlansOptions struct and set the fields to provide parameter values for the UpdatePlans method.

Use the UpdatePlansOptions.Builder to create a UpdatePlansOptions object that contains the parameter values for the updatePlans method.

Custom Headers

  • The unique ID for your IBM Cloud account.

A JSON document containing the requested updates.

Examples:
View

WithContext method only

The UpdatePlans options.

parameters

  • The unique ID for your IBM Cloud account.

  • Examples:
    value
    _source
    _lines
    _html

parameters

  • The unique ID for your IBM Cloud account.

  • Examples:
    value
    _source
    _lines
    _html

The updatePlans options.

  • curl -X PATCH   -H "Content-Type: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -d "{\"plan\":\"Standard\"}"   --url 'https://us.icr.io/api/v1/plans' 
    
  • updatePlansOptions := containerRegistryService.NewUpdatePlansOptions()
    updatePlansOptions.SetPlan("Standard")
    
    response, err := containerRegistryService.UpdatePlans(updatePlansOptions)
    if err != nil {
      panic(err)
    }
  • const params = {
      plan: 'Standard',
    };
    
    containerRegistryService.updatePlans(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • response = container_registry_service.update_plans(
      plan='Standard'
    ).get_result()
    
    print(json.dumps(response, indent=2))
  • UpdatePlansOptions updatePlansOptions = new UpdatePlansOptions.Builder()
      .plan("Standard")
      .build();
    
    service.updatePlans(updatePlansOptions).execute();

Response

Status Code

  • Success.

  • A required header is missing. Correct the request and try again.

  • You do not have access to perform the requested operation. You must have either Manager or Billing Manager roles on the targeted account to perform this action.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

No Sample Response

This method does not specify any sample responses.

Get quotas

Get quotas for the targeted account.

Get quotas for the targeted account.

Get quotas for the targeted account.

Get quotas for the targeted account.

Get quotas for the targeted account.

GET /api/v1/quotas
(containerRegistry *ContainerRegistryV1) GetQuota(getQuotaOptions *GetQuotaOptions) (result *Quota, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) GetQuotaWithContext(ctx context.Context, getQuotaOptions *GetQuotaOptions) (result *Quota, response *core.DetailedResponse, err error)
getQuota(params)
get_quota(self,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Quota> getQuota(GetQuotaOptions getQuotaOptions)

Request

Instantiate the GetQuotaOptions struct and set the fields to provide parameter values for the GetQuota method.

Use the GetQuotaOptions.Builder to create a GetQuotaOptions object that contains the parameter values for the getQuota method.

Custom Headers

  • The unique ID for your IBM Cloud account.

WithContext method only

parameters

  • The unique ID for your IBM Cloud account.

parameters

  • The unique ID for your IBM Cloud account.

  • curl -X GET   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   --url 'https://us.icr.io/api/v1/quotas' 
    
  • getQuotaOptions := containerRegistryService.NewGetQuotaOptions()
    
    quota, response, err := containerRegistryService.GetQuota(getQuotaOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(quota, "", "  ")
    fmt.Println(string(b))
  • containerRegistryService.getQuota({})
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • quota = container_registry_service.get_quota().get_result()
    
    print(json.dumps(quota, indent=2))
  • GetQuotaOptions getQuotaOptions = new GetQuotaOptions();
    
    Response<Quota> response = service.getQuota(getQuotaOptions).execute();
    Quota quota = response.getResult();
    
    System.out.println(quota);

Response

Current usage and limits for the targeted IBM Cloud account.

Current usage and limits for the targeted IBM Cloud account.

Current usage and limits for the targeted IBM Cloud account.

Current usage and limits for the targeted IBM Cloud account.

Current usage and limits for the targeted IBM Cloud account.

Status Code

  • Success.

  • A required header is missing. Correct the request and try again.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "usage": {
        "storage_bytes": 760984
      },
      "limit": {
        "traffic_bytes": 5368709120,
        "storage_bytes": 524288000
      }
    }
  • {
      "usage": {
        "storage_bytes": 760984
      },
      "limit": {
        "traffic_bytes": 5368709120,
        "storage_bytes": 524288000
      }
    }

Update quotas

Update quotas for the targeted account.

Update quotas for the targeted account.

Update quotas for the targeted account.

Update quotas for the targeted account.

Update quotas for the targeted account.

PATCH /api/v1/quotas
(containerRegistry *ContainerRegistryV1) UpdateQuota(updateQuotaOptions *UpdateQuotaOptions) (response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) UpdateQuotaWithContext(ctx context.Context, updateQuotaOptions *UpdateQuotaOptions) (response *core.DetailedResponse, err error)
updateQuota(params)
update_quota(self,
        *,
        storage_megabytes: int = None,
        traffic_megabytes: int = None,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Void> updateQuota(UpdateQuotaOptions updateQuotaOptions)

Request

Instantiate the UpdateQuotaOptions struct and set the fields to provide parameter values for the UpdateQuota method.

Use the UpdateQuotaOptions.Builder to create a UpdateQuotaOptions object that contains the parameter values for the updateQuota method.

Custom Headers

  • The unique ID for your IBM Cloud account.

A JSON document containing the requested updates.

Examples:
View

WithContext method only

The UpdateQuota options.

parameters

  • The unique ID for your IBM Cloud account.

  • Storage quota in megabytes. The value -1 denotes "Unlimited".

  • Traffic quota in megabytes. The value -1 denotes "Unlimited".

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The unique ID for your IBM Cloud account.

  • Storage quota in megabytes. The value -1 denotes "Unlimited".

  • Traffic quota in megabytes. The value -1 denotes "Unlimited".

    Examples:
    value
    _source
    _lines
    _html

The updateQuota options.

  • curl -X PATCH   -H "Content-Type: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -d "{\"traffic_megabytes\":480}"   --url 'https://us.icr.io/api/v1/quotas' 
    
  • updateQuotaOptions := containerRegistryService.NewUpdateQuotaOptions()
    updateQuotaOptions.SetTrafficMegabytes(int64(480))
    
    response, err := containerRegistryService.UpdateQuota(updateQuotaOptions)
    if err != nil {
      panic(err)
    }
  • const params = {
      trafficMegabytes: 480,
    };
    
    containerRegistryService.updateQuota(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • response = container_registry_service.update_quota(
      traffic_megabytes=480
    ).get_result()
    
    print(json.dumps(response, indent=2))
  • UpdateQuotaOptions updateQuotaOptions = new UpdateQuotaOptions.Builder()
      .trafficMegabytes(Long.valueOf("480"))
      .build();
    
    service.updateQuota(updateQuotaOptions).execute();

Response

Status Code

  • Success.

  • A required header is missing or invalid. Correct the request and try again.

  • You do not have access to perform the requested operation. You must have either Manager or Billing Manager roles on the targeted account to perform this action.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

No Sample Response

This method does not specify any sample responses.

List retention policies

List retention policies for all namespaces in the targeted IBM Cloud account.

List retention policies for all namespaces in the targeted IBM Cloud account.

List retention policies for all namespaces in the targeted IBM Cloud account.

List retention policies for all namespaces in the targeted IBM Cloud account.

List retention policies for all namespaces in the targeted IBM Cloud account.

GET /api/v1/retentions
(containerRegistry *ContainerRegistryV1) ListRetentionPolicies(listRetentionPoliciesOptions *ListRetentionPoliciesOptions) (result map[string]RetentionPolicy, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) ListRetentionPoliciesWithContext(ctx context.Context, listRetentionPoliciesOptions *ListRetentionPoliciesOptions) (result map[string]RetentionPolicy, response *core.DetailedResponse, err error)
listRetentionPolicies(params)
list_retention_policies(self,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Map<String, RetentionPolicy>> listRetentionPolicies(ListRetentionPoliciesOptions listRetentionPoliciesOptions)

Request

Instantiate the ListRetentionPoliciesOptions struct and set the fields to provide parameter values for the ListRetentionPolicies method.

Use the ListRetentionPoliciesOptions.Builder to create a ListRetentionPoliciesOptions object that contains the parameter values for the listRetentionPolicies method.

Custom Headers

  • The unique ID for your IBM Cloud account.

WithContext method only

parameters

  • The unique ID for your IBM Cloud account.

parameters

  • The unique ID for your IBM Cloud account.

  • curl -X GET   -H "accept: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   --url 'https://us.icr.io/api/v1/retentions' 
    
  • listRetentionPoliciesOptions := containerRegistryService.NewListRetentionPoliciesOptions()
    
    mapStringRetentionPolicy, response, err := containerRegistryService.ListRetentionPolicies(listRetentionPoliciesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(mapStringRetentionPolicy, "", "  ")
    fmt.Println(string(b))
  • containerRegistryService.listRetentionPolicies({})
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • dict = container_registry_service.list_retention_policies().get_result()
    
    print(json.dumps(dict, indent=2))
  • ListRetentionPoliciesOptions listRetentionPoliciesOptions = new ListRetentionPoliciesOptions();
    
    Response<Map<String, RetentionPolicy>> response = service.listRetentionPolicies(listRetentionPoliciesOptions).execute();
    Map<String, RetentionPolicy> mapStringRetentionPolicy = response.getResult();
    
    System.out.println(mapStringRetentionPolicy);

Response

Response type: map[string]RetentionPolicy

Response type: JsonObject

Response type: dict

Response type: Map<String, RetentionPolicy>

A map of namespace names to retention policies

Status Code

  • Success.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

Example responses
  • {
      "birds": {
        "namespace": "birds",
        "account": "79c6d1c71fb1cbedc38ffc251ba2ffff",
        "images_per_repo": -1,
        "retain_untagged": true
      },
      "favouritebirds": {
        "namespace": "favouritebirds",
        "account": "79c6d1c71fb1cbedc38ffc251ba2ffff",
        "images_per_repo": 10,
        "retain_untagged": false
      }
    }
  • {
      "birds": {
        "namespace": "birds",
        "account": "79c6d1c71fb1cbedc38ffc251ba2ffff",
        "images_per_repo": -1,
        "retain_untagged": true
      },
      "favouritebirds": {
        "namespace": "favouritebirds",
        "account": "79c6d1c71fb1cbedc38ffc251ba2ffff",
        "images_per_repo": 10,
        "retain_untagged": false
      }
    }

Set retention policy

Set the retention policy for the specified namespace.

Set the retention policy for the specified namespace.

Set the retention policy for the specified namespace.

Set the retention policy for the specified namespace.

Set the retention policy for the specified namespace.

POST /api/v1/retentions
(containerRegistry *ContainerRegistryV1) SetRetentionPolicy(setRetentionPolicyOptions *SetRetentionPolicyOptions) (response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) SetRetentionPolicyWithContext(ctx context.Context, setRetentionPolicyOptions *SetRetentionPolicyOptions) (response *core.DetailedResponse, err error)
setRetentionPolicy(params)
set_retention_policy(self,
        namespace: str,
        *,
        images_per_repo: int = None,
        retain_untagged: bool = None,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Void> setRetentionPolicy(SetRetentionPolicyOptions setRetentionPolicyOptions)

Request

Instantiate the SetRetentionPolicyOptions struct and set the fields to provide parameter values for the SetRetentionPolicy method.

Use the SetRetentionPolicyOptions.Builder to create a SetRetentionPolicyOptions object that contains the parameter values for the setRetentionPolicy method.

Custom Headers

  • The unique ID for your IBM Cloud account.

The retention policy parameters to be applied to the namespace, as JSON.

Examples:
View

WithContext method only

The SetRetentionPolicy options.

parameters

  • The unique ID for your IBM Cloud account.

  • The namespace to which the retention policy is attached.

    Examples:
    value
    _source
    _lines
    _html
  • Determines how many images will be retained for each repository when the retention policy is executed. The value -1 denotes 'Unlimited' (all images are retained).

    Examples:
    value
    _source
    _lines
    _html
  • Determines if untagged images are retained when executing the retention policy. This is false by default meaning untagged images will be deleted when the policy is executed.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The unique ID for your IBM Cloud account.

  • The namespace to which the retention policy is attached.

    Examples:
    value
    _source
    _lines
    _html
  • Determines how many images will be retained for each repository when the retention policy is executed. The value -1 denotes 'Unlimited' (all images are retained).

    Examples:
    value
    _source
    _lines
    _html
  • Determines if untagged images are retained when executing the retention policy. This is false by default meaning untagged images will be deleted when the policy is executed.

    Examples:
    value
    _source
    _lines
    _html

The setRetentionPolicy options.

  • curl -X POST   -H "Content-Type: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -d "{\"namespace\":\"birds\",\"account\":\"79c6d1c71fb1cbedc38ffc251ba2ffff\",\"images_per_repo\":10,\"retain_untagged\":false}"   --url 'https://us.icr.io/api/v1/retentions' 
    
  • setRetentionPolicyOptions := containerRegistryService.NewSetRetentionPolicyOptions("birds")
    setRetentionPolicyOptions.SetImagesPerRepo(int64(10))
    setRetentionPolicyOptions.SetRetainUntagged(false)
    
    response, err := containerRegistryService.SetRetentionPolicy(setRetentionPolicyOptions)
    if err != nil {
      panic(err)
    }
  • const params = {
      namespace: namespaceLink,
      imagesPerRepo: 10,
      retainUntagged: false,
    };
    
    containerRegistryService.setRetentionPolicy(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • response = container_registry_service.set_retention_policy(
      namespace=namespace_link,
      images_per_repo=10,
      retain_untagged=False
    ).get_result()
    
    print(json.dumps(response, indent=2))
  • SetRetentionPolicyOptions setRetentionPolicyOptions = new SetRetentionPolicyOptions.Builder()
      .namespace(namespaceLink)
      .imagesPerRepo(Long.valueOf("10"))
      .retainUntagged(false)
      .build();
    
    service.setRetentionPolicy(setRetentionPolicyOptions).execute();

Response

Status Code

  • Success.

  • Supplied input was not valid. Correct the request and try again.

  • You do not have access to the specified namespace. Choose another namespace.

  • An internal server error occurred

  • Unable to authenticate with IBM Cloud. Try again later.

No Sample Response

This method does not specify any sample responses.

Analyze retention policy

Analyze a retention policy, and get a list of what would be deleted by it.

Analyze a retention policy, and get a list of what would be deleted by it.

Analyze a retention policy, and get a list of what would be deleted by it.

Analyze a retention policy, and get a list of what would be deleted by it.

Analyze a retention policy, and get a list of what would be deleted by it.

POST /api/v1/retentions/analyze
(containerRegistry *ContainerRegistryV1) AnalyzeRetentionPolicy(analyzeRetentionPolicyOptions *AnalyzeRetentionPolicyOptions) (result map[string][]string, response *core.DetailedResponse, err error)
(containerRegistry *ContainerRegistryV1) AnalyzeRetentionPolicyWithContext(ctx context.Context, analyzeRetentionPolicyOptions *AnalyzeRetentionPolicyOptions) (result map[string][]string, response *core.DetailedResponse, err error)
analyzeRetentionPolicy(params)
analyze_retention_policy(self,
        namespace: str,
        *,
        images_per_repo: int = None,
        retain_untagged: bool = None,
        **kwargs
    ) -> DetailedResponse
ServiceCall<Map<String, List<String>>> analyzeRetentionPolicy(AnalyzeRetentionPolicyOptions analyzeRetentionPolicyOptions)

Request

Instantiate the AnalyzeRetentionPolicyOptions struct and set the fields to provide parameter values for the AnalyzeRetentionPolicy method.

Use the AnalyzeRetentionPolicyOptions.Builder to create a AnalyzeRetentionPolicyOptions object that contains the parameter values for the analyzeRetentionPolicy method.

Custom Headers

  • The unique ID for your IBM Cloud account.

The retention policy parameters to be analyzed, as JSON.

Examples:
View

WithContext method only

The AnalyzeRetentionPolicy options.

parameters

  • The unique ID for your IBM Cloud account.

  • The namespace to which the retention policy is attached.

    Examples:
    value
    _source
    _lines
    _html
  • Determines how many images will be retained for each repository when the retention policy is executed. The value -1 denotes 'Unlimited' (all images are retained).

    Examples:
    value
    _source
    _lines
    _html
  • Determines if untagged images are retained when executing the retention policy. This is false by default meaning untagged images will be deleted when the policy is executed.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The unique ID for your IBM Cloud account.

  • The namespace to which the retention policy is attached.

    Examples:
    value
    _source
    _lines
    _html
  • Determines how many images will be retained for each repository when the retention policy is executed. The value -1 denotes 'Unlimited' (all images are retained).

    Examples:
    value
    _source
    _lines
    _html
  • Determines if untagged images are retained when executing the retention policy. This is false by default meaning untagged images will be deleted when the policy is executed.

    Examples:
    value
    _source
    _lines
    _html

The analyzeRetentionPolicy options.

  • curl -X POST   -H "Content-Type: application/json"   -H "Account: <account_ID>"   -H "Authorization: Bearer <bearer_token>"   -d "{\"namespace\":\"birds\",\"account\":\"79c6d1c71fb1cbedc38ffc251ba2ffff\",\"images_per_repo\":10,\"retain_untagged\":false}"   --url