# 网关集群分区

# 新建集群分区

# 简介

创建新的集群分区

# Uri
POST /admin-api/partitions
# Json body
  • name

    type: string

    required: yes

    description: 新建集群分区的名称

# 请求示例
# 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?_count=1&start=0&end=19&page=1&page_size=20&detail=1
# Uri参数
  • start

    type: integer

    required: no

    description: 开始项

  • end

    type: integer

    required: no

    description: 结束项

  • page

    type: integer

    require: no

    description: 页面数量

  • page

    type: integer

    require: no

    description: 页面大小

  • detail

    type: boolean

    require: no

    description: 是否返回详细信息

# 请求示例
# Shell
curl \
  -H "API-token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/partitions?_count=1&start=0&end=19&page=1&page_size=20&detail=1
# 响应示例
Status: 200 OK
{
    "data": [{
        "id": 1,
        "name": "default"
    }, {
        "id": 2,
        "name": "test1"
    }, {
        "id": 3,
        "name": "test2"
    }],
    "status": 0
}

# 修改集群分区

# 简介

修改集群分区

# Uri
PUT /admin-api/partitions/{partition_id}
# Json body
  • id

    type: integer

    required: yes

    description: 要修改的集群分区的id

  • name

    type: string

    required: yes

    description: 集群分区的名称

# 请求示例
# Shell
curl \
  -H "API-token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/partitions/2
# 响应示例
Status: 200 OK
{"id":2,"name":"test"}