API7 企业版 Admin API 参考文档 (0.11.0)
Download OpenAPI specification:Download
使用 API7 企业版 Admin API 创建和管理 API7 资源。
创建服务
Authorizations:
Request Body schema: application/json
non-emptyname required | string [ 1 .. 1024 ] characters 对象名称 |
object | |
desc | string 对象描述 |
hosts | Array of strings [ 1 .. 32 ] items unique 服务的 HTTP 主机,用于接收传入的请求。 |
path_prefix | string [ 1 .. 4096 ] characters ^/ 服务的监听路径前缀 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
object 上游提供用于将请求转发到后端服务的网关的必要信息。 |
Responses
Request samples
- Payload
{- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}
}
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}, - "id": "string",
- "last_published": 0,
- "published_gateway_groups_count": 0,
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
获取所有服务
Authorizations:
query Parameters
page | integer <int64> >= 1 页码,从 1 开始。 |
page_size | integer <int64> >= 1 页面大小,必须大于 0。 |
direction | string Default: "desc" Enum: "asc" "desc" 按升序或降序排列(不区分大小写)。默认情况下,按降序排列。 |
order_by | string Default: "updated_at" Enum: "created_at" "updated_at" "last_published" |
search | string 搜索关键字 |
object non-empty | |
gateway_group_id | string >= 1 |
last_publish_start_at | integer >= 0 |
last_publish_end_at | integer >= 0 |
is_permitted | boolean Default: false 筛选当前用户有操作权限的资源。 |
Responses
Response samples
- 200
- 400
- default
{- "list": [
- {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}, - "id": "string",
- "last_published": 0,
- "published_gateway_groups_count": 0,
- "created_at": 0,
- "updated_at": 0
}
], - "total": 0
}
获取特定服务
Authorizations:
path Parameters
service_id required | string^[a-zA-Z0-9-_.]+$ 服务 ID |
Responses
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}, - "id": "string",
- "last_published": 0,
- "published_gateway_groups_count": 0,
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
更新特定服务
Authorizations:
path Parameters
service_id required | string^[a-zA-Z0-9-_.]+$ 服务 ID |
Request Body schema: application/json
non-emptyname required | string [ 1 .. 1024 ] characters 对象名称 |
object | |
desc | string 对象描述 |
hosts | Array of strings [ 1 .. 32 ] items unique 服务的 HTTP 主机,用于接收传入的请求。 |
path_prefix | string [ 1 .. 4096 ] characters ^/ 服务的监听路径前缀 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
object 上游提供用于将请求转发到后端服务的网关的必要信息。 |
Responses
Request samples
- Payload
{- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}
}
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}, - "id": "string",
- "last_published": 0,
- "published_gateway_groups_count": 0,
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
更新特定服务
Authorizations:
path Parameters
service_id required | string^[a-zA-Z0-9-_.]+$ 服务 ID |
query Parameters
dry-run | string Value: "all" 配置是否在试运行模式下进行操作。 |
Request Body schema: application/json
non-emptyname | string [ 1 .. 1024 ] characters 对象名称 |
object | |
desc | string 对象描述 |
hosts | Array of strings [ 1 .. 32 ] items unique 服务的 HTTP 主机,用于接收传入的请求。 |
path_prefix | string [ 1 .. 4096 ] characters ^/ 服务的监听路径前缀 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
object 上游提供用于将请求转发到后端服务的网关的必要信息。 |
Responses
Request samples
- Payload
{- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}
}
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}, - "id": "string",
- "last_published": 0,
- "published_gateway_groups_count": 0,
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
发布服务
Authorizations:
Request Body schema: application/json
non-emptycreate_new_version | boolean 配置是否为更新的服务创建新的服务版本。 |
gateway_group_id | string^[a-zA-Z0-9-_.]+$ 对象 ID |
Array of objects non-empty [ items non-empty ] |
Responses
Request samples
- Payload
{- "create_new_version": true,
- "gateway_group_id": "string",
- "services": [
- {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}, - "service_id": "string",
- "version": "string",
- "service_version_id": "string",
- "status": 0
}
]
}
Response samples
- 200
- 400
- default
{- "value": { },
- "key": "string",
- "warning_msg": "string"
}
检查服务冲突
Authorizations:
Request Body schema: application/json
non-emptycreate_new_version | boolean 配置是否为更新的服务创建新的服务版本。 |
gateway_group_id | string^[-_a-zA-Z0-9]+$ 对象 ID |
Array of objects non-empty |
Responses
Request samples
- Payload
{- "create_new_version": true,
- "gateway_group_id": "string",
- "services": [
- {
- "name": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "service_id": "string",
- "version": "string",
- "service_version_id": "string",
- "status": 0
}
]
}
Response samples
- 200
- 400
- default
{- "value": {
- "duplicate": [
- [
- {
- "service_id": "string",
- "service_name": "string",
- "route_id": "string",
- "route_name": "string",
- "url": "string"
}
]
], - "overlapping": [
- [
- {
- "service_id": "string",
- "service_name": "string",
- "route_id": "string",
- "route_name": "string",
- "url": "string"
}
]
]
}, - "key": "string",
- "warning_msg": "string"
}
获取所有授权用户
Authorizations:
path Parameters
service_id required | string^[-_a-zA-Z0-9]+$ 服务 ID |
query Parameters
direction | string Default: "desc" Enum: "asc" "desc" 按升序或降序排列(不区分大小写)。默认情况下,按降序排列。 |
page_size | integer <int64> >= 1 页面大小,必须大于 0。 |
page | integer <int64> >= 1 页码,从 1 开始。 |
order_by | string Default: "updated_at" Enum: "created_at" "updated_at" |
roles | Array of strings >= 1 |
Responses
Response samples
- 200
- default
{- "list": [
- {
- "id": "string",
- "email": "string",
- "last_name": "string",
- "first_name": "string",
- "username": "string",
- "created_at": 0,
- "updated_at": 0,
- "state": "string",
- "login_option": {
- "id": "string",
- "name": "string",
- "logo": "string",
- "provider_type": "string"
}, - "roles": [
- {
- "id": "string",
- "name": "string",
- "org_id": "string",
- "permissions": [
- "string"
], - "scope_type": "gateway_group",
- "scopes": [
- {
- "id": "string",
- "name": "string"
}
]
}
]
}
], - "total": 0
}
获取特定的已发布服务
Authorizations:
path Parameters
service_id required | string^[a-zA-Z0-9-_.]+$ 服务 ID |
Responses
Response samples
- 200
- 400
- default
{- "list": [
- {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}, - "id": "string",
- "service_id": "string",
- "version": "string",
- "created_at": 0,
- "gateway_group_name": "string",
- "gateway_group_id": "string",
- "status": 0
}
], - "total": 0
}
获取所有 Secret
Authorizations:
query Parameters
page | integer <int64> >= 1 页码,从 1 开始。 |
page_size | integer <int64> >= 1 页面大小,必须大于 0。 |
direction | string Default: "desc" Enum: "asc" "desc" 按升序或降序排列(不区分大小写)。默认情况下,按降序排列。 |
order_by | string Default: "updated_at" Enum: "created_at" "updated_at" |
search | string 搜索关键字 |
gateway_group_id required | string >= 1 |
Responses
Response samples
- 200
- 400
- default
{- "list": [
- {
- "uri": "string",
- "prefix": "string",
- "token": "string",
- "secret_id": "string",
- "created_at": 0,
- "updated_at": 0
}
], - "total": 0
}
获取特定 Secret
Authorizations:
path Parameters
secret_manager required | string Value: "vault" |
secret_id required | string |
Responses
Response samples
- 200
- 400
- default
{- "value": {
- "uri": "string",
- "prefix": "string",
- "token": "string",
- "secret_id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
创建或更新特定 Secret
Authorizations:
path Parameters
secret_manager required | string Value: "vault" |
secret_id required | string |
query Parameters
gateway_group_id required | string >= 1 |
Request Body schema: application/json
uri required | string^[^/]+://([\da-zA-Z.-]+|\[[\da-fA-F:]+\])(:\d... |
prefix required | string |
token required | string |
Responses
Request samples
- Payload
{- "uri": "string",
- "prefix": "string",
- "token": "string"
}
Response samples
- 200
- 400
- default
{- "value": {
- "uri": "string",
- "prefix": "string",
- "token": "string",
- "secret_id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
生成 OpenAPI 规范,导出服务
Authorizations:
query Parameters
scope | string Enum: "partial" "all" 服务范围,可以是全部服务,也可以是部分服务。 |
Request Body schema: application/json
service_ids | Array of strings 服务 ID 列表 |
required | object |
Array of objects |
Responses
Request samples
- Payload
{- "service_ids": [
- "string"
], - "info": {
- "title": "string",
- "version": "string",
- "desc": "string"
}, - "servers": [
- {
- "url": "string",
- "desc": "string"
}
]
}
Response samples
- 200
- 400
- default
{- "value": {
- "openapi": "3.0.1",
- "info": {
- "title": "string",
- "version": "string",
- "desc": "string"
}, - "servers": [
- {
- "url": "string",
- "desc": "string"
}
], - "paths": {
- "property1": {
- "get": {
- "responses": { }
}, - "put": {
- "responses": { }
}, - "post": {
- "responses": { }
}, - "delete": {
- "responses": { }
}, - "options": {
- "responses": { }
}, - "head": {
- "responses": { }
}, - "patch": {
- "responses": { }
}
}, - "property2": {
- "get": {
- "responses": { }
}, - "put": {
- "responses": { }
}, - "post": {
- "responses": { }
}, - "delete": {
- "responses": { }
}, - "options": {
- "responses": { }
}, - "head": {
- "responses": { }
}, - "patch": {
- "responses": { }
}
}
}
}, - "key": "string",
- "warning_msg": "string"
}
基于 OpenAPI 规范导入服务
Authorizations:
Request Body schema: application/json
non-emptyArray of objects non-empty unique | |
name required | string [ 1 .. 1024 ] characters 对象名称 |
object | |
desc | string 对象描述 |
hosts | Array of strings [ 1 .. 32 ] items unique 服务的 HTTP 主机,用于接收传入的请求。 |
path_prefix | string [ 1 .. 4096 ] characters ^/ 服务的监听路径前缀 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
object 上游提供用于将请求转发到后端服务的网关的必要信息。 |
Responses
Request samples
- Payload
{- "routes": [
- {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true
}
], - "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}
}
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}, - "id": "string",
- "last_published": 0,
- "published_gateway_groups_count": 0,
- "created_at": 0,
- "updated_at": 0,
- "routes": [
- {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true,
- "id": "string",
- "service_id": "string",
- "created_at": 0,
- "updated_at": 0
}
]
}, - "key": "string",
- "warning_msg": "string"
}
将 OpenAPI 规范转换为服务和路由资源
Authorizations:
Request Body schema: application/json
raw_openapi required | string 原始 OpenAPI |
Responses
Request samples
- Payload
{- "raw_openapi": "string"
}
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "hosts": [
- "string"
], - "path_prefix": "string",
- "plugins": { },
- "upstream": {
- "name": "default",
- "scheme": "http",
- "desc": "string",
- "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "retries": 65535,
- "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "timeout": {
- "connect": 60,
- "send": 60,
- "read": 60
}, - "retry_timeout": 0,
- "pass_host": "pass",
- "upstream_host": "string",
- "nodes": [
- {
- "host": "string",
- "port": 1,
- "weight": 65535,
- "priority": 0
}
], - "service_name": "string",
- "discovery_type": "kubernetes",
- "discovery_args": {
- "metadata": {
- "idc": "shanghai"
}
}, - "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}
}, - "routes": [
- {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true
}
]
}, - "key": "string",
- "warning_msg": "string"
}
Response samples
- 200
- 400
- default
{- "value": {
- "customer": "API7",
- "effective_at": 1654012800,
- "expired_at": 1717171200,
- "max_dp_cores": 100,
- "runtime": {
- "status": "dp_core_exceeded",
- "dp_core_exceeded_start_at": 0,
- "dp_core_exceeded_end_at": 0,
- "max_dp_cores": 0
}, - "status": "normal"
}, - "key": "string",
- "warning_msg": "string"
}
导入或更新 API7 企业版许可证
Authorizations:
query Parameters
dry-run | string Value: "all" 配置是否在试运行模式下进行操作。 |
Request Body schema: application/json
data required | string 编码的许可证数据 |
Responses
Request samples
- Payload
{- "data": "”xxxx1N-tNaTpttX-NjOdXjyg\""
}
Response samples
- 200
- 400
- default
{- "value": {
- "customer": "API7",
- "effective_at": 1654012800,
- "expired_at": 1717171200,
- "max_dp_cores": 100
}, - "key": "string",
- "warning_msg": "string"
}
创建路由
Authorizations:
Request Body schema: application/json
name required | string [ 1 .. 1024 ] characters 对象名称 |
object | |
desc | string 对象描述 |
methods | Array of strings [ 1 .. 9 ] items unique Items Enum: "GET" "POST" "PUT" "DELETE" "PATCH" "HEAD" "OPTIONS" "TRACE" 允许访问路由的 HTTP 方法。如果为空,则允许所有 HTTP 方法。 |
paths required | Array of strings [ 1 .. 64 ] items [ items [ 1 .. 4096 ] characters ^/ ] 与 API 匹配的 URI 路径。 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
enable_websocket | boolean 配置是否为路由启用 Websocket。 |
service_id required | string^[a-zA-Z0-9-_.]+$ 对象 ID |
Responses
Request samples
- Payload
{- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true,
- "service_id": "string"
}
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true,
- "id": "string",
- "service_id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
获取所有路由
Authorizations:
query Parameters
service_id | string^[a-zA-Z0-9-_.]+$ 服务 ID |
page | integer <int64> >= 1 页码,从 1 开始。 |
page_size | integer <int64> >= 1 页面大小,必须大于 0。 |
direction | string Default: "desc" Enum: "asc" "desc" 按升序或降序排列(不区分大小写)。默认情况下,按降序排列。 |
order_by | string Default: "updated_at" Enum: "created_at" "updated_at" |
search | string 搜索关键字 |
object non-empty |
Responses
Response samples
- 200
- 400
- default
{- "list": [
- {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true,
- "id": "string",
- "service_id": "string",
- "created_at": 0,
- "updated_at": 0
}
], - "total": 0
}
获取特定路由
Authorizations:
path Parameters
route_id required | string^[a-zA-Z0-9-_.]+$ 路由 ID |
query Parameters
object non-empty |
Responses
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true,
- "id": "string",
- "service_id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
更新特定路由
Authorizations:
path Parameters
route_id required | string^[a-zA-Z0-9-_.]+$ 路由 ID |
Request Body schema: application/json
name required | string [ 1 .. 1024 ] characters 对象名称 |
object | |
desc | string 对象描述 |
methods | Array of strings [ 1 .. 9 ] items unique Items Enum: "GET" "POST" "PUT" "DELETE" "PATCH" "HEAD" "OPTIONS" "TRACE" 允许访问路由的 HTTP 方法。如果为空,则允许所有 HTTP 方法。 |
paths required | Array of strings [ 1 .. 64 ] items [ items [ 1 .. 4096 ] characters ^/ ] 与 API 匹配的 URI 路径。 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
enable_websocket | boolean 配置是否为路由启用 Websocket。 |
service_id | string^[a-zA-Z0-9-_.]+$|^$ 对象 ID |
Responses
Request samples
- Payload
{- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true,
- "service_id": "string"
}
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true,
- "id": "string",
- "service_id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
更新特定路由
Authorizations:
path Parameters
route_id required | string^[a-zA-Z0-9-_.]+$ 路由 ID |
Request Body schema: application/json
name | string [ 1 .. 1024 ] characters 对象名称 |
object | |
desc | string 对象描述 |
methods | Array of strings [ 1 .. 9 ] items unique Items Enum: "GET" "POST" "PUT" "DELETE" "PATCH" "HEAD" "OPTIONS" "TRACE" 允许访问路由的 HTTP 方法。如果为空,则允许所有 HTTP 方法。 |
paths | Array of strings [ 1 .. 64 ] items [ items [ 1 .. 4096 ] characters ^/ ] 与 API 匹配的 URI 路径。 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
enable_websocket | boolean 配置是否为路由启用 Websocket。 |
Responses
Request samples
- Payload
{- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true
}
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true,
- "id": "string",
- "service_id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
创建 SSL 证书
Authorizations:
query Parameters
gateway_group_id required | string >= 1 |
Request Body schema: application/json
cert required | string [ 128 .. 65536 ] characters PEM 格式的 SSL 证书 |
certs | Array of strings [ 1 .. 16 ] items [ items [ 128 .. 65536 ] characters ] |
object | |
type | string Enum: "server" "client" SSL 证书的用途,用于客户端与上游或服务器之间的通信。 |
object | |
status | integer Enum: 0 1 对象状态。0 表示对象处于活动状态。1 表示对象处于非活动状态。 |
key required | string [ 128 .. 65536 ] characters PEM 格式的私钥 |
keys | Array of strings [ 1 .. 16 ] items [ items [ 128 .. 65536 ] characters ] |
Responses
Request samples
- Payload
{- "cert": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "certs": [
- "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst"
], - "client": {
- "ca": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "depth": 1
}, - "type": "server",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "status": 0,
- "key": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "keys": [
- "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst"
]
}
Response samples
- 200
{- "value": {
- "cert": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "certs": [
- "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst"
], - "client": {
- "ca": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "depth": 1
}, - "type": "server",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "status": 0,
- "id": "string",
- "created_at": 0,
- "updated_at": 0,
- "exptime": 0,
- "validity_start": 0,
- "validity_end": 0,
- "snis": [
- "string"
]
}, - "key": "string",
- "warning_msg": "string"
}
获取所有 SSL 证书
Authorizations:
query Parameters
gateway_group_id required | string >= 1 |
page | integer <int64> >= 1 页码,从 1 开始。 |
page_size | integer <int64> >= 1 页面大小,必须大于 0。 |
direction | string Default: "desc" Enum: "asc" "desc" 按升序或降序排列(不区分大小写)。默认情况下,按降序排列。 |
order_by | string Default: "updated_at" Enum: "created_at" "updated_at" |
search | string 搜索关键字 |
object non-empty |
Responses
Response samples
- 200
- 400
- default
{- "list": [
- {
- "cert": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "certs": [
- "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst"
], - "client": {
- "ca": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "depth": 1
}, - "type": "server",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "status": 0,
- "id": "string",
- "created_at": 0,
- "updated_at": 0,
- "exptime": 0,
- "validity_start": 0,
- "validity_end": 0,
- "snis": [
- "string"
]
}
], - "total": 0
}
获取特定 SSL 证书
Authorizations:
path Parameters
ssl_id required | string^[a-zA-Z0-9-_.]+$ SSL 证书 ID |
Responses
Response samples
- 200
- 400
- default
{- "value": {
- "cert": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "certs": [
- "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst"
], - "client": {
- "ca": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "depth": 1
}, - "type": "server",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "status": 0,
- "id": "string",
- "created_at": 0,
- "updated_at": 0,
- "exptime": 0,
- "validity_start": 0,
- "validity_end": 0,
- "snis": [
- "string"
]
}, - "key": "string",
- "warning_msg": "string"
}
更新特定 SSL 证书
Authorizations:
path Parameters
ssl_id required | string^[a-zA-Z0-9-_.]+$ SSL 证书 ID |
query Parameters
gateway_group_id | string >= 1 |
Request Body schema: application/json
cert required | string [ 128 .. 65536 ] characters PEM 格式的 SSL 证书 |
certs | Array of strings [ 1 .. 16 ] items [ items [ 128 .. 65536 ] characters ] |
object | |
type | string Enum: "server" "client" SSL 证书的用途,用于客户端与上游或服务器之间的通信。 |
object | |
status | integer Enum: 0 1 对象状态。0 表示对象处于活动状态。1 表示对象处于非活动状态。 |
key required | string [ 128 .. 65536 ] characters PEM 格式的私钥 |
keys | Array of strings [ 1 .. 16 ] items [ items [ 128 .. 65536 ] characters ] |
Responses
Request samples
- Payload
{- "cert": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "certs": [
- "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst"
], - "client": {
- "ca": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "depth": 1
}, - "type": "server",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "status": 0,
- "key": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "keys": [
- "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst"
]
}
Response samples
- 200
- 400
- default
{- "value": {
- "cert": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "certs": [
- "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst"
], - "client": {
- "ca": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "depth": 1
}, - "type": "server",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "status": 0,
- "id": "string",
- "created_at": 0,
- "updated_at": 0,
- "exptime": 0,
- "validity_start": 0,
- "validity_end": 0,
- "snis": [
- "string"
]
}, - "key": "string",
- "warning_msg": "string"
}
创建消费者
Authorizations:
query Parameters
gateway_group_id required | string >= 1 |
Request Body schema: application/json
username required | string [ 1 .. 100 ] characters ^[a-zA-Z0-9-_.]+$ 对象名称 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
desc | string 对象描述 |
object |
Responses
Request samples
- Payload
{- "username": "string",
- "plugins": { },
- "desc": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}
}
Response samples
- 200
- 400
- default
{- "value": {
- "username": "string",
- "plugins": { },
- "desc": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
获取所有消费者
Authorizations:
query Parameters
gateway_group_id required | string >= 1 |
page | integer <int64> >= 1 页码,从 1 开始。 |
page_size | integer <int64> >= 1 页面大小,必须大于 0。 |
direction | string Default: "desc" Enum: "asc" "desc" 按升序或降序排列(不区分大小写)。默认情况下,按降序排列。 |
order_by | string Default: "updated_at" Enum: "created_at" "updated_at" |
search | string 搜索关键字 |
object non-empty |
Responses
Response samples
- 200
- 400
- default
{- "list": [
- {
- "username": "string",
- "plugins": { },
- "desc": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "id": "string",
- "created_at": 0,
- "updated_at": 0
}
], - "total": 0
}
获取特定消费者
Authorizations:
path Parameters
consumer_id required | string^[a-zA-Z0-9-_.]+$ 消费者 ID |
Responses
Response samples
- 200
- 400
- default
{- "value": {
- "username": "string",
- "plugins": { },
- "desc": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
更新特定消费者
Authorizations:
path Parameters
consumer_id required | string^[a-zA-Z0-9-_.]+$ 消费者 ID |
query Parameters
gateway_group_id | string >= 1 |
Request Body schema: application/json
username required | string [ 1 .. 100 ] characters ^[a-zA-Z0-9_]+$ 对象名称 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
desc | string 对象描述 |
object |
Responses
Request samples
- Payload
{- "username": "string",
- "plugins": { },
- "desc": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}
}
Response samples
- 200
- 400
- default
{- "value": {
- "username": "string",
- "plugins": { },
- "desc": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
更新特定消费者
Authorizations:
path Parameters
consumer_id required | string^[a-zA-Z0-9-_.]+$ 消费者 ID |
Request Body schema: application/json
username | string [ 1 .. 100 ] characters ^[a-zA-Z0-9-_.]+$ 对象名称 |
plugins | object 键值对,用于表示与目标对象关联的插件。 |
desc | string 对象描述 |
object |
Responses
Request samples
- Payload
{- "username": "string",
- "plugins": { },
- "desc": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}
}
Response samples
- 200
- 400
- default
{- "value": {
- "name": "string",
- "labels": {
- "property1": "string",
- "property2": "string"
}, - "desc": "string",
- "methods": [
- "GET"
], - "paths": [
- "string"
], - "plugins": { },
- "enable_websocket": true,
- "id": "string",
- "service_id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
创建全局规则
Authorizations:
query Parameters
gateway_group_id required | string >= 1 |
Request Body schema: application/json
plugins required | object 键值对,用于表示与目标对象关联的插件。 |
Responses
Request samples
- Payload
{- "plugins": { }
}
Response samples
- 200
- 400
- default
{- "value": {
- "plugins": { },
- "id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
获取所有全局规则
Authorizations:
query Parameters
gateway_group_id required | string >= 1 |
page | integer <int64> >= 1 页码,从 1 开始。 |
page_size | integer <int64> >= 1 页面大小,必须大于 0。 |
direction | string Default: "desc" Enum: "asc" "desc" 按升序或降序排列(不区分大小写)。默认情况下,按降序排列。 |
order_by | string Default: "updated_at" Enum: "created_at" "updated_at" |
search | string 搜索关键字 |
Responses
Response samples
- 200
- 400
- default
{- "list": [
- {
- "plugins": { },
- "id": "string",
- "created_at": 0,
- "updated_at": 0
}
], - "total": 0
}
获取特定全局规则
Authorizations:
path Parameters
global_rule_id required | string^[a-zA-Z0-9-_.]+$ 全局规则 ID |
query Parameters
gateway_group_id required | string >= 1 |
Responses
Response samples
- 200
- 400
- default
{- "value": {
- "plugins": { },
- "id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
更新特定全局规则
Authorizations:
path Parameters
global_rule_id required | string^[a-zA-Z0-9-_.]+$ 全局规则 ID |
query Parameters
gateway_group_id required | string >= 1 |
Request Body schema: application/json
plugins required | object 键值对,用于表示与目标对象关联的插件。 |
Responses
Request samples
- Payload
{- "plugins": { }
}
Response samples
- 200
- 400
- default
{- "value": {
- "plugins": { },
- "id": "string",
- "created_at": 0,
- "updated_at": 0
}, - "key": "string",
- "warning_msg": "string"
}
更新插件元数据
Authorizations:
path Parameters
plugin_name required | string [ 1 .. 64 ] characters |
query Parameters
gateway_group_id required | string >= 1 |
Request Body schema: application/json
插件元数据的描述信息
Responses
Request samples
- Payload
{ }
Response samples
- 200
- 400
- default
{- "value": { },
- "key": "string",
- "warning_msg": "string"
}
获取所有网关实例
Authorizations:
query Parameters
gateway_group_id | string >= 1 |
order_by | string Default: "last_heartbeat_time" Enum: "created_at" "last_heartbeat_time" |
status | string Enum: "Healthy" "OutOfSync" "LostConnection" "Offline" 网关实例状态 |
direction | string Default: "desc" Enum: "asc" "desc" 按升序或降序排列(不区分大小写)。默认情况下,按降序排列。 |
page_size | integer <int64> >= 1 页面大小,必须大于 0。 |
page | integer <int64> >= 1 页码,从 1 开始。 |
search | string 搜索关键字 |
Responses
Response samples
- 200
- default
{- "list": [
- {
- "id": "string",
- "hostname": "string",
- "ip": "string",
- "gateway_group_id": "string",
- "version": "string",
- "ports": [
- 0
], - "last_heartbeat_time": 0,
- "to_be_deleted_at": 0,
- "created_at": 0,
- "dataplane_certificate_expire_time": 0,
- "status": "Healthy",
- "cores": 0
}
], - "total": 0
}