此内容没有您所选择的语言版本。
Chapter 10. Volumes
The
volumes collection provides information about volumes in a Red Hat Gluster Storage environment.
The following table shows specific elements contained in a volume resource representation.
| Element | Type | Description | Properties |
|---|---|---|---|
volumeName | relationship | Name of the volume to be created. |
|
volumeType | relationship | DISTRIBUTE, REPLICATE, DISTRIBUTED_REPLICATE. |
|
replicaCount | complex | replicaCount is mandatory if volumeType is REPLICATE or DISTRIBUTED_REPLICATE |
|
bricks | complex | list of bricks of a volume. You can add/remove bricks to/from a volume. |
|
| options | complex | list of options of the volume |
Example 10.1. An XML representation of a volume
10.1. Creating a Volume 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Creation of a new volume requires the
volumeName, volumeType,transportType and brick elements. The API creates a new volume with a POST request to the URI containing a representation of the new volume
.
Example 10.2. Creating a volume
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes -d "<gluster_volume><name>data</name><volume_type>DISTRIBUTE</volume_type><bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick1</brick_dir></brick><brick><server_id>de173e6a-fb05-11e1-a2fc-0050568c4349</server_id><brick_dir>/export/data/brick2</brick_dir></brick></bricks></gluster_volume>"
The API returns the following representation of the newly created volume resource:

