新建应用

新建应用

URI

POST /admin-api/applications/http

JSON body

  • partitions

    type: array

    required: yes

    description: 发布到的集群分区

  • is_default

    type: boolean

    required: yes

    description: 是否默认

  • http_ports

    type: array

    required: yes

    description: HTTP端口

  • https_ports

    type: array

    required: yes

    description: HTTPS端口

  • http2_status

    type: string

    required: yes

    description: http2状态

  • allow_access_by_ip_list

    type: array

    required: no

    description:

  • allow_load_by_ip_list

    type: array

    required: no

    description:

  • domains

    type: array

    required: yes

    description: 域名列表

  • domains.is_wildcard

    type: boolean

    required: yes

    description: 是否是通配符域名

  • domains.domain

    type: string

    required: yes

    description: 域名名称

请求示例

Shell

curl \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/applications/http \
  -d '{"partitions":[1],"is_default":false,"http_ports":[80],"https_ports":[443],"http2_status":"global","allow_access_by_ip_list":null,"allow_load_by_ip_list":null,"domains":[{"is_wildcard":false,"domain":"test.com"}]}'

响应示例

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