Este conteúdo não está disponível no idioma selecionado.
10.4. Managing Bricks
This section describes the brick operations of the Red Hat Gluster Storage Console API such as adding and removing them from a volume.
10.4.1. Listing of Bricks Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
A listing of bricks in a volume is obtained by issuing a
GET request on the volume URI.
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks HTTP/1.1 Accept: application/xml
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks HTTP/1.1
Accept: application/xml
The API returns the following representation:
10.4.2. Adding a Brick Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
The API adds a new brick to a volume in your cluster with a
POST request to its URI.
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks -d "<bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick3</brick_dir></brick></bricks>"
The API returns the following representation:
10.4.3. Removing a Brick Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
The API removes a brick(s) from a volume with a
DELETE request sent to its URI. Before removing a brick, data must be migrated to ensure there is no data loss with a POST request sent to its URI.
POST /api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/bricks/migrate -d "<action><bricks><brick><name>host:brick_dir</name></brick></bricks></action>"
POST /api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/bricks/migrate -d "<action><bricks><brick><name>host:brick_dir</name></brick></bricks></action>"
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" [USER:PASS] https://[RHGSC HOST]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/bricks/migrate -d "<action><bricks><brick><name>host:brick_dir</name></brick></bricks></action>"
The API returns the following representation:
The status of remove brick (with data migration) is monitored using the job ID and its corresponding step ID by looking at the remove brick step.
/api/jobs/<job_id>/steps /api/jobs/<job_id>/steps/<step_id> --for step type remove brick /api/jobs/<job_id>/steps/<step_id>/statistics -- for detail information of remove brick
/api/jobs/<job_id>/steps
/api/jobs/<job_id>/steps/<step_id> --for step type remove brick
/api/jobs/<job_id>/steps/<step_id>/statistics -- for detail information of remove brick
Now, you can delete the migrated bricks by issuing a
DELETE request for a brick(s).
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks
cURL command:
curl -X DELETE -u [USER:PASS] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks -d "<bricks><brick><name>host:brick_dir</brick></bricks>"