閘道器叢集分割槽

新建叢集分割槽

URI

POST /admin-api/partitions

JSON body

{
  "name": "test"
}

請求示例

Shell

curl \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/partitions \
  -d '{"name":"test"}'

響應示例

Status: 200 OK
{
    "data":{
        "id":3
    },
    "status":0
}

獲取叢集分割槽列表

URI

GET /admin-api/partitions

請求示例

Shell

curl \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/partitions

響應示例

Status: 200 OK
{
    "data": [{
        "id": 1,
        "name": "default"
    }, {
        "id": 2,
        "name": "test1"
    }, {
        "id": 3,
        "name": "test2"
    }],
    "status": 0
}

獲取叢集分割槽名字

URI

GET /admin-api/partitions/{partition_id}

請求示例

Shell

curl \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/partitions/1

響應示例

Status: 200 OK
{
    "data": {
        "name": "default",
        "id": 1
    },
    "status": 0
}

修改叢集分割槽

URI

PUT /admin-api/partitions/{partition_id}

JSON body

{
  "name": "new-partition"
}

請求示例

Shell

curl -X PUT \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/partitions/2 -d '{"name": "new-partition"}'

響應示例

Status: 200 OK
{"status":0}

刪除叢集分割槽

URI

DELETE /admin-api/partitions/{partition_id}

請求示例

Shell

curl -X DELETE \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/partitions/2

響應示例

Status: 200 OK
{"status":0}