共用方式為


SchemaRegistryClient class

Azure 架構登錄服務的用戶端。

建構函式

SchemaRegistryClient(string, TokenCredential, SchemaRegistryClientOptions)

建立 Azure 架構登錄服務的新用戶端。

屬性

fullyQualifiedNamespace

架構登錄服務完整命名空間 URL。

方法

getSchema(string, GetSchemaOptions)

依標識碼取得現有的架構。 如果找不到架構,則會擲回狀態代碼為 404 的 RestError,可能會攔截如下:

...
} catch (e) {
if (typeof e === "object" && e.statusCode === 404) {
...;
}
throw e;
}
getSchema(string, string, number, GetSchemaOptions)

依版本取得現有的架構。 如果找不到架構,則會擲回狀態代碼為 404 的 RestError,可能會攔截如下:

...
} catch (e) {
if (typeof e === "object" && e.statusCode === 404) {
...;
}
throw e;
}
getSchemaProperties(SchemaDescription, GetSchemaPropertiesOptions)

取得現有架構的識別碼,其中包含相符的名稱、群組、類型和定義。

registerSchema(SchemaDescription, RegisterSchemaOptions)

註冊新的架構,並傳回其標識碼。

如果指定名稱的架構不存在於指定的群組中,則會在版本 1 建立架構。 如果指定名稱的架構已存在於指定的群組中,則會在最新版本 + 1 建立架構。

建構函式詳細資料

SchemaRegistryClient(string, TokenCredential, SchemaRegistryClientOptions)

建立 Azure 架構登錄服務的新用戶端。

new SchemaRegistryClient(fullyQualifiedNamespace: string, credential: TokenCredential, options?: SchemaRegistryClientOptions)

參數

fullyQualifiedNamespace

string

架構登錄服務限定的命名空間 URL,例如 https://mynamespace.servicebus.windows.net

credential
TokenCredential

用來驗證服務要求的認證。

options
SchemaRegistryClientOptions

設定服務 API 要求的選項。

屬性詳細資料

fullyQualifiedNamespace

架構登錄服務完整命名空間 URL。

fullyQualifiedNamespace: string

屬性值

string

方法詳細資料

getSchema(string, GetSchemaOptions)

依標識碼取得現有的架構。 如果找不到架構,則會擲回狀態代碼為 404 的 RestError,可能會攔截如下:

...
} catch (e) {
if (typeof e === "object" && e.statusCode === 404) {
...;
}
throw e;
}
function getSchema(schemaId: string, options?: GetSchemaOptions): Promise<Schema>

參數

schemaId

string

唯一的架構標識碼。

傳回

Promise<Schema>

具有指定標識碼的架構。

getSchema(string, string, number, GetSchemaOptions)

依版本取得現有的架構。 如果找不到架構,則會擲回狀態代碼為 404 的 RestError,可能會攔截如下:

...
} catch (e) {
if (typeof e === "object" && e.statusCode === 404) {
...;
}
throw e;
}
function getSchema(name: string, groupName: string, version: number, options?: GetSchemaOptions): Promise<Schema>

參數

name

string

groupName

string

version

number

傳回

Promise<Schema>

具有指定標識碼的架構。

備註

如果用戶端使用不支援架構格式的舊版 API,架構格式可能會傳回內容類型標頭中的值。 請使用最新的 API 版本升級至用戶端,以便傳回正確的架構格式。

getSchemaProperties(SchemaDescription, GetSchemaPropertiesOptions)

取得現有架構的識別碼,其中包含相符的名稱、群組、類型和定義。

function getSchemaProperties(schema: SchemaDescription, options?: GetSchemaPropertiesOptions): Promise<SchemaProperties>

參數

schema
SchemaDescription

要比對的架構。

傳回

Promise<SchemaProperties>

相符的架構標識碼。

registerSchema(SchemaDescription, RegisterSchemaOptions)

註冊新的架構,並傳回其標識碼。

如果指定名稱的架構不存在於指定的群組中,則會在版本 1 建立架構。 如果指定名稱的架構已存在於指定的群組中,則會在最新版本 + 1 建立架構。

function registerSchema(schema: SchemaDescription, options?: RegisterSchemaOptions): Promise<SchemaProperties>

參數

schema
SchemaDescription

要註冊的架構。

傳回

Promise<SchemaProperties>

已註冊的架構標識碼。