跳到主要内容

APISIX Control API (3.15.0)

Download OpenAPI specification:Download

APISIX Control API 用于获取 APISIX 的内部状态。除了下面列出的端点外,某些插件(例如 server-info)可以向控制 API 添加额外的端点。

Schema

Schema 定义了可用的参数及其数据类型、属性、默认值、有效值等。

获取 JSON Schema

获取 APISIX 实例使用的 JSON schema。

Responses

Response samples

Content type
application/json
{
  • "1": {
    }
}

健康检查

健康检查是一种机制,根据上游服务的响应能力来确定它们是健康还是不健康。

获取健康检查信息

获取 APISIX 实例的健康检查信息。你需要向路由发起请求以生成控制 API 健康检查信息。

Responses

Response samples

Content type
application/json
Example
{
  • "nodes": [
    ],
  • "name": "/apisix/routes/1",
  • "type": "http"
}

按类型和 ID 获取健康状态

获取指定资源的健康状态。

path Parameters
src_type
required
string
Enum: "routes" "services" "upstreams"

指定的资源类型。

src_id
required
string

指定的节点 ID。

Responses

Response samples

Content type
application/json
{
  • "nodes": [
    ],
  • "type": "http",
  • "name": "/apisix/routes/1"
}

垃圾回收

垃圾回收是一种自动内存管理形式。垃圾回收器尝试回收程序已分配但不再被引用的内存。

触发垃圾回收

在 HTTP 子系统中触发一次完整的垃圾回收。请注意,对此端点的请求不会在 stream 子系统中触发垃圾回收,因为这些子系统在单独的 Lua VM 中运行。

Responses

Response samples

Content type
application/json
{ }

路由

路由定义了一条指向一个或多个上游服务的路径。

有关详细信息,请参阅路由

获取所有路由

获取所有已配置的路由。

Responses

Response samples

Content type
application/json
{
  • "priority": 0,
  • "uris": [
    ],
  • "id": "1",
  • "upstream": {
    },
  • "status": 1
}

按 ID 获取路由

按 ID 获取路由。

path Parameters
id
required
string

指定的路由 ID。

Responses

Response samples

Content type
application/json
{
  • "priority": 0,
  • "uris": [
    ],
  • "id": "1",
  • "upstream": {
    },
  • "status": 1
}

上游

上游是一个或多个上游地址的逻辑抽象。

有关详细信息,请参阅上游

获取所有上游

获取所有已配置的上游。

Responses

Response samples

Content type
application/json
{
  • "scheme": "http",
  • "pass_host": "pass",
  • "nodes": [
    ],
  • "hash_on": "vars",
  • "update_time": 1634543819,
  • "key": "remote_addr",
  • "create_time": 1634539759,
  • "id": "1",
  • "type": "chash"
}

按 ID 获取上游

按 ID 获取上游。

path Parameters
id
required
string

指定的上游 ID。

Responses

Response samples

Content type
application/json
{
  • "scheme": "http",
  • "pass_host": "pass",
  • "nodes": [
    ],
  • "hash_on": "vars",
  • "update_time": 1634543819,
  • "key": "remote_addr",
  • "create_time": 1634539759,
  • "id": "1",
  • "type": "chash"
}

服务

服务是提供一组功能的后端应用程序。

有关详细信息,请参阅服务

获取所有服务

获取所有已配置的服务。

Responses

Response samples

Content type
application/json
{
  • "has_domain": false,
  • "clean_handlers": { },
  • "modifiedIndex": 671,
  • "key": "/apisix/services/200",
  • "createdIndex": 671,
  • "value": {
    }
}

按 ID 获取服务

按 ID 获取服务。

path Parameters
id
required
string

指定的服务 ID。

Responses

Response samples

Content type
application/json
{
  • "has_domain": false,
  • "clean_handlers": { },
  • "modifiedIndex": 728,
  • "key": "/apisix/services/5",
  • "createdIndex": 728,
  • "value": {
    }
}

插件元数据

插件元数据用于配置共享同一插件名称的所有插件实例的公共元数据字段。 有关详细信息,请参阅插件元数据

获取所有插件元数据

获取所有插件元数据。

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

按名称获取插件元数据

按插件名称获取插件元数据。

path Parameters
plugin_name
required
string

指定的插件名称。

Responses

Response samples

Content type
application/json
{
  • "log_format": {
    },
  • "id": "file-logger"
}

插件

插件扩展了 APISIX 的基础功能以满足用户的特定需求。

有关详细信息,请参阅插件

重新加载所有插件

热重新加载插件,使配置文件中的插件列表或插件源文件的更改生效。

Responses

Response samples

Content type
application/json
"完成"

服务发现

服务发现是在基于微服务的架构中使用的一种过程,用于自动检测和注册动态分配的上游地址。

有关详细信息,请参阅服务发现

获取内存转储

获取服务和配置详细信息。

Responses

Response samples

Content type
application/json
{
  • "services": {
    },
  • "config": {
    }
}

获取转储文件

获取已配置的服务详细信息。

Responses

Response samples

Content type
application/json
{
  • "last_update": 1703594980,
  • "services": {
    },
  • "expire": 2592000
}