-
Notifications
You must be signed in to change notification settings - Fork 66
REST API
Kiran Mova edited this page Jan 31, 2020
·
1 revision
curl http://<controlIp>:9501/v1/replicas
curl http://<ReplicaIp>:9502/v1/replicas
curl http://<controlIp>:9501/v1/volumes
curl http://<ReplicaIp>:9502/v1/replicas
The chain key has the snapshot list
curl -H "Content-Type: application/json" -X POST -d '{"name":"<Snapshot name>"}' http://192.168.43.174:9501/v1/volumes/<Volume ID>?action=snapshot
curl -H "Content-Type: application/json" -X POST -d '{"name":"<Snapshot name>"}' http://192.168.43.174:9501/v1/volumes/<Volume ID>?action=revert
curl -X POST http://CONTROLLER_IP:9501/v1/delete
# OUTPUT
{
"actions": {},
"links": {
"self": "http://172.18.0.2:9501/v1/delete"
},
"replicas": [
{
"msg": "Replica deleted successfully",
"replica": "tcp://172.18.0.3:9502"
},
{
"msg": "Replica deleted successfully",
"replica": "tcp://172.18.0.4:9502"
}
],
"type": "delete"
}
# OUTPUT (if all the replicas are not up)
{
"actions": {},
"links": {
"self": "http://172.18.0.2:9501/v1/delete"
},
"replicas": [
{
"error": "Replication factor: 2 is not equal to replica count: 1",
"msg": "Error deleting replica",
"replica": ""
}
],
"type": "delete"
}
# OUTPUT (if the RF condition met but replica goes down while delete operation)
{
"actions": {},
"links": {
"self": "http://172.18.0.2:9501/v1/delete"
},
"replicas": [
{
"msg": "Replica deleted successfully",
"replica": "tcp://172.18.0.4:9502"
},
{
"error": {
"Err": {},
"Op": "Get",
"URL": "http://172.18.0.3:9502/v1/replicas/1"
},
"msg": "Error deleting replica",
"replica": "tcp://172.18.0.3:9502"
}
],
"type": "delete"
}
Note: Please ensure that all the replicas are up before making delete request to controller. RF: Replication Factor, which is being used as env var in controller.