ConnectorType (0.1.0)

Download OpenAPI specification:

Vega Backend 连接器类型(ConnectorType)相关 API。

连接器类型描述一个可注册的数据源驱动(如 mysql、postgresql、opensearch 等), 提供其注册元信息以及启用状态。字段配置(field_config,兼容 JSON Schema properties)只在详情接口中按运行时实现获取:local 由当前进程中的实现提供; remote 的运行时字段定义尚未实现。Mode 区分本地(local,进程内运行)与远程 (remote,独立服务通过 HTTP 调用),Category 区分数据源大类。

获取连接器类型列表

分页获取已注册的连接器类型摘要;不返回 field_config。支持按 name、tag、mode、category、enabled、available 过滤。

Authorizations:
OAuth2
query Parameters
name
string

按名称模糊过滤,匹配名称中包含该值的连接器类型

tag
string

按标签精确过滤,默认为空

mode
string
Enum: "local" "remote"

按运行模式过滤

category
string
Enum: "table" "index" "topic" "file" "fileset" "metric" "api"

按分类过滤

enabled
boolean

按启用状态过滤;不传表示不过滤

available
boolean

按当前二进制是否包含连接器实现过滤;不传表示不过滤

offset
integer <int64> >= 0
Default: 0

分页偏移量,>=0,默认 0

limit
integer <int64>
Default: 20

每页数量,1-1000,-1 表示不分页,默认 20

sort
string
Default: "name"
Value: "name"

排序字段,默认 name

direction
string
Default: "desc"
Enum: "asc" "desc"

排序方向,默认 desc

Responses

Response samples

Content type
application/json
{
  • "entries": [
    ],
  • "total_count": 0
}

注册连接器类型

创建一个新的连接器类型。type 必须唯一,已存在时返回 409。

Authorizations:
OAuth2
Request Body schema: application/json
required
type
required
string

连接器类型标识;POST 与 PUT 都必填,PUT 时必须与路径参数一致

name
required
string

连接器类型显示名

tags
Array of strings

标签

description
string

类型描述

mode
required
string
Enum: "local" "remote"

运行模式

category
required
string
Enum: "table" "index" "topic" "file" "fileset" "metric" "api"

分类;POST/PUT 注册或更新 local 连接器时必须与后端代码定义一致

endpoint
string

仅 remote 模式下的远程服务地址

enabled
boolean
Default: false

是否启用

Responses

Request samples

Content type
application/json
{
  • "type": "string",
  • "name": "string",
  • "tags": [
    ],
  • "description": "string",
  • "mode": "local",
  • "category": "table",
  • "endpoint": "string",
  • "enabled": false
}

Response samples

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

获取连接器类型详情

Authorizations:
OAuth2
path Parameters
type
required
string

连接器类型标识(如 mysql、postgresql)

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "name": "string",
  • "tags": [
    ],
  • "description": "string",
  • "mode": "local",
  • "category": "table",
  • "endpoint": "string",
  • "field_config": {
    },
  • "enabled": true,
  • "available": true,
  • "operations": [
    ]
}

修改连接器类型

全量更新指定连接器类型。连接器类型由路径参数 type 唯一确定(主键不可改)。

请求体的 type 字段必填,且必须与路径参数完全一致:

  • 缺失 → 400 VegaBackend.ConnectorType.InvalidParameter.Type
  • 不一致 → 409 VegaBackend.ConnectorType.TypeMismatch

修改 name 时若新名称已被其它类型占用,返回 409 VegaBackend.ConnectorType.NameExists

Authorizations:
OAuth2
path Parameters
type
required
string

连接器类型标识(如 mysql、postgresql)

Request Body schema: application/json
required
type
required
string

连接器类型标识;POST 与 PUT 都必填,PUT 时必须与路径参数一致

name
required
string

连接器类型显示名

tags
Array of strings

标签

description
string

类型描述

mode
required
string
Enum: "local" "remote"

运行模式

category
required
string
Enum: "table" "index" "topic" "file" "fileset" "metric" "api"

分类;POST/PUT 注册或更新 local 连接器时必须与后端代码定义一致

endpoint
string

仅 remote 模式下的远程服务地址

enabled
boolean
Default: false

是否启用

Responses

Request samples

Content type
application/json
{
  • "type": "string",
  • "name": "string",
  • "tags": [
    ],
  • "description": "string",
  • "mode": "local",
  • "category": "table",
  • "endpoint": "string",
  • "enabled": false
}

Response samples

Content type
application/json
{
  • "error_code": "string",
  • "description": "string",
  • "solution": "string",
  • "error_link": "string",
  • "error_details": null
}

删除连接器类型

删除指定 type 的连接器类型。mode=local 的内置类型不可删除(403)。

Authorizations:
OAuth2
path Parameters
type
required
string

连接器类型标识(如 mysql、postgresql)

Responses

Response samples

Content type
application/json
{
  • "error_code": "string",
  • "description": "string",
  • "solution": "string",
  • "error_link": "string",
  • "error_details": null
}

启用连接器类型

启用指定连接器类型;幂等,重复调用不报错。

Authorizations:
OAuth2
path Parameters
type
required
string

连接器类型标识

Responses

Response samples

Content type
application/json
{
  • "error_code": "string",
  • "description": "string",
  • "solution": "string",
  • "error_link": "string",
  • "error_details": null
}

停用连接器类型

停用指定连接器类型;幂等,重复调用不报错。

Authorizations:
OAuth2
path Parameters
type
required
string

连接器类型标识

Responses

Response samples

Content type
application/json
{
  • "error_code": "string",
  • "description": "string",
  • "solution": "string",
  • "error_link": "string",
  • "error_details": null
}