v1

latestOpenAPI 3.0.0(C) Copyright IBM Corp. 2016 All Rights Reserved.2026-07-144737155.4 KB
Volumes

Create a volume in a space

This 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 --volume option in the cf ic run (single containers) or cf ic group create (container groups) command. You can also define the volume as part of the HTTP body and send a request to the POST /containers/create (single containers) or POST /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.

post/volumes/create

Query parameters

namestring required

The name of the volume. The name must be unique for a space and can contain uppercase letters, lowercase letters, numbers, underscores (_), and hyphens (-).

fsNamestring

The name of the file share that the volume is hosted on. File shares can have different storage sizes and IOPS based on the required workload. If this field is left blank, the volume is hosted on the default file share.

Headers

X-Auth-Tokenstring required

The Bluemix JSON web token that you receive when logging into Bluemix. Run cf oauth-token to retrieve your access token.

X-Auth-Project-Idstring required

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.

Response

Created. Your volume was successfully created in your space.

fsIDstring

Unique identifier representing the file share on which the volume is hosted.

hostPathstring

Full path to the mounted volume inside the container.

otherSpaceVisibilitystring[]

List of space IDs in which the volume is visible and can be used by all the single containers and container groups.

spaceGuidstring

Unique identifier representing the space where the volume got created.

volNamestring

The name of the volume.