主题
control-plane
Generated reference page for
spec/v1/api/control-plane.openapi.yaml.
Metadata
- Type: OpenAPI
- Source:
spec/v1/api/control-plane.openapi.yaml - Raw: View Raw
Summary
- Title: Agent Service Control Plane API
- Version: v1
- Paths: 13
- Operations: 32
- Servers: 1
Source
yaml
openapi: 3.1.0
info:
title: Agent Service Control Plane API
version: v1
description: >
Control Plane 负责资源管理与 run 命令。所有结构化对象优先引用 `schemas/` 下的共享定义。
servers:
- url: https://api.agent-service.example.com
security:
- bearerAuth: []
paths:
/v1/organizations:
get:
operationId: listOrganizations
summary: List organizations
parameters:
- $ref: '#/components/parameters/offset'
- $ref: '#/components/parameters/limit'
- name: status
in: query
schema:
$ref: ../schemas/common/enums.json#/$defs/organizationStatus
- name: keyword
in: query
schema:
type: string
responses:
'200':
description: Organization page
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
type: object
required: [total, offset, limit, list]
properties:
total:
type: integer
offset:
type: integer
limit:
type: integer
list:
type: array
items:
$ref: ../schemas/resources/organization.json
default:
$ref: '#/components/responses/ErrorResponse'
post:
operationId: createOrganization
summary: Create organization
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/CreateOrganizationCommand
responses:
'200':
description: Created organization
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/organization.json
default:
$ref: '#/components/responses/ErrorResponse'
/v1/organizations/{orgId}:
parameters:
- $ref: '#/components/parameters/orgId'
get:
operationId: getOrganization
summary: Get organization
responses:
'200':
description: Organization detail
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/organization.json
default:
$ref: '#/components/responses/ErrorResponse'
put:
operationId: updateOrganization
summary: Update organization
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/UpdateOrganizationCommand
responses:
'200':
description: Updated organization
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/organization.json
default:
$ref: '#/components/responses/ErrorResponse'
delete:
operationId: deleteOrganization
summary: Delete organization
responses:
'200':
description: Deletion accepted
content:
application/json:
schema:
$ref: ../schemas/common/envelope.json#/$defs/successEnvelope
default:
$ref: '#/components/responses/ErrorResponse'
/v1/organizations/{orgId}/agents:
parameters:
- $ref: '#/components/parameters/orgId'
get:
operationId: listAgentsByOrganization
summary: List agents in organization
parameters:
- $ref: '#/components/parameters/offset'
- $ref: '#/components/parameters/limit'
- name: enabled
in: query
schema:
type: boolean
- name: keyword
in: query
schema:
type: string
responses:
'200':
description: Agent page
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
type: object
required: [total, offset, limit, list]
properties:
total:
type: integer
offset:
type: integer
limit:
type: integer
list:
type: array
items:
$ref: ../schemas/resources/agent.json
default:
$ref: '#/components/responses/ErrorResponse'
post:
operationId: createAgent
summary: Create agent
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/CreateAgentCommand
responses:
'200':
description: Created agent
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/agent.json
default:
$ref: '#/components/responses/ErrorResponse'
/v1/agents/{agentId}:
parameters:
- $ref: '#/components/parameters/agentId'
get:
operationId: getAgent
summary: Get agent
responses:
'200':
description: Agent detail
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/agent.json
default:
$ref: '#/components/responses/ErrorResponse'
put:
operationId: updateAgent
summary: Update agent
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/UpdateAgentCommand
responses:
'200':
description: Updated agent
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/agent.json
default:
$ref: '#/components/responses/ErrorResponse'
delete:
operationId: deleteAgent
summary: Delete agent
responses:
'200':
description: Deletion accepted
content:
application/json:
schema:
$ref: ../schemas/common/envelope.json#/$defs/successEnvelope
default:
$ref: '#/components/responses/ErrorResponse'
/v1/tools:
get:
operationId: listTools
summary: List tools
parameters:
- $ref: '#/components/parameters/offset'
- $ref: '#/components/parameters/limit'
- name: orgId
in: query
schema:
$ref: ../schemas/common/identity.json#/$defs/orgId
responses:
'200':
description: Tool page
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
type: object
required: [total, offset, limit, list]
properties:
total:
type: integer
offset:
type: integer
limit:
type: integer
list:
type: array
items:
$ref: ../schemas/resources/tool.json
default:
$ref: '#/components/responses/ErrorResponse'
post:
operationId: createTool
summary: Create tool
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/CreateToolCommand
responses:
'200':
description: Created tool
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/tool.json
default:
$ref: '#/components/responses/ErrorResponse'
/v1/tools/{toolId}:
parameters:
- $ref: '#/components/parameters/toolId'
get:
operationId: getTool
summary: Get tool
responses:
'200':
description: Tool detail
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/tool.json
default:
$ref: '#/components/responses/ErrorResponse'
put:
operationId: updateTool
summary: Update tool
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/UpdateToolCommand
responses:
'200':
description: Updated tool
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/tool.json
default:
$ref: '#/components/responses/ErrorResponse'
delete:
operationId: deleteTool
summary: Delete tool
responses:
'200':
description: Deletion accepted
content:
application/json:
schema:
$ref: ../schemas/common/envelope.json#/$defs/successEnvelope
default:
$ref: '#/components/responses/ErrorResponse'
/v1/runs:
post:
operationId: createRun
summary: Create run
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/CreateRunCommand
responses:
'200':
description: Created run
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/run.json
default:
$ref: '#/components/responses/ErrorResponse'
/v1/runs/{runId}/messages:
parameters:
- $ref: '#/components/parameters/runId'
post:
operationId: continueRun
summary: Send follow-up input messages
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/ContinueRunCommand
responses:
'200':
description: Accepted
content:
application/json:
schema:
$ref: ../schemas/common/envelope.json#/$defs/successEnvelope
default:
$ref: '#/components/responses/ErrorResponse'
/v1/runs/{runId}:notify:
parameters:
- $ref: '#/components/parameters/runId'
post:
operationId: notifyRun
summary: Send notify event to run
requestBody:
required: false
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/NotifyRunCommand
responses:
'200':
description: Accepted
content:
application/json:
schema:
$ref: ../schemas/common/envelope.json#/$defs/successEnvelope
default:
$ref: '#/components/responses/ErrorResponse'
/v1/runs/{runId}:cancel:
parameters:
- $ref: '#/components/parameters/runId'
post:
operationId: cancelRun
summary: Cancel run
requestBody:
required: false
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/CancelRunCommand
responses:
'200':
description: Accepted
content:
application/json:
schema:
$ref: ../schemas/common/envelope.json#/$defs/successEnvelope
default:
$ref: '#/components/responses/ErrorResponse'
/v1/runs/{runId}:fail:
parameters:
- $ref: '#/components/parameters/runId'
post:
operationId: failRun
summary: Force fail run
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/FailRunCommand
responses:
'200':
description: Accepted
content:
application/json:
schema:
$ref: ../schemas/common/envelope.json#/$defs/successEnvelope
default:
$ref: '#/components/responses/ErrorResponse'
/v1/runs/{runId}/checkpoints:save:
parameters:
- $ref: '#/components/parameters/runId'
post:
operationId: saveCheckpoint
summary: Save checkpoint for run
requestBody:
required: false
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/SaveCheckpointCommand
responses:
'200':
description: Checkpoint creation accepted
content:
application/json:
schema:
type: object
required: [code, message, data]
properties:
code:
type: integer
const: 0
message:
type: string
data:
$ref: ../schemas/resources/checkpoint.json
default:
$ref: '#/components/responses/ErrorResponse'
/v1/runs/{runId}/checkpoints:load:
parameters:
- $ref: '#/components/parameters/runId'
post:
operationId: loadCheckpoint
summary: Load checkpoint into run
requestBody:
required: true
content:
application/json:
schema:
$ref: ../schemas/commands/control-plane.json#/$defs/LoadCheckpointCommand
responses:
'200':
description: Load accepted
content:
application/json:
schema:
$ref: ../schemas/common/envelope.json#/$defs/successEnvelope
default:
$ref: '#/components/responses/ErrorResponse'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
parameters:
offset:
name: offset
in: query
schema:
type: integer
minimum: 0
default: 0
limit:
name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 200
default: 20
orgId:
name: orgId
in: path
required: true
schema:
$ref: ../schemas/common/identity.json#/$defs/orgId
agentId:
name: agentId
in: path
required: true
schema:
$ref: ../schemas/common/identity.json#/$defs/agentId
toolId:
name: toolId
in: path
required: true
schema:
$ref: ../schemas/common/identity.json#/$defs/toolId
runId:
name: runId
in: path
required: true
schema:
$ref: ../schemas/common/identity.json#/$defs/runId
responses:
ErrorResponse:
description: Error response
content:
application/json:
schema:
$ref: ../schemas/errors/error-envelope.json