Appearance
节点 API
1. "获取节点列表"
- route definition
- Url: /api/v1/nodes
- Method: GET
- Request:
NodesListRequest - Response:
NodesListResponse
- request definition
go
type NodesListRequest struct {
Type string `form:"type,optional"`
Status string `form:"status,optional"`
}- response definition
go
type NodesListResponse struct {
Items []Node `json:"items"`
}2. "排空节点"
- route definition
- Url: /api/v1/nodes/:id/drain
- Method: POST
- Request:
NodeDrainRequest - Response:
-
- request definition
go
type NodeDrainRequest struct {
ID string `path:"id"`
Timeout int `json:"timeout,optional"` // 秒
}- response definition
3. "获取节点元数据"
- route definition
- Url: /api/v1/nodes/:id/meta
- Method: GET
- Request:
NodeMetaRequest - Response:
NodeMetaResponse
- request definition
go
type NodeMetaRequest struct {
ID string `path:"id"`
}- response definition
go
type NodeMetaResponse struct {
Meta interface{} `json:"meta"`
}4. "更新节点元数据"
- route definition
- Url: /api/v1/nodes/:id/meta
- Method: PUT
- Request:
NodeMetaUpdateRequest - Response:
NodeMetaResponse
- request definition
go
type NodeMetaUpdateRequest struct {
ID string `path:"id"`
Meta interface{} `json:"meta"`
}- response definition
go
type NodeMetaResponse struct {
Meta interface{} `json:"meta"`
}5. "重启节点"
- route definition
- Url: /api/v1/nodes/:id/restart
- Method: POST
- Request:
NodeActionRequest - Response:
-
- request definition
go
type NodeActionRequest struct {
ID string `path:"id"`
}- response definition
6. "取消排空节点"
- route definition
- Url: /api/v1/nodes/:id/undrain
- Method: POST
- Request:
NodeActionRequest - Response:
-
- request definition
go
type NodeActionRequest struct {
ID string `path:"id"`
}- response definition
7. "获取节点命令"
- route definition
- Url: /api/v1/nodes/commands
- Method: GET
- Request:
NodeCommandsRequest - Response:
NodeCommandsResponse
- request definition
go
type NodeCommandsRequest struct {
}- response definition
go
type NodeCommandsResponse struct {
Items []NodeCommand `json:"items"`
}