更新时间:2025-04-25 GMT+08:00
分享

查询事件模型详情

功能介绍

查询事件模型详情

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v1/{project_id}/schemas/{schema_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

租户资源空间ID

schema_id

String

指定查询的事件模型ID

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

id

String

事件模型ID

name

String

事件模型名称,租户下唯一

description

String

事件模型描述

compatibility

String

事件模型兼容性

provider_type

String

提供方类型,OFFICIAL:官方事件源;CUSTOM:自定义事件源

format

String

事件模型格式

number_of_versions

Integer

事件模型版本数

created_time

String

创建时间

updated_time

String

更新时间

version

Integer

事件模型当前版本号

definition

String

事件模型内容定义

请求示例

查询事件模型详情

GET https://{endpoint}/v1/{project_id}/schemas/{schema_id}

响应示例

状态码:200

详情

{
  "id" : "2a0ee4f2-78a4-4122-80af-7455e37f64ee",
  "name" : "file.upload",
  "description" : "文件上传事件模型定义",
  "compatibility" : "NONE",
  "provider_type" : "CUSTOM",
  "format" : "OPENAPI_3_0",
  "number_of_versions" : 1,
  "created_time" : "2021-12-09 09:00:00",
  "updated_time" : "2021-12-09 09:00:00",
  "version" : 1,
  "definition" : "{\"$schema\": \"http://json-schema.org/draft-06/schema#\",\"title\": \"fileUpload\",\"definitions\": {\"fileUpload\": {\"properties\": {\"fileName\": {\"type\": \"string\"},\"fileSize\": {\"type\": \"integer\"}},\"required\": [\"foo\",\"bar\"],\"type\": \"object\"}},\"properties\": {\"specversion\": {\"type\": \"string\"},\"id\": {\"type\": \"string\"},\"type\": {\"type\": \"string\"},\"source\": {\"type\": \"string\"},\"subject\": {\"type\": \"string\"},\"datacontenttype\": {\"type\": \"string\"},\"dataschema\": {\"type\": \"string\"},\"time\": {\"format\": \"date-time\",\"type\": \"string\"},\"data\": {\"$ref\": \"#/definitions/fileUpload\"}},\"required\": [\"id\",\"source\",\"time\",\"type\",\"specversion\"],\"type\": \"object\"}"
}

状态码

状态码

描述

200

详情

错误码

请参见错误码

相关文档