deepdata: core product code (backend, frontend, runtime, deepflow module)
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
# OpenAPI Code Generation Configuration
|
||||
# 基于YAML生成API代码的配置文件
|
||||
|
||||
## Maven Plugin Configuration for Spring Boot
|
||||
# 在各个服务的pom.xml中添加以下插件配置:
|
||||
|
||||
```xml
|
||||
|
||||
<plugin>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<version>6.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<inputSpec>${project.basedir}/../../openapi/specs/${project.artifactId}.yaml</inputSpec>
|
||||
<generatorName>spring</generatorName>
|
||||
<output>${project.build.directory}/generated-sources/openapi</output>
|
||||
<apiPackage>com.deepdata.${project.name}.interfaces.api</apiPackage>
|
||||
<modelPackage>com.deepdata.${project.name}.interfaces.dto</modelPackage>
|
||||
<configOptions>
|
||||
<interfaceOnly>true</interfaceOnly>
|
||||
<useTags>true</useTags>
|
||||
<skipDefaultInterface>true</skipDefaultInterface>
|
||||
<hideGenerationTimestamp>true</hideGenerationTimestamp>
|
||||
<java8>true</java8>
|
||||
<dateLibrary>java8</dateLibrary>
|
||||
<useBeanValidation>true</useBeanValidation>
|
||||
<performBeanValidation>true</performBeanValidation>
|
||||
<useSpringBoot3>true</useSpringBoot3>
|
||||
<documentationProvider>springdoc</documentationProvider>
|
||||
</configOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
```
|
||||
|
||||
## Gradle Plugin Configuration (Alternative)
|
||||
# 如果使用Gradle,可以使用以下配置:
|
||||
|
||||
```gradle
|
||||
plugins {
|
||||
id 'org.openapi.generator' version '6.6.0'
|
||||
}
|
||||
|
||||
openApiGenerate {
|
||||
generatorName = "spring"
|
||||
inputSpec = "$rootDir/openapi/specs/${project.name}.yaml"
|
||||
outputDir = "$buildDir/generated-sources/openapi"
|
||||
apiPackage = "com.deepdata.${project.name}.interfaces.api"
|
||||
modelPackage = "com.deepdata.${project.name}.interfaces.dto"
|
||||
configOptions = [
|
||||
interfaceOnly: "true",
|
||||
useTags: "true",
|
||||
skipDefaultInterface: "true",
|
||||
hideGenerationTimestamp: "true",
|
||||
java8: "true",
|
||||
dateLibrary: "java8",
|
||||
useBeanValidation: "true",
|
||||
performBeanValidation: "true",
|
||||
useSpringBoot3: "true",
|
||||
documentationProvider: "springdoc"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Frontend TypeScript Client Generation
|
||||
# 为前端生成TypeScript客户端:
|
||||
|
||||
```bash
|
||||
# 安装 OpenAPI Generator CLI
|
||||
npm install -g @openapitools/openapi-generator-cli
|
||||
|
||||
# 生成TypeScript客户端
|
||||
openapi-generator-cli generate \
|
||||
-i openapi/specs/data-annotation-service.yaml \
|
||||
-g typescript-axios \
|
||||
-o frontend/packages/api-client/src/generated/annotation \
|
||||
--additional-properties=supportsES6=true,npmName=@deepdata/annotation-api,npmVersion=1.0.0
|
||||
```
|
||||
|
||||
## Usage in Services
|
||||
# 在各个服务中使用生成的代码:
|
||||
|
||||
1. **在 interfaces 层实现生成的API接口**:
|
||||
```java
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/annotation")
|
||||
public class AnnotationTaskController implements AnnotationTasksApi {
|
||||
|
||||
private final AnnotationTaskApplicationService annotationTaskService;
|
||||
|
||||
@Override
|
||||
public ResponseEntity<AnnotationTaskPageResponse> getAnnotationTasks(
|
||||
Integer page, Integer size, String status) {
|
||||
// 实现业务逻辑
|
||||
return ResponseEntity.ok(annotationTaskService.getTasks(page, size, status));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. **在 application 层使用生成的DTO**:
|
||||
```java
|
||||
@Service
|
||||
public class AnnotationTaskApplicationService {
|
||||
|
||||
public AnnotationTaskPageResponse getTasks(Integer page, Integer size, String status) {
|
||||
// 业务逻辑实现
|
||||
// 使用生成的DTO类型
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Build Integration
|
||||
# 构建集成脚本位置:scripts/build/generate-api.sh
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# 生成所有服务的API代码
|
||||
|
||||
OPENAPI_DIR="openapi/specs"
|
||||
SERVICES=(
|
||||
"data-annotation-service"
|
||||
"data-management-service"
|
||||
"data-synthesis-service"
|
||||
"data-evaluation-service"
|
||||
"pipeline-orchestration-service"
|
||||
"execution-engine-service"
|
||||
"rag-indexer-service"
|
||||
"rag-query-service"
|
||||
"api-gateway"
|
||||
"auth-service"
|
||||
)
|
||||
|
||||
for service in "${SERVICES[@]}"; do
|
||||
echo "Generating API for $service..."
|
||||
mvn -f backend/services/$service/pom.xml openapi-generator:generate
|
||||
done
|
||||
|
||||
echo "All APIs generated successfully!"
|
||||
```
|
||||
@@ -0,0 +1,298 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Data Annotation Service API
|
||||
description: 数据标注服务API - 智能预标注、人工平台、主动学习
|
||||
version: 1.0.0
|
||||
contact:
|
||||
name: Data Mate Platform Team
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8080
|
||||
description: Development server
|
||||
|
||||
tags:
|
||||
- name: annotation-tasks
|
||||
description: 标注任务管理
|
||||
- name: annotation-data
|
||||
description: 标注数据管理
|
||||
- name: pre-annotation
|
||||
description: 智能预标注
|
||||
- name: active-learning
|
||||
description: 主动学习
|
||||
|
||||
paths:
|
||||
/api/v1/annotation/tasks:
|
||||
get:
|
||||
tags:
|
||||
- annotation-tasks
|
||||
summary: 获取标注任务列表
|
||||
description: 分页获取标注任务列表
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
description: 页码
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
description: 每页大小
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
- name: status
|
||||
in: query
|
||||
description: 任务状态
|
||||
schema:
|
||||
type: string
|
||||
enum: [PENDING, IN_PROGRESS, COMPLETED, PAUSED]
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AnnotationTaskPageResponse'
|
||||
'400':
|
||||
description: 请求参数错误
|
||||
'500':
|
||||
description: 服务器内部错误
|
||||
|
||||
post:
|
||||
tags:
|
||||
- annotation-tasks
|
||||
summary: 创建标注任务
|
||||
description: 创建新的标注任务
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateAnnotationTaskRequest'
|
||||
responses:
|
||||
'201':
|
||||
description: 创建成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AnnotationTaskResponse'
|
||||
'400':
|
||||
description: 请求参数错误
|
||||
'500':
|
||||
description: 服务器内部错误
|
||||
|
||||
/api/v1/annotation/tasks/{taskId}:
|
||||
get:
|
||||
tags:
|
||||
- annotation-tasks
|
||||
summary: 获取标注任务详情
|
||||
parameters:
|
||||
- name: taskId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AnnotationTaskResponse'
|
||||
'404':
|
||||
description: 任务不存在
|
||||
|
||||
put:
|
||||
tags:
|
||||
- annotation-tasks
|
||||
summary: 更新标注任务
|
||||
parameters:
|
||||
- name: taskId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateAnnotationTaskRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 更新成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AnnotationTaskResponse'
|
||||
|
||||
/api/v1/annotation/pre-annotate:
|
||||
post:
|
||||
tags:
|
||||
- pre-annotation
|
||||
summary: 智能预标注
|
||||
description: 使用AI模型进行智能预标注
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PreAnnotationRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 预标注成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PreAnnotationResponse'
|
||||
|
||||
components:
|
||||
schemas:
|
||||
AnnotationTaskResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: 任务ID
|
||||
name:
|
||||
type: string
|
||||
description: 任务名称
|
||||
description:
|
||||
type: string
|
||||
description: 任务描述
|
||||
type:
|
||||
type: string
|
||||
enum: [TEXT_CLASSIFICATION, NAMED_ENTITY_RECOGNITION, OBJECT_DETECTION, SEMANTIC_SEGMENTATION]
|
||||
description: 标注类型
|
||||
status:
|
||||
type: string
|
||||
enum: [PENDING, IN_PROGRESS, COMPLETED, PAUSED]
|
||||
description: 任务状态
|
||||
datasetId:
|
||||
type: string
|
||||
description: 数据集ID
|
||||
progress:
|
||||
type: number
|
||||
format: double
|
||||
description: 进度百分比
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: 创建时间
|
||||
updatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: 更新时间
|
||||
|
||||
CreateAnnotationTaskRequest:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
- datasetId
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: 任务名称
|
||||
description:
|
||||
type: string
|
||||
description: 任务描述
|
||||
type:
|
||||
type: string
|
||||
enum: [TEXT_CLASSIFICATION, NAMED_ENTITY_RECOGNITION, OBJECT_DETECTION, SEMANTIC_SEGMENTATION]
|
||||
description: 标注类型
|
||||
datasetId:
|
||||
type: string
|
||||
description: 数据集ID
|
||||
configuration:
|
||||
type: object
|
||||
description: 标注配置
|
||||
|
||||
UpdateAnnotationTaskRequest:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: 任务名称
|
||||
description:
|
||||
type: string
|
||||
description: 任务描述
|
||||
status:
|
||||
type: string
|
||||
enum: [PENDING, IN_PROGRESS, COMPLETED, PAUSED]
|
||||
description: 任务状态
|
||||
|
||||
AnnotationTaskPageResponse:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/AnnotationTaskResponse'
|
||||
totalElements:
|
||||
type: integer
|
||||
format: int64
|
||||
totalPages:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
|
||||
PreAnnotationRequest:
|
||||
type: object
|
||||
required:
|
||||
- taskId
|
||||
- dataIds
|
||||
properties:
|
||||
taskId:
|
||||
type: string
|
||||
description: 标注任务ID
|
||||
dataIds:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: 待预标注的数据ID列表
|
||||
modelId:
|
||||
type: string
|
||||
description: 预标注模型ID
|
||||
confidence:
|
||||
type: number
|
||||
format: double
|
||||
description: 置信度阈值
|
||||
|
||||
PreAnnotationResponse:
|
||||
type: object
|
||||
properties:
|
||||
taskId:
|
||||
type: string
|
||||
description: 任务ID
|
||||
processedCount:
|
||||
type: integer
|
||||
description: 已处理数据数量
|
||||
successCount:
|
||||
type: integer
|
||||
description: 成功预标注数量
|
||||
results:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
dataId:
|
||||
type: string
|
||||
annotations:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
confidence:
|
||||
type: number
|
||||
format: double
|
||||
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
|
||||
security:
|
||||
- BearerAuth: []
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,517 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Data Collection Service API
|
||||
description: |
|
||||
数据归集服务API,基于数据归集实现数据采集和归集功能。
|
||||
|
||||
主要功能:
|
||||
- 数据归集任务创建和管理
|
||||
- 数据同步任务执行
|
||||
- 任务监控和状态查询
|
||||
- 执行日志查看
|
||||
|
||||
version: 1.0.0
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8090/api/v1/collection
|
||||
description: Development server
|
||||
|
||||
tags:
|
||||
- name: CollectionTask
|
||||
description: 数据归集任务管理(包括模板查询)
|
||||
- name: TaskExecution
|
||||
description: 任务执行管理
|
||||
|
||||
paths:
|
||||
/data-collection/tasks:
|
||||
get:
|
||||
operationId: getTasks
|
||||
tags: [CollectionTask]
|
||||
summary: 获取归集任务列表
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
- name: status
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/TaskStatus'
|
||||
- name: name
|
||||
in: query
|
||||
description: 任务名称关键字搜索
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 归集任务列表
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PagedCollectionTaskSummary'
|
||||
|
||||
post:
|
||||
operationId: createTask
|
||||
tags: [CollectionTask]
|
||||
summary: 创建归集任务
|
||||
description: 创建新的数据归集任务
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateCollectionTaskRequest'
|
||||
responses:
|
||||
'201':
|
||||
description: 归集任务创建成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CollectionTaskResponse'
|
||||
|
||||
/data-collection/tasks/{id}:
|
||||
get:
|
||||
operationId: getTaskDetail
|
||||
tags: [CollectionTask]
|
||||
summary: 获取归集任务详情
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 归集任务详情
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CollectionTaskResponse'
|
||||
'404':
|
||||
description: 归集任务不存在
|
||||
|
||||
put:
|
||||
operationId: updateTask
|
||||
tags: [CollectionTask]
|
||||
summary: 更新归集任务
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateCollectionTaskRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 归集任务更新成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CollectionTaskResponse'
|
||||
|
||||
delete:
|
||||
operationId: deleteTask
|
||||
tags: [CollectionTask]
|
||||
summary: 删除归集任务
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'204':
|
||||
description: 归集任务删除成功
|
||||
|
||||
/tasks/{id}/execute:
|
||||
post:
|
||||
tags: [TaskExecution]
|
||||
summary: 执行归集任务
|
||||
description: 立即执行指定的归集任务
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'201':
|
||||
description: 任务执行已启动
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/TaskExecutionResponse'
|
||||
|
||||
/tasks/{id}/executions:
|
||||
get:
|
||||
tags: [TaskExecution]
|
||||
summary: 获取任务执行记录
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
responses:
|
||||
'200':
|
||||
description: 任务执行记录列表
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PagedTaskExecutions'
|
||||
|
||||
/executions/{id}:
|
||||
get:
|
||||
tags: [TaskExecution]
|
||||
summary: 获取执行详情
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 执行详情
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/TaskExecutionDetail'
|
||||
|
||||
delete:
|
||||
tags: [TaskExecution]
|
||||
summary: 停止任务执行
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'204':
|
||||
description: 任务执行已停止
|
||||
|
||||
/templates:
|
||||
get:
|
||||
tags: [CollectionTask]
|
||||
summary: 获取DataX模板列表
|
||||
description: 获取可用的DataX任务模板列表,用于创建任务时选择
|
||||
parameters:
|
||||
- name: sourceType
|
||||
in: query
|
||||
description: 源数据源类型过滤
|
||||
schema:
|
||||
type: string
|
||||
- name: targetType
|
||||
in: query
|
||||
description: 目标数据源类型过滤
|
||||
schema:
|
||||
type: string
|
||||
- name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
responses:
|
||||
'200':
|
||||
description: 归集模板列表
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PagedDataxTemplates'
|
||||
|
||||
components:
|
||||
schemas:
|
||||
TaskStatus:
|
||||
type: string
|
||||
enum:
|
||||
- DRAFT
|
||||
- READY
|
||||
- RUNNING
|
||||
- SUCCESS
|
||||
- FAILED
|
||||
- STOPPED
|
||||
description: |
|
||||
任务和执行状态枚举:
|
||||
- DRAFT: 草稿状态
|
||||
- READY: 就绪状态
|
||||
- RUNNING: 运行中
|
||||
- SUCCESS: 执行成功 (对应原来的COMPLETED/SUCCESS)
|
||||
- FAILED: 执行失败
|
||||
- STOPPED: 已停止
|
||||
|
||||
SyncMode:
|
||||
type: string
|
||||
enum: [ONCE, SCHEDULED]
|
||||
description: 同步方式:一次性(ONCE) 或 定时(SCHEDULED)
|
||||
|
||||
CollectionTaskSummary:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/TaskStatus'
|
||||
syncMode:
|
||||
$ref: '#/components/schemas/SyncMode'
|
||||
lastExecutionId:
|
||||
type: string
|
||||
description: 最后执行ID
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
updatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: 任务列表摘要信息(不包含详细配置与调度表达式)
|
||||
|
||||
CollectionTaskResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
config:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
description: 归集配置,包含源端和目标端配置信息
|
||||
status:
|
||||
$ref: '#/components/schemas/TaskStatus'
|
||||
syncMode:
|
||||
$ref: '#/components/schemas/SyncMode'
|
||||
scheduleExpression:
|
||||
type: string
|
||||
description: Cron调度表达式 (仅当 syncMode = SCHEDULED 时有效)
|
||||
lastExecutionId:
|
||||
type: string
|
||||
description: 最后执行ID
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
updatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
CreateCollectionTaskRequest:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- config
|
||||
- syncMode
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: 任务名称
|
||||
minLength: 1
|
||||
maxLength: 100
|
||||
description:
|
||||
type: string
|
||||
description: 任务描述
|
||||
maxLength: 500
|
||||
config:
|
||||
type: object
|
||||
description: 归集配置,包含源端和目标端配置信息
|
||||
additionalProperties: true
|
||||
syncMode:
|
||||
$ref: '#/components/schemas/SyncMode'
|
||||
scheduleExpression:
|
||||
type: string
|
||||
description: Cron调度表达式 (syncMode=SCHEDULED 时必填)
|
||||
|
||||
UpdateCollectionTaskRequest:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: 任务名称
|
||||
minLength: 1
|
||||
maxLength: 100
|
||||
description:
|
||||
type: string
|
||||
description: 任务描述
|
||||
maxLength: 500
|
||||
config:
|
||||
type: object
|
||||
description: 归集配置,包含源端和目标端配置信息
|
||||
additionalProperties: true
|
||||
syncMode:
|
||||
$ref: '#/components/schemas/SyncMode'
|
||||
scheduleExpression:
|
||||
type: string
|
||||
description: Cron调度表达式 (syncMode=SCHEDULED 时必填)
|
||||
|
||||
PagedCollectionTaskSummary:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CollectionTaskSummary'
|
||||
totalElements:
|
||||
type: integer
|
||||
totalPages:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
|
||||
PagedCollectionTasks:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CollectionTaskResponse'
|
||||
totalElements:
|
||||
type: integer
|
||||
totalPages:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
|
||||
TaskExecutionResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
taskId:
|
||||
type: string
|
||||
taskName:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/TaskStatus'
|
||||
startedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
TaskExecutionDetail:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
taskId:
|
||||
type: string
|
||||
taskName:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/TaskStatus'
|
||||
progress:
|
||||
type: number
|
||||
format: double
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
recordsTotal:
|
||||
type: integer
|
||||
recordsProcessed:
|
||||
type: integer
|
||||
recordsSuccess:
|
||||
type: integer
|
||||
recordsFailed:
|
||||
type: integer
|
||||
throughput:
|
||||
type: number
|
||||
format: double
|
||||
dataSizeBytes:
|
||||
type: integer
|
||||
startedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
completedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
durationSeconds:
|
||||
type: integer
|
||||
errorMessage:
|
||||
type: string
|
||||
|
||||
PagedTaskExecutions:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TaskExecutionDetail'
|
||||
totalElements:
|
||||
type: integer
|
||||
totalPages:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
|
||||
DataxTemplateSummary:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
sourceType:
|
||||
type: string
|
||||
description: 源数据源类型
|
||||
targetType:
|
||||
type: string
|
||||
description: 目标数据源类型
|
||||
description:
|
||||
type: string
|
||||
version:
|
||||
type: string
|
||||
isSystem:
|
||||
type: boolean
|
||||
description: 是否为系统模板
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
PagedDataxTemplates:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/DataxTemplateSummary'
|
||||
totalElements:
|
||||
type: integer
|
||||
totalPages:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
@@ -0,0 +1,630 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Data Evaluation Service API
|
||||
description: 数据评估服务API - 质量、适配性、价值评估
|
||||
version: 1.0.0
|
||||
contact:
|
||||
name: Data Mate Platform Team
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8086
|
||||
description: Development server
|
||||
|
||||
tags:
|
||||
- name: quality-evaluation
|
||||
description: 数据质量评估
|
||||
- name: compatibility-evaluation
|
||||
description: 适配性评估
|
||||
- name: value-evaluation
|
||||
description: 价值评估
|
||||
- name: evaluation-reports
|
||||
description: 评估报告
|
||||
|
||||
paths:
|
||||
/api/v1/evaluation/quality:
|
||||
post:
|
||||
tags:
|
||||
- quality-evaluation
|
||||
summary: 数据质量评估
|
||||
description: 对数据集进行质量评估,包括完整性、准确性、一致性等
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/QualityEvaluationRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 评估成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/QualityEvaluationResponse'
|
||||
|
||||
/api/v1/evaluation/quality/{evaluationId}:
|
||||
get:
|
||||
tags:
|
||||
- quality-evaluation
|
||||
summary: 获取质量评估结果
|
||||
parameters:
|
||||
- name: evaluationId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/QualityEvaluationDetailResponse'
|
||||
|
||||
/api/v1/evaluation/compatibility:
|
||||
post:
|
||||
tags:
|
||||
- compatibility-evaluation
|
||||
summary: 适配性评估
|
||||
description: 评估数据集与目标模型或任务的适配性
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CompatibilityEvaluationRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 评估成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CompatibilityEvaluationResponse'
|
||||
|
||||
/api/v1/evaluation/value:
|
||||
post:
|
||||
tags:
|
||||
- value-evaluation
|
||||
summary: 价值评估
|
||||
description: 评估数据集的商业价值和使用价值
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ValueEvaluationRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 评估成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ValueEvaluationResponse'
|
||||
|
||||
/api/v1/evaluation/reports:
|
||||
get:
|
||||
tags:
|
||||
- evaluation-reports
|
||||
summary: 获取评估报告列表
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
- name: type
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/EvaluationType'
|
||||
- name: datasetId
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EvaluationReportPageResponse'
|
||||
|
||||
/api/v1/evaluation/reports/{reportId}:
|
||||
get:
|
||||
tags:
|
||||
- evaluation-reports
|
||||
summary: 获取评估报告详情
|
||||
parameters:
|
||||
- name: reportId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EvaluationReportDetailResponse'
|
||||
|
||||
/api/v1/evaluation/reports/{reportId}/export:
|
||||
get:
|
||||
tags:
|
||||
- evaluation-reports
|
||||
summary: 导出评估报告
|
||||
parameters:
|
||||
- name: reportId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: format
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
enum: [PDF, EXCEL, JSON]
|
||||
default: PDF
|
||||
responses:
|
||||
'200':
|
||||
description: 导出成功
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
|
||||
/api/v1/evaluation/batch:
|
||||
post:
|
||||
tags:
|
||||
- evaluation-reports
|
||||
summary: 批量评估
|
||||
description: 对多个数据集进行批量评估
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BatchEvaluationRequest'
|
||||
responses:
|
||||
'202':
|
||||
description: 批量评估任务已提交
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BatchEvaluationResponse'
|
||||
|
||||
components:
|
||||
schemas:
|
||||
QualityEvaluationRequest:
|
||||
type: object
|
||||
required:
|
||||
- datasetId
|
||||
- metrics
|
||||
properties:
|
||||
datasetId:
|
||||
type: string
|
||||
description: 数据集ID
|
||||
metrics:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/QualityMetric'
|
||||
description: 评估指标
|
||||
sampleSize:
|
||||
type: integer
|
||||
description: 采样大小
|
||||
parameters:
|
||||
type: object
|
||||
description: 评估参数
|
||||
|
||||
QualityEvaluationResponse:
|
||||
type: object
|
||||
properties:
|
||||
evaluationId:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/EvaluationStatus'
|
||||
overallScore:
|
||||
type: number
|
||||
format: double
|
||||
description: 总体质量分数
|
||||
metrics:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/QualityMetricResult'
|
||||
recommendations:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
QualityEvaluationDetailResponse:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/QualityEvaluationResponse'
|
||||
- type: object
|
||||
properties:
|
||||
detailedResults:
|
||||
$ref: '#/components/schemas/DetailedQualityResults'
|
||||
visualizations:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/VisualizationData'
|
||||
|
||||
CompatibilityEvaluationRequest:
|
||||
type: object
|
||||
required:
|
||||
- datasetId
|
||||
- targetType
|
||||
properties:
|
||||
datasetId:
|
||||
type: string
|
||||
targetType:
|
||||
$ref: '#/components/schemas/TargetType'
|
||||
targetConfig:
|
||||
type: object
|
||||
description: 目标配置(模型、任务等)
|
||||
evaluationCriteria:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CompatibilityCriterion'
|
||||
|
||||
CompatibilityEvaluationResponse:
|
||||
type: object
|
||||
properties:
|
||||
evaluationId:
|
||||
type: string
|
||||
compatibilityScore:
|
||||
type: number
|
||||
format: double
|
||||
results:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CompatibilityResult'
|
||||
suggestions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
ValueEvaluationRequest:
|
||||
type: object
|
||||
required:
|
||||
- datasetId
|
||||
- valueCriteria
|
||||
properties:
|
||||
datasetId:
|
||||
type: string
|
||||
valueCriteria:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ValueCriterion'
|
||||
marketContext:
|
||||
type: object
|
||||
description: 市场环境信息
|
||||
businessContext:
|
||||
type: object
|
||||
description: 业务环境信息
|
||||
|
||||
ValueEvaluationResponse:
|
||||
type: object
|
||||
properties:
|
||||
evaluationId:
|
||||
type: string
|
||||
valueScore:
|
||||
type: number
|
||||
format: double
|
||||
monetaryValue:
|
||||
type: number
|
||||
format: double
|
||||
description: 货币价值估算
|
||||
strategicValue:
|
||||
type: number
|
||||
format: double
|
||||
description: 战略价值评分
|
||||
results:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ValueResult'
|
||||
insights:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
|
||||
EvaluationReportResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
datasetId:
|
||||
type: string
|
||||
type:
|
||||
$ref: '#/components/schemas/EvaluationType'
|
||||
status:
|
||||
$ref: '#/components/schemas/EvaluationStatus'
|
||||
overallScore:
|
||||
type: number
|
||||
format: double
|
||||
summary:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
completedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
EvaluationReportPageResponse:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/EvaluationReportResponse'
|
||||
totalElements:
|
||||
type: integer
|
||||
format: int64
|
||||
totalPages:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
|
||||
EvaluationReportDetailResponse:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/EvaluationReportResponse'
|
||||
- type: object
|
||||
properties:
|
||||
qualityResults:
|
||||
$ref: '#/components/schemas/QualityEvaluationResponse'
|
||||
compatibilityResults:
|
||||
$ref: '#/components/schemas/CompatibilityEvaluationResponse'
|
||||
valueResults:
|
||||
$ref: '#/components/schemas/ValueEvaluationResponse'
|
||||
attachments:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ReportAttachment'
|
||||
|
||||
BatchEvaluationRequest:
|
||||
type: object
|
||||
required:
|
||||
- datasetIds
|
||||
- evaluationTypes
|
||||
properties:
|
||||
datasetIds:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
evaluationTypes:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/EvaluationType'
|
||||
parameters:
|
||||
type: object
|
||||
|
||||
BatchEvaluationResponse:
|
||||
type: object
|
||||
properties:
|
||||
batchId:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
totalTasks:
|
||||
type: integer
|
||||
submittedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
QualityMetric:
|
||||
type: string
|
||||
enum:
|
||||
- COMPLETENESS
|
||||
- ACCURACY
|
||||
- CONSISTENCY
|
||||
- VALIDITY
|
||||
- UNIQUENESS
|
||||
- TIMELINESS
|
||||
|
||||
QualityMetricResult:
|
||||
type: object
|
||||
properties:
|
||||
metric:
|
||||
$ref: '#/components/schemas/QualityMetric'
|
||||
score:
|
||||
type: number
|
||||
format: double
|
||||
details:
|
||||
type: object
|
||||
issues:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/QualityIssue'
|
||||
|
||||
DetailedQualityResults:
|
||||
type: object
|
||||
properties:
|
||||
fieldAnalysis:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/FieldAnalysis'
|
||||
distributionAnalysis:
|
||||
$ref: '#/components/schemas/DistributionAnalysis'
|
||||
correlationAnalysis:
|
||||
$ref: '#/components/schemas/CorrelationAnalysis'
|
||||
|
||||
TargetType:
|
||||
type: string
|
||||
enum:
|
||||
- LANGUAGE_MODEL
|
||||
- CLASSIFICATION_MODEL
|
||||
- RECOMMENDATION_SYSTEM
|
||||
- CUSTOM_TASK
|
||||
|
||||
CompatibilityCriterion:
|
||||
type: string
|
||||
enum:
|
||||
- FORMAT_COMPATIBILITY
|
||||
- SCHEMA_COMPATIBILITY
|
||||
- SIZE_ADEQUACY
|
||||
- DISTRIBUTION_MATCH
|
||||
- FEATURE_COVERAGE
|
||||
|
||||
CompatibilityResult:
|
||||
type: object
|
||||
properties:
|
||||
criterion:
|
||||
$ref: '#/components/schemas/CompatibilityCriterion'
|
||||
score:
|
||||
type: number
|
||||
format: double
|
||||
status:
|
||||
type: string
|
||||
enum: [PASS, WARN, FAIL]
|
||||
details:
|
||||
type: string
|
||||
|
||||
ValueCriterion:
|
||||
type: string
|
||||
enum:
|
||||
- RARITY
|
||||
- DEMAND
|
||||
- QUALITY
|
||||
- COMPLETENESS
|
||||
- TIMELINESS
|
||||
- STRATEGIC_IMPORTANCE
|
||||
|
||||
ValueResult:
|
||||
type: object
|
||||
properties:
|
||||
criterion:
|
||||
$ref: '#/components/schemas/ValueCriterion'
|
||||
score:
|
||||
type: number
|
||||
format: double
|
||||
impact:
|
||||
type: string
|
||||
enum: [LOW, MEDIUM, HIGH]
|
||||
explanation:
|
||||
type: string
|
||||
|
||||
EvaluationType:
|
||||
type: string
|
||||
enum:
|
||||
- QUALITY
|
||||
- COMPATIBILITY
|
||||
- VALUE
|
||||
- COMPREHENSIVE
|
||||
|
||||
EvaluationStatus:
|
||||
type: string
|
||||
enum:
|
||||
- PENDING
|
||||
- RUNNING
|
||||
- COMPLETED
|
||||
- FAILED
|
||||
|
||||
QualityIssue:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
severity:
|
||||
type: string
|
||||
enum: [LOW, MEDIUM, HIGH, CRITICAL]
|
||||
description:
|
||||
type: string
|
||||
affectedRecords:
|
||||
type: integer
|
||||
suggestions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
|
||||
FieldAnalysis:
|
||||
type: object
|
||||
properties:
|
||||
fieldName:
|
||||
type: string
|
||||
dataType:
|
||||
type: string
|
||||
nullCount:
|
||||
type: integer
|
||||
uniqueCount:
|
||||
type: integer
|
||||
statistics:
|
||||
type: object
|
||||
|
||||
DistributionAnalysis:
|
||||
type: object
|
||||
properties:
|
||||
distributions:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
outliers:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
patterns:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
|
||||
CorrelationAnalysis:
|
||||
type: object
|
||||
properties:
|
||||
correlationMatrix:
|
||||
type: array
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
type: number
|
||||
significantCorrelations:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
|
||||
VisualizationData:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [CHART, GRAPH, HISTOGRAM, HEATMAP]
|
||||
title:
|
||||
type: string
|
||||
data:
|
||||
type: object
|
||||
config:
|
||||
type: object
|
||||
|
||||
ReportAttachment:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
size:
|
||||
type: integer
|
||||
format: int64
|
||||
downloadUrl:
|
||||
type: string
|
||||
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
|
||||
security:
|
||||
- BearerAuth: []
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,620 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Data Synthesis Service API
|
||||
description: 数据合成服务API - 指令、COT蒸馏、多模态合成
|
||||
version: 1.0.0
|
||||
contact:
|
||||
name: Data Mate Platform Team
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8085
|
||||
description: Development server
|
||||
|
||||
tags:
|
||||
- name: synthesis-templates
|
||||
description: 合成模板管理
|
||||
- name: synthesis-jobs
|
||||
description: 合成任务管理
|
||||
- name: instruction-tuning
|
||||
description: 指令调优
|
||||
- name: cot-distillation
|
||||
description: COT蒸馏
|
||||
|
||||
paths:
|
||||
/api/v1/synthesis/templates:
|
||||
get:
|
||||
tags:
|
||||
- synthesis-templates
|
||||
summary: 获取合成模板列表
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
- name: type
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/SynthesisType'
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SynthesisTemplatePageResponse'
|
||||
|
||||
post:
|
||||
tags:
|
||||
- synthesis-templates
|
||||
summary: 创建合成模板
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateSynthesisTemplateRequest'
|
||||
responses:
|
||||
'201':
|
||||
description: 创建成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SynthesisTemplateResponse'
|
||||
|
||||
/api/v1/synthesis/templates/{templateId}:
|
||||
get:
|
||||
tags:
|
||||
- synthesis-templates
|
||||
summary: 获取合成模板详情
|
||||
parameters:
|
||||
- name: templateId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SynthesisTemplateDetailResponse'
|
||||
|
||||
put:
|
||||
tags:
|
||||
- synthesis-templates
|
||||
summary: 更新合成模板
|
||||
parameters:
|
||||
- name: templateId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateSynthesisTemplateRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 更新成功
|
||||
|
||||
/api/v1/synthesis/jobs:
|
||||
get:
|
||||
tags:
|
||||
- synthesis-jobs
|
||||
summary: 获取合成任务列表
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
- name: status
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobStatus'
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SynthesisJobPageResponse'
|
||||
|
||||
post:
|
||||
tags:
|
||||
- synthesis-jobs
|
||||
summary: 创建合成任务
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateSynthesisJobRequest'
|
||||
responses:
|
||||
'201':
|
||||
description: 任务创建成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SynthesisJobResponse'
|
||||
|
||||
/api/v1/synthesis/jobs/{jobId}:
|
||||
get:
|
||||
tags:
|
||||
- synthesis-jobs
|
||||
summary: 获取合成任务详情
|
||||
parameters:
|
||||
- name: jobId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SynthesisJobDetailResponse'
|
||||
|
||||
/api/v1/synthesis/jobs/{jobId}/execute:
|
||||
post:
|
||||
tags:
|
||||
- synthesis-jobs
|
||||
summary: 执行合成任务
|
||||
parameters:
|
||||
- name: jobId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 任务开始执行
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobExecutionResponse'
|
||||
|
||||
/api/v1/synthesis/instruction-tuning:
|
||||
post:
|
||||
tags:
|
||||
- instruction-tuning
|
||||
summary: 指令调优数据合成
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InstructionTuningRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 合成成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InstructionTuningResponse'
|
||||
|
||||
/api/v1/synthesis/cot-distillation:
|
||||
post:
|
||||
tags:
|
||||
- cot-distillation
|
||||
summary: COT蒸馏数据合成
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/COTDistillationRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 蒸馏成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/COTDistillationResponse'
|
||||
|
||||
components:
|
||||
schemas:
|
||||
SynthesisTemplateResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
type:
|
||||
$ref: '#/components/schemas/SynthesisType'
|
||||
category:
|
||||
type: string
|
||||
modelConfig:
|
||||
$ref: '#/components/schemas/ModelConfig'
|
||||
enabled:
|
||||
type: boolean
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
SynthesisTemplateDetailResponse:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/SynthesisTemplateResponse'
|
||||
- type: object
|
||||
properties:
|
||||
promptTemplate:
|
||||
type: string
|
||||
parameters:
|
||||
type: object
|
||||
examples:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/SynthesisExample'
|
||||
|
||||
SynthesisTemplatePageResponse:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/SynthesisTemplateResponse'
|
||||
totalElements:
|
||||
type: integer
|
||||
format: int64
|
||||
totalPages:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
|
||||
CreateSynthesisTemplateRequest:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
- promptTemplate
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
type:
|
||||
$ref: '#/components/schemas/SynthesisType'
|
||||
category:
|
||||
type: string
|
||||
promptTemplate:
|
||||
type: string
|
||||
modelConfig:
|
||||
$ref: '#/components/schemas/ModelConfig'
|
||||
parameters:
|
||||
type: object
|
||||
|
||||
UpdateSynthesisTemplateRequest:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
promptTemplate:
|
||||
type: string
|
||||
enabled:
|
||||
type: boolean
|
||||
parameters:
|
||||
type: object
|
||||
|
||||
SynthesisJobResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
templateId:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/JobStatus'
|
||||
progress:
|
||||
type: number
|
||||
format: double
|
||||
targetCount:
|
||||
type: integer
|
||||
generatedCount:
|
||||
type: integer
|
||||
startTime:
|
||||
type: string
|
||||
format: date-time
|
||||
endTime:
|
||||
type: string
|
||||
format: date-time
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
SynthesisJobDetailResponse:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/SynthesisJobResponse'
|
||||
- type: object
|
||||
properties:
|
||||
template:
|
||||
$ref: '#/components/schemas/SynthesisTemplateResponse'
|
||||
statistics:
|
||||
$ref: '#/components/schemas/SynthesisStatistics'
|
||||
samples:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/GeneratedSample'
|
||||
|
||||
SynthesisJobPageResponse:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/SynthesisJobResponse'
|
||||
totalElements:
|
||||
type: integer
|
||||
format: int64
|
||||
totalPages:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
|
||||
CreateSynthesisJobRequest:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- templateId
|
||||
- targetCount
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
templateId:
|
||||
type: string
|
||||
targetCount:
|
||||
type: integer
|
||||
parameters:
|
||||
type: object
|
||||
seedData:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
|
||||
JobExecutionResponse:
|
||||
type: object
|
||||
properties:
|
||||
executionId:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
|
||||
InstructionTuningRequest:
|
||||
type: object
|
||||
required:
|
||||
- baseInstructions
|
||||
- targetDomain
|
||||
- count
|
||||
properties:
|
||||
baseInstructions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
targetDomain:
|
||||
type: string
|
||||
count:
|
||||
type: integer
|
||||
modelConfig:
|
||||
$ref: '#/components/schemas/ModelConfig'
|
||||
parameters:
|
||||
type: object
|
||||
|
||||
InstructionTuningResponse:
|
||||
type: object
|
||||
properties:
|
||||
jobId:
|
||||
type: string
|
||||
generatedInstructions:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/GeneratedInstruction'
|
||||
statistics:
|
||||
$ref: '#/components/schemas/GenerationStatistics'
|
||||
|
||||
COTDistillationRequest:
|
||||
type: object
|
||||
required:
|
||||
- sourceModel
|
||||
- targetFormat
|
||||
- examples
|
||||
properties:
|
||||
sourceModel:
|
||||
type: string
|
||||
targetFormat:
|
||||
type: string
|
||||
enum: [QA, INSTRUCTION, REASONING]
|
||||
examples:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/COTExample'
|
||||
parameters:
|
||||
type: object
|
||||
|
||||
COTDistillationResponse:
|
||||
type: object
|
||||
properties:
|
||||
jobId:
|
||||
type: string
|
||||
distilledData:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/DistilledCOTData'
|
||||
statistics:
|
||||
$ref: '#/components/schemas/DistillationStatistics'
|
||||
|
||||
SynthesisType:
|
||||
type: string
|
||||
enum:
|
||||
- INSTRUCTION_TUNING
|
||||
- COT_DISTILLATION
|
||||
- DIALOGUE_GENERATION
|
||||
- TEXT_AUGMENTATION
|
||||
- MULTIMODAL_SYNTHESIS
|
||||
- CUSTOM
|
||||
|
||||
JobStatus:
|
||||
type: string
|
||||
enum:
|
||||
- PENDING
|
||||
- RUNNING
|
||||
- COMPLETED
|
||||
- FAILED
|
||||
- CANCELLED
|
||||
|
||||
ModelConfig:
|
||||
type: object
|
||||
properties:
|
||||
modelName:
|
||||
type: string
|
||||
temperature:
|
||||
type: number
|
||||
format: double
|
||||
maxTokens:
|
||||
type: integer
|
||||
topP:
|
||||
type: number
|
||||
format: double
|
||||
frequencyPenalty:
|
||||
type: number
|
||||
format: double
|
||||
|
||||
SynthesisExample:
|
||||
type: object
|
||||
properties:
|
||||
input:
|
||||
type: string
|
||||
output:
|
||||
type: string
|
||||
explanation:
|
||||
type: string
|
||||
|
||||
SynthesisStatistics:
|
||||
type: object
|
||||
properties:
|
||||
totalGenerated:
|
||||
type: integer
|
||||
successfulGenerated:
|
||||
type: integer
|
||||
failedGenerated:
|
||||
type: integer
|
||||
averageLength:
|
||||
type: number
|
||||
format: double
|
||||
uniqueCount:
|
||||
type: integer
|
||||
|
||||
GeneratedSample:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
content:
|
||||
type: string
|
||||
score:
|
||||
type: number
|
||||
format: double
|
||||
metadata:
|
||||
type: object
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
GeneratedInstruction:
|
||||
type: object
|
||||
properties:
|
||||
instruction:
|
||||
type: string
|
||||
input:
|
||||
type: string
|
||||
output:
|
||||
type: string
|
||||
quality:
|
||||
type: number
|
||||
format: double
|
||||
|
||||
GenerationStatistics:
|
||||
type: object
|
||||
properties:
|
||||
totalGenerated:
|
||||
type: integer
|
||||
averageQuality:
|
||||
type: number
|
||||
format: double
|
||||
diversityScore:
|
||||
type: number
|
||||
format: double
|
||||
|
||||
COTExample:
|
||||
type: object
|
||||
properties:
|
||||
question:
|
||||
type: string
|
||||
reasoning:
|
||||
type: string
|
||||
answer:
|
||||
type: string
|
||||
|
||||
DistilledCOTData:
|
||||
type: object
|
||||
properties:
|
||||
question:
|
||||
type: string
|
||||
reasoning:
|
||||
type: string
|
||||
answer:
|
||||
type: string
|
||||
confidence:
|
||||
type: number
|
||||
format: double
|
||||
|
||||
DistillationStatistics:
|
||||
type: object
|
||||
properties:
|
||||
totalProcessed:
|
||||
type: integer
|
||||
successfulDistilled:
|
||||
type: integer
|
||||
averageConfidence:
|
||||
type: number
|
||||
format: double
|
||||
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
|
||||
security:
|
||||
- BearerAuth: []
|
||||
@@ -0,0 +1,712 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Execution Engine Service API
|
||||
description: 执行引擎服务API - 与Ray/DataX/Python执行器对接
|
||||
version: 1.0.0
|
||||
contact:
|
||||
name: Data Mate Platform Team
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8088
|
||||
description: Development server
|
||||
|
||||
tags:
|
||||
- name: jobs
|
||||
description: 作业管理
|
||||
- name: executors
|
||||
description: 执行器管理
|
||||
- name: resources
|
||||
description: 资源管理
|
||||
- name: monitoring
|
||||
description: 监控管理
|
||||
|
||||
paths:
|
||||
/api/v1/jobs:
|
||||
get:
|
||||
tags:
|
||||
- jobs
|
||||
summary: 获取作业列表
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
- name: status
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobStatus'
|
||||
- name: executor
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/ExecutorType'
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobPageResponse'
|
||||
|
||||
post:
|
||||
tags:
|
||||
- jobs
|
||||
summary: 提交作业
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SubmitJobRequest'
|
||||
responses:
|
||||
'201':
|
||||
description: 作业提交成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobResponse'
|
||||
|
||||
/api/v1/jobs/{jobId}:
|
||||
get:
|
||||
tags:
|
||||
- jobs
|
||||
summary: 获取作业详情
|
||||
parameters:
|
||||
- name: jobId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobDetailResponse'
|
||||
|
||||
delete:
|
||||
tags:
|
||||
- jobs
|
||||
summary: 取消作业
|
||||
parameters:
|
||||
- name: jobId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 取消成功
|
||||
|
||||
/api/v1/jobs/{jobId}/logs:
|
||||
get:
|
||||
tags:
|
||||
- jobs
|
||||
summary: 获取作业日志
|
||||
parameters:
|
||||
- name: jobId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: follow
|
||||
in: query
|
||||
description: 是否实时跟踪日志
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/JobLog'
|
||||
|
||||
/api/v1/jobs/{jobId}/retry:
|
||||
post:
|
||||
tags:
|
||||
- jobs
|
||||
summary: 重试作业
|
||||
parameters:
|
||||
- name: jobId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 重试成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobResponse'
|
||||
|
||||
/api/v1/executors:
|
||||
get:
|
||||
tags:
|
||||
- executors
|
||||
summary: 获取执行器列表
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ExecutorResponse'
|
||||
|
||||
post:
|
||||
tags:
|
||||
- executors
|
||||
summary: 注册执行器
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RegisterExecutorRequest'
|
||||
responses:
|
||||
'201':
|
||||
description: 注册成功
|
||||
|
||||
/api/v1/executors/{executorId}:
|
||||
get:
|
||||
tags:
|
||||
- executors
|
||||
summary: 获取执行器详情
|
||||
parameters:
|
||||
- name: executorId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ExecutorDetailResponse'
|
||||
|
||||
put:
|
||||
tags:
|
||||
- executors
|
||||
summary: 更新执行器
|
||||
parameters:
|
||||
- name: executorId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateExecutorRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 更新成功
|
||||
|
||||
/api/v1/resources/clusters:
|
||||
get:
|
||||
tags:
|
||||
- resources
|
||||
summary: 获取集群信息
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ClusterInfo'
|
||||
|
||||
/api/v1/resources/nodes:
|
||||
get:
|
||||
tags:
|
||||
- resources
|
||||
summary: 获取节点信息
|
||||
parameters:
|
||||
- name: clusterId
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/NodeInfo'
|
||||
|
||||
/api/v1/monitoring/metrics:
|
||||
get:
|
||||
tags:
|
||||
- monitoring
|
||||
summary: 获取监控指标
|
||||
parameters:
|
||||
- name: metric
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: start
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- name: end
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/MetricsResponse'
|
||||
|
||||
components:
|
||||
schemas:
|
||||
JobResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/JobStatus'
|
||||
executorType:
|
||||
$ref: '#/components/schemas/ExecutorType'
|
||||
priority:
|
||||
type: integer
|
||||
progress:
|
||||
type: number
|
||||
format: double
|
||||
submittedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
startedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
completedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
submittedBy:
|
||||
type: string
|
||||
|
||||
JobDetailResponse:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/JobResponse'
|
||||
- type: object
|
||||
properties:
|
||||
configuration:
|
||||
$ref: '#/components/schemas/JobConfiguration'
|
||||
resources:
|
||||
$ref: '#/components/schemas/ResourceRequirement'
|
||||
metrics:
|
||||
$ref: '#/components/schemas/JobMetrics'
|
||||
artifacts:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/JobArtifact'
|
||||
dependencies:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
|
||||
JobPageResponse:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/JobResponse'
|
||||
totalElements:
|
||||
type: integer
|
||||
format: int64
|
||||
totalPages:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
|
||||
SubmitJobRequest:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- executorType
|
||||
- configuration
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
executorType:
|
||||
$ref: '#/components/schemas/ExecutorType'
|
||||
priority:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 10
|
||||
default: 5
|
||||
configuration:
|
||||
$ref: '#/components/schemas/JobConfiguration'
|
||||
resources:
|
||||
$ref: '#/components/schemas/ResourceRequirement'
|
||||
dependencies:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
timeoutSeconds:
|
||||
type: integer
|
||||
|
||||
JobConfiguration:
|
||||
type: object
|
||||
properties:
|
||||
script:
|
||||
type: string
|
||||
description: 执行脚本或代码
|
||||
arguments:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: 执行参数
|
||||
environment:
|
||||
type: object
|
||||
description: 环境变量
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/FileReference'
|
||||
packages:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: 依赖包列表
|
||||
|
||||
ResourceRequirement:
|
||||
type: object
|
||||
properties:
|
||||
cpuCores:
|
||||
type: number
|
||||
format: double
|
||||
memoryGB:
|
||||
type: number
|
||||
format: double
|
||||
gpuCount:
|
||||
type: integer
|
||||
diskGB:
|
||||
type: number
|
||||
format: double
|
||||
nodeSelector:
|
||||
type: object
|
||||
description: 节点选择器
|
||||
|
||||
ExecutorResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
type:
|
||||
$ref: '#/components/schemas/ExecutorType'
|
||||
status:
|
||||
$ref: '#/components/schemas/ExecutorStatus'
|
||||
version:
|
||||
type: string
|
||||
capabilities:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
registeredAt:
|
||||
type: string
|
||||
format: date-time
|
||||
lastHeartbeat:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
ExecutorDetailResponse:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/ExecutorResponse'
|
||||
- type: object
|
||||
properties:
|
||||
configuration:
|
||||
type: object
|
||||
resources:
|
||||
$ref: '#/components/schemas/ExecutorResources'
|
||||
currentJobs:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/JobResponse'
|
||||
statistics:
|
||||
$ref: '#/components/schemas/ExecutorStatistics'
|
||||
|
||||
RegisterExecutorRequest:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
- endpoint
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
type:
|
||||
$ref: '#/components/schemas/ExecutorType'
|
||||
endpoint:
|
||||
type: string
|
||||
capabilities:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
configuration:
|
||||
type: object
|
||||
|
||||
UpdateExecutorRequest:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/components/schemas/ExecutorStatus'
|
||||
configuration:
|
||||
type: object
|
||||
|
||||
ClusterInfo:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
enum: [RAY, KUBERNETES, YARN, STANDALONE]
|
||||
status:
|
||||
type: string
|
||||
enum: [ACTIVE, INACTIVE, ERROR]
|
||||
nodeCount:
|
||||
type: integer
|
||||
totalCpuCores:
|
||||
type: integer
|
||||
totalMemoryGB:
|
||||
type: number
|
||||
format: double
|
||||
totalGpuCount:
|
||||
type: integer
|
||||
availableResources:
|
||||
$ref: '#/components/schemas/ResourceInfo'
|
||||
|
||||
NodeInfo:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
clusterId:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
enum: [ACTIVE, INACTIVE, BUSY, ERROR]
|
||||
resources:
|
||||
$ref: '#/components/schemas/ResourceInfo'
|
||||
usage:
|
||||
$ref: '#/components/schemas/ResourceUsage'
|
||||
lastUpdate:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
MetricsResponse:
|
||||
type: object
|
||||
properties:
|
||||
metric:
|
||||
type: string
|
||||
dataPoints:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/MetricDataPoint'
|
||||
aggregation:
|
||||
type: object
|
||||
|
||||
JobLog:
|
||||
type: object
|
||||
properties:
|
||||
timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
level:
|
||||
type: string
|
||||
enum: [DEBUG, INFO, WARN, ERROR]
|
||||
source:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
|
||||
JobMetrics:
|
||||
type: object
|
||||
properties:
|
||||
cpuUsage:
|
||||
type: number
|
||||
format: double
|
||||
memoryUsage:
|
||||
type: number
|
||||
format: double
|
||||
diskUsage:
|
||||
type: number
|
||||
format: double
|
||||
networkIO:
|
||||
type: object
|
||||
duration:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
JobArtifact:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
enum: [LOG, OUTPUT, CHECKPOINT, MODEL]
|
||||
size:
|
||||
type: integer
|
||||
format: int64
|
||||
path:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
FileReference:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
path:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
enum: [LOCAL, HDFS, S3, HTTP]
|
||||
|
||||
ExecutorResources:
|
||||
type: object
|
||||
properties:
|
||||
total:
|
||||
$ref: '#/components/schemas/ResourceInfo'
|
||||
available:
|
||||
$ref: '#/components/schemas/ResourceInfo'
|
||||
allocated:
|
||||
$ref: '#/components/schemas/ResourceInfo'
|
||||
|
||||
ExecutorStatistics:
|
||||
type: object
|
||||
properties:
|
||||
totalJobs:
|
||||
type: integer
|
||||
successfulJobs:
|
||||
type: integer
|
||||
failedJobs:
|
||||
type: integer
|
||||
averageExecutionTime:
|
||||
type: number
|
||||
format: double
|
||||
uptime:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
ResourceInfo:
|
||||
type: object
|
||||
properties:
|
||||
cpuCores:
|
||||
type: number
|
||||
format: double
|
||||
memoryGB:
|
||||
type: number
|
||||
format: double
|
||||
gpuCount:
|
||||
type: integer
|
||||
diskGB:
|
||||
type: number
|
||||
format: double
|
||||
|
||||
ResourceUsage:
|
||||
type: object
|
||||
properties:
|
||||
cpuUsagePercent:
|
||||
type: number
|
||||
format: double
|
||||
memoryUsagePercent:
|
||||
type: number
|
||||
format: double
|
||||
diskUsagePercent:
|
||||
type: number
|
||||
format: double
|
||||
|
||||
MetricDataPoint:
|
||||
type: object
|
||||
properties:
|
||||
timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
value:
|
||||
type: number
|
||||
format: double
|
||||
tags:
|
||||
type: object
|
||||
|
||||
JobStatus:
|
||||
type: string
|
||||
enum:
|
||||
- SUBMITTED
|
||||
- PENDING
|
||||
- RUNNING
|
||||
- COMPLETED
|
||||
- FAILED
|
||||
- CANCELLED
|
||||
- TIMEOUT
|
||||
|
||||
ExecutorType:
|
||||
type: string
|
||||
enum:
|
||||
- RAY
|
||||
- DATAX
|
||||
- PYTHON
|
||||
- SPARK
|
||||
- FLINK
|
||||
- CUSTOM
|
||||
|
||||
ExecutorStatus:
|
||||
type: string
|
||||
enum:
|
||||
- ACTIVE
|
||||
- INACTIVE
|
||||
- BUSY
|
||||
- ERROR
|
||||
- MAINTENANCE
|
||||
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
|
||||
security:
|
||||
- BearerAuth: []
|
||||
@@ -0,0 +1,551 @@
|
||||
openapi: "3.0.1"
|
||||
info:
|
||||
title: "API Documentation"
|
||||
version: "1.0"
|
||||
paths:
|
||||
/operators/list:
|
||||
post:
|
||||
summary: "operatorsListPost"
|
||||
description: "operatorsListPost"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
page:
|
||||
type: "integer"
|
||||
description: ""
|
||||
size:
|
||||
type: "integer"
|
||||
description: ""
|
||||
categories:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "integer"
|
||||
default: "new ArrayList<>()"
|
||||
operatorName:
|
||||
type: "string"
|
||||
description: ""
|
||||
labelName:
|
||||
type: "string"
|
||||
description: ""
|
||||
isStar:
|
||||
type: "boolean"
|
||||
description: ""
|
||||
description: ""
|
||||
responses:
|
||||
"200":
|
||||
description: ""
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
page:
|
||||
type: "integer"
|
||||
description: ""
|
||||
format: "int64"
|
||||
size:
|
||||
type: "integer"
|
||||
description: ""
|
||||
format: "int64"
|
||||
totalElements:
|
||||
type: "integer"
|
||||
description: ""
|
||||
format: "int64"
|
||||
totalPages:
|
||||
type: "integer"
|
||||
description: ""
|
||||
format: "int64"
|
||||
content:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
description: ""
|
||||
name:
|
||||
type: "string"
|
||||
description: ""
|
||||
description:
|
||||
type: "string"
|
||||
description: ""
|
||||
version:
|
||||
type: "string"
|
||||
description: ""
|
||||
inputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
outputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
categories:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "string"
|
||||
runtime:
|
||||
type: "string"
|
||||
description: ""
|
||||
settings:
|
||||
type: "string"
|
||||
description: ""
|
||||
fileName:
|
||||
type: "string"
|
||||
description: ""
|
||||
isStar:
|
||||
type: "boolean"
|
||||
description: ""
|
||||
createdAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
updatedAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
description: "OperatorDto"
|
||||
/operators/{id}:
|
||||
get:
|
||||
summary: "operatorsIdGet"
|
||||
description: "operatorsIdGet"
|
||||
parameters:
|
||||
- name: "id"
|
||||
in: "path"
|
||||
description: ""
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
responses:
|
||||
"200":
|
||||
description: ""
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
description: ""
|
||||
name:
|
||||
type: "string"
|
||||
description: ""
|
||||
description:
|
||||
type: "string"
|
||||
description: ""
|
||||
version:
|
||||
type: "string"
|
||||
description: ""
|
||||
inputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
outputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
categories:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "string"
|
||||
runtime:
|
||||
type: "string"
|
||||
description: ""
|
||||
settings:
|
||||
type: "string"
|
||||
description: ""
|
||||
fileName:
|
||||
type: "string"
|
||||
description: ""
|
||||
isStar:
|
||||
type: "boolean"
|
||||
description: ""
|
||||
createdAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
updatedAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
put:
|
||||
summary: "operatorsIdPut"
|
||||
description: "operatorsIdPut"
|
||||
parameters:
|
||||
- name: "id"
|
||||
in: "path"
|
||||
description: ""
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
description: ""
|
||||
name:
|
||||
type: "string"
|
||||
description: ""
|
||||
description:
|
||||
type: "string"
|
||||
description: ""
|
||||
version:
|
||||
type: "string"
|
||||
description: ""
|
||||
inputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
outputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
categories:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "string"
|
||||
runtime:
|
||||
type: "string"
|
||||
description: ""
|
||||
settings:
|
||||
type: "string"
|
||||
description: ""
|
||||
fileName:
|
||||
type: "string"
|
||||
description: ""
|
||||
isStar:
|
||||
type: "boolean"
|
||||
description: ""
|
||||
createdAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
updatedAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
description: ""
|
||||
responses:
|
||||
"200":
|
||||
description: ""
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
description: ""
|
||||
name:
|
||||
type: "string"
|
||||
description: ""
|
||||
description:
|
||||
type: "string"
|
||||
description: ""
|
||||
version:
|
||||
type: "string"
|
||||
description: ""
|
||||
inputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
outputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
categories:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "string"
|
||||
runtime:
|
||||
type: "string"
|
||||
description: ""
|
||||
settings:
|
||||
type: "string"
|
||||
description: ""
|
||||
fileName:
|
||||
type: "string"
|
||||
description: ""
|
||||
isStar:
|
||||
type: "boolean"
|
||||
description: ""
|
||||
createdAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
updatedAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
/operators/create:
|
||||
post:
|
||||
summary: "operatorsCreatePost"
|
||||
description: "operatorsCreatePost"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
description: ""
|
||||
name:
|
||||
type: "string"
|
||||
description: ""
|
||||
description:
|
||||
type: "string"
|
||||
description: ""
|
||||
version:
|
||||
type: "string"
|
||||
description: ""
|
||||
inputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
outputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
categories:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "string"
|
||||
runtime:
|
||||
type: "string"
|
||||
description: ""
|
||||
settings:
|
||||
type: "string"
|
||||
description: ""
|
||||
fileName:
|
||||
type: "string"
|
||||
description: ""
|
||||
isStar:
|
||||
type: "boolean"
|
||||
description: ""
|
||||
createdAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
updatedAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
description: ""
|
||||
responses:
|
||||
"200":
|
||||
description: ""
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
description: ""
|
||||
name:
|
||||
type: "string"
|
||||
description: ""
|
||||
description:
|
||||
type: "string"
|
||||
description: ""
|
||||
version:
|
||||
type: "string"
|
||||
description: ""
|
||||
inputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
outputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
categories:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "string"
|
||||
runtime:
|
||||
type: "string"
|
||||
description: ""
|
||||
settings:
|
||||
type: "string"
|
||||
description: ""
|
||||
fileName:
|
||||
type: "string"
|
||||
description: ""
|
||||
isStar:
|
||||
type: "boolean"
|
||||
description: ""
|
||||
createdAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
updatedAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
/operators/upload:
|
||||
post:
|
||||
summary: "operatorsUploadPost"
|
||||
description: "operatorsUploadPost"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
reqId:
|
||||
type: "string"
|
||||
description: "预上传返回的id,用来确认同一个任务"
|
||||
fileNo:
|
||||
type: "integer"
|
||||
description: "文件编号,用于标识批量上传中的第几个文件"
|
||||
fileName:
|
||||
type: "string"
|
||||
description: "文件名称"
|
||||
totalChunkNum:
|
||||
type: "integer"
|
||||
description: "文件总分块数量"
|
||||
chunkNo:
|
||||
type: "integer"
|
||||
description: "当前分块编号,从1开始"
|
||||
file:
|
||||
type: "string"
|
||||
description: "上传的文件分块内容"
|
||||
checkSumHex:
|
||||
type: "string"
|
||||
description: "文件分块的校验和(十六进制字符串),用于验证文件完整性"
|
||||
description: ""
|
||||
responses:
|
||||
"200":
|
||||
description: ""
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
description: ""
|
||||
name:
|
||||
type: "string"
|
||||
description: ""
|
||||
description:
|
||||
type: "string"
|
||||
description: ""
|
||||
version:
|
||||
type: "string"
|
||||
description: ""
|
||||
inputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
outputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
categories:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "string"
|
||||
runtime:
|
||||
type: "string"
|
||||
description: ""
|
||||
settings:
|
||||
type: "string"
|
||||
description: ""
|
||||
fileName:
|
||||
type: "string"
|
||||
description: ""
|
||||
isStar:
|
||||
type: "boolean"
|
||||
description: ""
|
||||
createdAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
updatedAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
/operators/upload/pre-upload:
|
||||
post:
|
||||
summary: "preUpload"
|
||||
description: "preUpload"
|
||||
responses:
|
||||
"200":
|
||||
description: ""
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "string"
|
||||
/operators/upload/chunk:
|
||||
post:
|
||||
summary: "chunkUpload"
|
||||
description: "chunkUpload"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
reqId:
|
||||
type: "string"
|
||||
description: "预上传返回的id,用来确认同一个任务"
|
||||
fileNo:
|
||||
type: "integer"
|
||||
description: "文件编号,用于标识批量上传中的第几个文件"
|
||||
fileName:
|
||||
type: "string"
|
||||
description: "文件名称"
|
||||
totalChunkNum:
|
||||
type: "integer"
|
||||
description: "文件总分块数量"
|
||||
chunkNo:
|
||||
type: "integer"
|
||||
description: "当前分块编号,从1开始"
|
||||
file:
|
||||
type: "string"
|
||||
description: "上传的文件分块内容"
|
||||
checkSumHex:
|
||||
type: "string"
|
||||
description: "文件分块的校验和(十六进制字符串),用于验证文件完整性"
|
||||
description: ""
|
||||
responses:
|
||||
"200":
|
||||
description: "No Content"
|
||||
components:
|
||||
schemas:
|
||||
OperatorDto:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
description: ""
|
||||
name:
|
||||
type: "string"
|
||||
description: ""
|
||||
description:
|
||||
type: "string"
|
||||
description: ""
|
||||
version:
|
||||
type: "string"
|
||||
description: ""
|
||||
inputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
outputs:
|
||||
type: "string"
|
||||
description: ""
|
||||
categories:
|
||||
type: "array"
|
||||
description: ""
|
||||
items:
|
||||
type: "string"
|
||||
runtime:
|
||||
type: "string"
|
||||
description: ""
|
||||
settings:
|
||||
type: "string"
|
||||
description: ""
|
||||
fileName:
|
||||
type: "string"
|
||||
description: ""
|
||||
isStar:
|
||||
type: "boolean"
|
||||
description: ""
|
||||
createdAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
updatedAt:
|
||||
type: "string"
|
||||
description: ""
|
||||
description: "OperatorDto"
|
||||
@@ -0,0 +1,639 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Pipeline Orchestration Service API
|
||||
description: 流程编排服务API - 可视化、模板、执行计划
|
||||
version: 1.0.0
|
||||
contact:
|
||||
name: Data Mate Platform Team
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8087
|
||||
description: Development server
|
||||
|
||||
tags:
|
||||
- name: pipelines
|
||||
description: 流水线管理
|
||||
- name: pipeline-templates
|
||||
description: 流水线模板
|
||||
- name: executions
|
||||
description: 执行管理
|
||||
- name: workflows
|
||||
description: 工作流编排
|
||||
|
||||
paths:
|
||||
/api/v1/pipelines:
|
||||
get:
|
||||
tags:
|
||||
- pipelines
|
||||
summary: 获取流水线列表
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: size
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
- name: status
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/PipelineStatus'
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PipelinePageResponse'
|
||||
|
||||
post:
|
||||
tags:
|
||||
- pipelines
|
||||
summary: 创建流水线
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreatePipelineRequest'
|
||||
responses:
|
||||
'201':
|
||||
description: 创建成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PipelineResponse'
|
||||
|
||||
/api/v1/pipelines/{pipelineId}:
|
||||
get:
|
||||
tags:
|
||||
- pipelines
|
||||
summary: 获取流水线详情
|
||||
parameters:
|
||||
- name: pipelineId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PipelineDetailResponse'
|
||||
|
||||
put:
|
||||
tags:
|
||||
- pipelines
|
||||
summary: 更新流水线
|
||||
parameters:
|
||||
- name: pipelineId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdatePipelineRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 更新成功
|
||||
|
||||
/api/v1/pipelines/{pipelineId}/execute:
|
||||
post:
|
||||
tags:
|
||||
- executions
|
||||
summary: 执行流水线
|
||||
parameters:
|
||||
- name: pipelineId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
required: false
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ExecutePipelineRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: 执行开始
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PipelineExecutionResponse'
|
||||
|
||||
/api/v1/executions:
|
||||
get:
|
||||
tags:
|
||||
- executions
|
||||
summary: 获取执行历史
|
||||
parameters:
|
||||
- name: pipelineId
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: status
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/ExecutionStatus'
|
||||
- name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ExecutionPageResponse'
|
||||
|
||||
/api/v1/executions/{executionId}:
|
||||
get:
|
||||
tags:
|
||||
- executions
|
||||
summary: 获取执行详情
|
||||
parameters:
|
||||
- name: executionId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ExecutionDetailResponse'
|
||||
|
||||
/api/v1/executions/{executionId}/stop:
|
||||
post:
|
||||
tags:
|
||||
- executions
|
||||
summary: 停止执行
|
||||
parameters:
|
||||
- name: executionId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 停止成功
|
||||
|
||||
/api/v1/templates:
|
||||
get:
|
||||
tags:
|
||||
- pipeline-templates
|
||||
summary: 获取模板列表
|
||||
parameters:
|
||||
- name: category
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 获取成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PipelineTemplateResponse'
|
||||
|
||||
post:
|
||||
tags:
|
||||
- pipeline-templates
|
||||
summary: 创建模板
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreatePipelineTemplateRequest'
|
||||
responses:
|
||||
'201':
|
||||
description: 创建成功
|
||||
|
||||
components:
|
||||
schemas:
|
||||
PipelineResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/PipelineStatus'
|
||||
version:
|
||||
type: string
|
||||
category:
|
||||
type: string
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
createdBy:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
lastModified:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
PipelineDetailResponse:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/PipelineResponse'
|
||||
- type: object
|
||||
properties:
|
||||
definition:
|
||||
$ref: '#/components/schemas/PipelineDefinition'
|
||||
parameters:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PipelineParameter'
|
||||
dependencies:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
statistics:
|
||||
$ref: '#/components/schemas/PipelineStatistics'
|
||||
|
||||
PipelinePageResponse:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PipelineResponse'
|
||||
totalElements:
|
||||
type: integer
|
||||
format: int64
|
||||
totalPages:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
|
||||
CreatePipelineRequest:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- definition
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
category:
|
||||
type: string
|
||||
definition:
|
||||
$ref: '#/components/schemas/PipelineDefinition'
|
||||
parameters:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PipelineParameter'
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
|
||||
UpdatePipelineRequest:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
definition:
|
||||
$ref: '#/components/schemas/PipelineDefinition'
|
||||
status:
|
||||
$ref: '#/components/schemas/PipelineStatus'
|
||||
|
||||
ExecutePipelineRequest:
|
||||
type: object
|
||||
properties:
|
||||
parameters:
|
||||
type: object
|
||||
description: 执行参数
|
||||
environment:
|
||||
type: string
|
||||
description: 执行环境
|
||||
priority:
|
||||
type: integer
|
||||
description: 优先级
|
||||
|
||||
PipelineExecutionResponse:
|
||||
type: object
|
||||
properties:
|
||||
executionId:
|
||||
type: string
|
||||
pipelineId:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/ExecutionStatus'
|
||||
startTime:
|
||||
type: string
|
||||
format: date-time
|
||||
message:
|
||||
type: string
|
||||
|
||||
ExecutionResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
pipelineId:
|
||||
type: string
|
||||
pipelineName:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/ExecutionStatus'
|
||||
progress:
|
||||
type: number
|
||||
format: double
|
||||
startTime:
|
||||
type: string
|
||||
format: date-time
|
||||
endTime:
|
||||
type: string
|
||||
format: date-time
|
||||
duration:
|
||||
type: integer
|
||||
format: int64
|
||||
description: 执行时长(毫秒)
|
||||
|
||||
ExecutionDetailResponse:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/ExecutionResponse'
|
||||
- type: object
|
||||
properties:
|
||||
steps:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ExecutionStep'
|
||||
logs:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ExecutionLog'
|
||||
metrics:
|
||||
$ref: '#/components/schemas/ExecutionMetrics'
|
||||
artifacts:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ExecutionArtifact'
|
||||
|
||||
ExecutionPageResponse:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ExecutionResponse'
|
||||
totalElements:
|
||||
type: integer
|
||||
format: int64
|
||||
totalPages:
|
||||
type: integer
|
||||
size:
|
||||
type: integer
|
||||
number:
|
||||
type: integer
|
||||
|
||||
PipelineTemplateResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
category:
|
||||
type: string
|
||||
version:
|
||||
type: string
|
||||
definition:
|
||||
$ref: '#/components/schemas/PipelineDefinition'
|
||||
usageCount:
|
||||
type: integer
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
CreatePipelineTemplateRequest:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- definition
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
category:
|
||||
type: string
|
||||
definition:
|
||||
$ref: '#/components/schemas/PipelineDefinition'
|
||||
|
||||
PipelineDefinition:
|
||||
type: object
|
||||
properties:
|
||||
nodes:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PipelineNode'
|
||||
edges:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PipelineEdge'
|
||||
settings:
|
||||
type: object
|
||||
description: 流水线设置
|
||||
|
||||
PipelineNode:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
enum: [OPERATOR, CONDITION, LOOP, PARALLEL]
|
||||
name:
|
||||
type: string
|
||||
operatorId:
|
||||
type: string
|
||||
configuration:
|
||||
type: object
|
||||
position:
|
||||
$ref: '#/components/schemas/NodePosition'
|
||||
|
||||
PipelineEdge:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
source:
|
||||
type: string
|
||||
target:
|
||||
type: string
|
||||
condition:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
enum: [SUCCESS, FAILURE, ALWAYS]
|
||||
|
||||
NodePosition:
|
||||
type: object
|
||||
properties:
|
||||
x:
|
||||
type: number
|
||||
y:
|
||||
type: number
|
||||
|
||||
PipelineParameter:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
required:
|
||||
type: boolean
|
||||
defaultValue:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
|
||||
PipelineStatistics:
|
||||
type: object
|
||||
properties:
|
||||
totalExecutions:
|
||||
type: integer
|
||||
successfulExecutions:
|
||||
type: integer
|
||||
failedExecutions:
|
||||
type: integer
|
||||
averageDuration:
|
||||
type: number
|
||||
format: double
|
||||
lastExecutionTime:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
ExecutionStep:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
nodeId:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/ExecutionStatus'
|
||||
startTime:
|
||||
type: string
|
||||
format: date-time
|
||||
endTime:
|
||||
type: string
|
||||
format: date-time
|
||||
duration:
|
||||
type: integer
|
||||
format: int64
|
||||
message:
|
||||
type: string
|
||||
|
||||
ExecutionLog:
|
||||
type: object
|
||||
properties:
|
||||
timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
level:
|
||||
type: string
|
||||
enum: [DEBUG, INFO, WARN, ERROR]
|
||||
nodeId:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
|
||||
ExecutionMetrics:
|
||||
type: object
|
||||
properties:
|
||||
totalNodes:
|
||||
type: integer
|
||||
completedNodes:
|
||||
type: integer
|
||||
failedNodes:
|
||||
type: integer
|
||||
cpuUsage:
|
||||
type: number
|
||||
format: double
|
||||
memoryUsage:
|
||||
type: number
|
||||
format: double
|
||||
throughput:
|
||||
type: number
|
||||
format: double
|
||||
|
||||
ExecutionArtifact:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
size:
|
||||
type: integer
|
||||
format: int64
|
||||
path:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
PipelineStatus:
|
||||
type: string
|
||||
enum:
|
||||
- DRAFT
|
||||
- ACTIVE
|
||||
- INACTIVE
|
||||
- DEPRECATED
|
||||
|
||||
ExecutionStatus:
|
||||
type: string
|
||||
enum:
|
||||
- PENDING
|
||||
- RUNNING
|
||||
- SUCCESS
|
||||
- FAILED
|
||||
- CANCELLED
|
||||
- SKIPPED
|
||||
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
|
||||
security:
|
||||
- BearerAuth: []
|
||||
Reference in New Issue
Block a user