bluemix.net – containers
Containers are virtual software objects that include all the elements that an app needs to run. A container has the benefits of resource isolation and allocation but is more portable and efficient than, for example, a virtual machine.
This documentation describes the IBM Containers API, which is based on the Docker Remote API. The API provides endpoints that you can use to create and manage your single containers and container groups in Bluemix. Endpoints are summarized under the following tags:
- Authentication: Retrieve and refresh your TLS certificates.
- Private Docker images registry: Create your own private Docker images registry in Bluemix by setting a namespace for your organization.
- Images: View, build, and push your images to your private Bluemix registry so you can use them with IBM Containers. You can also scan your container images with the Vulnerability Advisor against standard policies set by the organization manager and a database of known Ubuntu issues.
- Single Containers: Create and manage single containers in Bluemix. Use a single container to implement short-lived processes or to run simple tests as you develop an app or service. To make your single container available from the internet, review the
Public IP addressesendpoints. - Container Groups: Create and manage your container groups in Bluemix. A container group consists of multiple single containers that are all created from the same container image and as a consequence are configured in the same way. Container groups offer further options at no cost to make your app highly available. These options include in-built load balancing, auto-recovery of unhealthy container instances, and auto-scaling of container instances based on CPU and memory usage. Map a public route to your container group to make your app accessible from the internet.
- Public IP addresses: Use these endpoints to request public IP addresses for your space. You can bind this IP address to your container to make your container accessible from the internet.
- File shares: Create, list and delete file shares in a space. A file share is a NFS storage system that hosts Docker volumes.
- Volumes: Create and manage container volumes in your space to persist the data of your containers.
Each API request requires an HTTP header that includes the 'X-Auth-Token’ and 'X-Auth-Project-Id’ parameter.
- X-Auth-Token: The JSON web token (JWT) that you receive when logging into the Bluemix platform. It allows you to use the IBM Containers REST API, access services, and resources. Run
cf oauth-tokento retrieve your access token information. - X-Auth-Project-Id: The unique ID of your organization space where you want to create or work with your containers. Run
cf space <space_name> --guid, where<space_name>is the name of your space, to retrieve your space ID.
For further information about how containers work in the IBM Containers service, review the documentation under .
- Homepage
- https://api.apis.guru/v2/specs/bluemix.net:containers/3.0.0.json
- Provider
- bluemix.net:containers / containers
- OpenAPI version
- 2.0
- Spec (JSON)
- https://api.apis.guru/v2/specs/bluemix.net/containers/3.0.0/openapi.json
- Spec (YAML)
- https://api.apis.guru/v2/specs/bluemix.net/containers/3.0.0/openapi.yaml
Tools (49)
Extracted live via the executor SDK.
-
apiInfo.getContainersMessagesThis endpoint retrieves all IBM Containers system messages for the user.
-
apiInfo.getContainersVersionThis endpoint retrieves a list of all microservices that are used in the IBM Containers service with their current build version. This method does not require authentication.
-
authentication.getTlskeyThis endpoint returns the TLS (Transport Layer Security) certificate to the user (corresponding IBM Containers command:
cf ic login). The TLS certificate is a SSL certificate that is used to authenticate the user's CLI with the IBM Containers service and to establish a secure communication between the user's local machine and the container in Bluemix. -
authentication.putTlskeyRefreshThis endpoint requests to generate a new TLS (Transport Layer Security) certificate on the server and to update the existing user TLS certificate (corresponding IBM Containers command:
cf ic init). -
containerGroups.deleteContainersGroupsNameOrIdStops and deletes the container instances that run in a container group (corresponding IBM Containers command:
cf ic group rm <group_name>). When you delete a container group, all floating private IP addresses are released. -
containerGroups.getContainersGroupsThis endpoint returns a list of all container groups in a space independent of their current state. (corresponding IBM Containers command:
cf ic group list). -
containerGroups.getContainersGroupsNameOrIdThis endpoint retrieves detailed information about a container group with a given name (corresponding IBM Containers command:
cf ic group inspect GROUP). -
containerGroups.patchContainersGroupsNameOrIdUpdate the number of container instances that run in a container group (corresponding IBM Containers command:
cf ic group update <option> <group>).Note: You can run only one update at a time.
The desired number is the number of container instances that you require. It must be within the current limits of Max and Min. To increase the number of desired container instances above the Max value, you must first execute an update on the Max value. Once this update is completed, you can increase the desired number of container instances.
-
containerGroups.postContainersGroupsThis endpoint creates and starts a new container group in your space. A container group consists of two or more single containers that are all created from the same container image and as a consequence are configured in the same way. Container groups offer different options at no cost to make your app highly available, such as in-built load balancing, auto-recovery of unhealthy container instances, and auto-scaling of container instances based on CPU and memory usage.
To create a container group with IBM Containers, you must at least define a container group name and the image that the container group is based on. Required attributes:
- Name: The container group name must start with a letter and then can include uppercase letters, lowercase letters, numbers, periods (.), underscores (_), or hyphens (-).
- Image: You must include the full path to the image in your private Bluemix registry in the format:
registry.ng.bluemix.net/<namespace>/<image>._
-
containerGroups.postContainersGroupsNameOrIdMaprouteIf you want your container group to be accessible from the Internet, you need to expose a public port and map a public route to it (corresponding IBM Containers command:
cf ic route map -n <host> -d <domain> <group>). Every route consists of the host name and domain. -
containerGroups.postContainersGroupsNameOrIdUnmaprouteThis endpoint unmaps a public route from a container group (corresponding IBM Containers command:
cf ic route unmap -n <host> -d <domain> <group>). If no other public route is mapped to the container group, then the container group is no longer available from the internet.When you unmap a route from a container group, the route is not deleted and can be mapped to other container groups.
-
fileShares.deleteVolumesFsNameThis endpoint deletes a file share from a space (corresponding IBM Containers command:
cf ic volume fs-rm FSNAME).Before you can delete a file share, all mounted volumes must be deleted first. To delete a volume, run
cf ic volume rm VOLNAMEor call theDELETE /volumes/{name}API endpoint.Note: To delete a file share you must have been granted organization developer rights.
-
fileShares.getVolumesFsFlavorsJsonThis endpoint returns a list of available file shares in gigabyte (corresponding IBM Containers command:
cf ic volume fs-flavor-list). -
fileShares.getVolumesFsJsonThis endpoint returns a list of all file shares that are availble in a space (corresponding IBM Containers command:
cf ic volume fs-list). -
fileShares.getVolumesFsNameJsonThis endpoint returns detailed information about a file share (corresponding IBM Containers command:
cf ic volume fs-inspect FSNAME). -
fileShares.postVolumesFsCreateThis endpoint creates a new file share in a space (corresponding IBM Containers command:
cf ic volume fs-create FSNAME FSSIZE FSIOPS).A file share is a persistent NFS-based (Network File System) storage system that hosts Docker volumes in a Bluemix space and allows a user to store and access container and app-related files. To store files in a file share, you must create a container volume and save the data into this volume.
As soon as you create your first volume in a space with the
cf ic volume create VOLNAMEcommand or thePOST /volumes/createAPI endpoint, a default file share with 20 GB at 4 IOPS (Input Output operations Per Second) is created at no cost.The organization manager can create file shares with specific storage size and IOPS to meet the storage needs of the space. File shares can be provisioned in sizes from 20 GB to 12 TB and at IOPS per GB of 0.25, 2 or 4. Run
cf ic volume fs-flavor-listor call theGET /volumes/fs/flavors/jsonAPI endpoint to retrieve a list of available file share sizes. The file share size in relation to the number of IOPS impacts the speed that data can be read and written from and to the container volume. -
images.deleteImagesIdRemove a Docker image from the private Bluemix registry that is identified by the image ID (corresponding IBM Containers command:
cf ic rmi <image>). -
images.getImagesJsonThis endpoint returns a list of all available Docker images in a private Bluemix registry (corresponding IBM Containers command:
cf ic images. -
images.getImagesNameOrIdJsonThis endpoint returns detailed information about a Docker image that is stored in the private Bluemix registry of an organization (corresponding IBM Containers command:
cf ic inspect <image_name_or_id>). -
images.postBuildThis API builds a new container image from a Dockerfile that is stored on your local machine and pushes the image to the private Bluemix registry (corresponding IBM Containers command:
cf ic build).To push an image to your Bluemix registry, a namespace must be set for the organization. Run
cf ic namespace getor call theGET /registry/namespacesAPI to check if a namespace is already set. If not, runcf ic namespace set NAMESPACEor call thePUT /registry/namespaces/{namespace}API to set a namespace for your organization. -
privateDockerImagesRegistry.getRegistryNamespacesThis endpoint retrieves the namespace that was set for the organization that owns the current space (corresponding IBM Containers command:
cf ic namespace get). -
privateDockerImagesRegistry.getRegistryNamespacesNamespaceThis endpoint checks whether a namespace is available in Bluemix and can be used to set up the private Docker images registry for an organization. When a HTTP code
201 Okis returned, the namespace is already assigned to another organization in Bluemix and cannot be used. When a HTTP code404 Not foundis returned, the namespace can be used for your organization.Consider the following rules when choosing a namespace for your organization:
- Every organization can have one namespace at a time only
- The namespace must be unique in Bluemix.
- The namespace can be 4-30 characters long.
- The namespace must start with at least one letter or number.
- The namespace can only contain lowercase letters, numbers or underscores ().
-
privateDockerImagesRegistry.putRegistryNamespacesNamespaceSet up your own Docker images registry in Bluemix by defining a namespace for your organization (corresponding IBM Containers command:
cf ic namespace set <namespace>). The namespace is used to generate a unique URL to your private Bluemix registry. In your private registry you store all Docker images that you want to share across your organization. To create a container from an image, you must first push the image to your registry.The namespace cannot be changed after is has been set. Consider the following rules to choose a namespace for your organization:
- Every organization can have one namespace at a time only
- The namespace must be unique in Bluemix.
- The namespace can be 4-30 characters long.
- The namespace must start with at least one letter or number.
- The namespace can only contain lowercase letters, numbers or underscores ().
-
publicIpAddresses.getContainersFloatingIpsThis endpoint returns a list of all public IP addresses that are allocated to a space and not bound to a container. If you want to list all public IP addresses that are allocated to a space, even those that are already bound to a container, use the
allquery parameter (corrsponding IBM Containers command:cf ic ip list). -
publicIpAddresses.postContainersFloatingIpsIpReleaseThis endpoint releases a public IP address from a space (corresponding IBM Containers command:
cf ic ip release <ip_adress>). The public IP address is no longer allocated to the space. If a container was bound to the IP address, it is automatically unbound. -
publicIpAddresses.postContainersFloatingIpsRequestThis endpoint requests a new public IP address for a space (corresponding IBM Containers command:
cf ic ip request). The number of public IP addresses depends on the quota that is assigned to the space. If there is not enough quota left to request a new public IP address, you can either contact your organization manager to increase the quota, or unbind an existing IP address from a container by runningcf ic ip unbind <ip_adress> <container>command, or calling thePOST /container/{name_or_id}/floating-ips/{ip}/unbindendpoint. -
publicIpAddresses.postContainersNameOrIdFloatingIpsIpBindThis endpoint binds an available public IP address to a single container (corresponding IBM Containers command:
cf ic ip bind <ip_adress> <container>). After a container is bound to a public IP address, it can be accessed athttps://<public_ip_adress>:<public_port>. -
publicIpAddresses.postContainersNameOrIdFloatingIpsIpUnbindThis endpoint unbinds a public IP address from a container (corresponding IBM Containers command:
cf ic ip unbind <ip_adress> <container>). The container that is unbound from the IP address will not be accessible from the internet anymore. The public IP address will be further allocated to the space and can be used to be bound to other containers. -
quota.getContainersQuotaRetrieve the quota that is assigned to the organization and space.
-
quota.getContainersUsageThis endpoint returns a list of available container sizes and the quota limit and usage for the space.
- Container sizes: A list of available container sizes indicating the amount of container memory, disk space and virtual CPUs that can be assigned to the container.
- Quota limit: Lists the number of containers, public IP addresses, available container memory, and virtual CPUS that are allocated to a space.
- Quota usage: Lists the current number of containers, images, and public IP addresses in a space that is counted towards your quota limit.
-
quota.putContainersQuotaThis endpoint updates the quota that is allocated to a Bluemix space.
Note: Only paid accounts are eligbile to update the space quota. If you are using a free-trial account, upgrade to a paid account first.
-
singleContainers.deleteContainersNameOrIdRemove a single container that is identified by container ID or name from a space (corresponding IBM Containers command:
cf ic delete <container>). The container must be stopped before it can be deleted, unless theforcequery parameter is set to true. -
singleContainers.getContainersIdStatusThis endpoint returns the current state of a container. This state can either be a transient state, such as BUILDING and NETWORKING, or a non-transient state, such as RUNNING, SHUTDOWN, CRASHED, or SUSPENDED.
-
singleContainers.getContainersJsonThis endpoint returns a list of all single containers in a space that are currently in a running state (corresponding IBM Containers command:
cf ic ps). To list all single containers independent of their current state, set theallquery parameter to true. -
singleContainers.getContainersNameOrIdJsonThis endpoint retrieves detailed information about a single container (corresponding IBM Containers command:
cf ic inspect <container>). -
singleContainers.postContainersCreateThis endpoint creates and starts a single container in your space based on the Docker image that is specified in the Image field of the request json. A single container in IBM Containers is similar to a container that you create in your local Docker environment. Single containers are a good way to start with IBM Containers and to learn about how containers work in the IBM Cloud and the features that IBM Containers provides. They are also recommended when you want to run simple app tests or during the development process of an app.
In the Docker API there are two separate APIs to create and start a container. However in IBM Containers a container is created and started in a single API call. Therefore, this API merges parameters from the Docker API to create and start container.
To create a container with IBM Containers, you must at least define the image that the container is based on.
- Image: You must include the full path to the image in your private Bluemix registry in the format:
registry.ng.bluemix.net/<namespace>/<image>.
- Image: You must include the full path to the image in your private Bluemix registry in the format:
-
singleContainers.postContainersNameOrIdPausePause all processes in a running single container with a given container ID or name (corresponding IBM Containers command:
cf ic pause <container>). -
singleContainers.postContainersNameOrIdRenameChange the current name of an existing single container that is identified by the container ID or name (corresponding IBM Containers command:
cf ic rename <old_name> <new_name>). -
singleContainers.postContainersNameOrIdRestartRestart a container with a given container ID or name (corresponding IBM Containers command:
cf ic restart <container>). -
singleContainers.postContainersNameOrIdStartStart a single container with a given container name or ID (corresponding IBM Containers command:
cf ic start <container>). -
singleContainers.postContainersNameOrIdStopStop a single container with a given container name or ID (corresponding IBM Containers command:
cf ic stop <container>). -
singleContainers.postContainersNameOrIdUnpauseUnpause all processes that are currently stopped inside a single containers with a given container ID or name (corresponding IBM Containers command:
cf ic unpause <container>). -
volumes.deleteVolumesNameDelete a volume with a given name from a space (corresponding IBM Containers command:
cf ic volume rm VOLNAME). To delete a volume, all mounted containers must be unmounted first. After the volume is deleted, the data that are stored in the volume are lost. -
volumes.getVolumesJsonThis endpoint returns a list of all volumes that are available in the given space (corresponding IBM Containers command:
cf ic volume list). -
volumes.getVolumesNameJsonRetrieve a detailed list of information about a volume that is identified by the volume name (corresponding IBM Containers command:
cf ic volume inspect VOLNAME). -
volumes.postVolumesCreateThis endpoints creates a new volume in your space (corresponding IBM Containers command:
cf ic volume create VOLNAME). A volume is used to persist and access app data between container restarts. Volumes are hosted on file shares that define the available actual storage in Bluemix and the number of input and output transactions per second (IOPS).After you have created a volume, you must mount it to a container by using the
--volumeoption in thecf ic run(single containers) orcf ic group create(container groups) command. You can also define the volume as part of the HTTP body and send a request to thePOST /containers/create(single containers) orPOST /containers/groups(container groups) endpoints.Note: If you mount multiple containers in a space to the same volume, they share the data in the volume and can access them anytime. When a container is deleted, the associated volume is not removed.
-
volumes.postVolumesNameThis endpoint provisions an existing volume that was created in one space to another space within the same organization. Single containers and container groups in each space can read and write to the shared volume. The volume remains owned by the original space it was created in, including management and billing. For example, the volume can be deleted from the original space only.
-
openapi.previewSpecPreview an OpenAPI document before adding it as a source
-
openapi.addSourceAdd an OpenAPI source and register its operations as tools