SchemaRegistry interface
表示已注册架构的存储。
由 SchemaRegistryClient 实现,以使用 Azure 架构注册表服务存储架构。
方法
| get |
按 ID 获取现有架构。 |
| get |
获取具有匹配名称、组、类型和定义的现有架构的 ID。 |
| register |
注册新架构并返回其 ID。 如果指定名称的架构在指定组中不存在,则会在版本 1 中创建架构。 如果指定名称的架构已存在于指定组中,则会在最新版本 + 1 中创建架构。 |
方法详细信息
getSchema(string, GetSchemaOptions)
按 ID 获取现有架构。
function getSchema(schemaId: string, options?: GetSchemaOptions): Promise<Schema>
参数
- schemaId
-
string
唯一架构 ID。
- options
- GetSchemaOptions
返回
Promise<Schema>
具有给定 ID 的架构。
getSchemaProperties(SchemaDescription, GetSchemaPropertiesOptions)
获取具有匹配名称、组、类型和定义的现有架构的 ID。
function getSchemaProperties(schema: SchemaDescription, options?: GetSchemaPropertiesOptions): Promise<SchemaProperties>
参数
- schema
- SchemaDescription
要匹配的架构。
- options
- GetSchemaPropertiesOptions
返回
Promise<SchemaProperties>
匹配架构的 ID。
registerSchema(SchemaDescription, RegisterSchemaOptions)
注册新架构并返回其 ID。
如果指定名称的架构在指定组中不存在,则会在版本 1 中创建架构。 如果指定名称的架构已存在于指定组中,则会在最新版本 + 1 中创建架构。
function registerSchema(schema: SchemaDescription, options?: RegisterSchemaOptions): Promise<SchemaProperties>
参数
- schema
- SchemaDescription
要注册的架构。
- options
- RegisterSchemaOptions
返回
Promise<SchemaProperties>
已注册架构的 ID。