网关集群分区

新建集群分区

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}