SchemaRegistryClient class
Client per il servizio Registro schemi di Azure.
Costruttori
Schema |
Crea un nuovo client per il servizio Registro schemi di Azure. |
Proprietà
fully |
URL dello spazio dei nomi completo del servizio Registro schemi. |
Metodi
get |
Ottiene uno schema esistente in base all'ID. Se lo schema non è stato trovato, verrà generato un RestError con codice di stato 404, che potrebbe essere rilevato come segue:
|
get |
Ottiene uno schema esistente in base alla versione. Se lo schema non è stato trovato, verrà generato un RestError con codice di stato 404, che potrebbe essere rilevato come segue:
|
get |
Ottiene l'ID di uno schema esistente con nome, gruppo, tipo e definizione corrispondenti. |
register |
Registra un nuovo schema e restituisce l'ID. Se lo schema del nome specificato non esiste nel gruppo specificato, viene creato uno schema alla versione 1. Se lo schema del nome specificato esiste già nel gruppo specificato, lo schema viene creato alla versione più recente + 1. |
Dettagli costruttore
SchemaRegistryClient(string, TokenCredential, SchemaRegistryClientOptions)
Crea un nuovo client per il servizio Registro schemi di Azure.
new SchemaRegistryClient(fullyQualifiedNamespace: string, credential: TokenCredential, options?: SchemaRegistryClientOptions)
Parametri
- fullyQualifiedNamespace
-
string
URL dello spazio dei nomi qualificato del registro schemi, ad esempio https://mynamespace.servicebus.windows.net.
- credential
- TokenCredential
Credenziale per autenticare le richieste al servizio.
- options
- SchemaRegistryClientOptions
Opzioni per configurare le richieste API al servizio.
Dettagli proprietà
fullyQualifiedNamespace
URL dello spazio dei nomi completo del servizio Registro schemi.
fullyQualifiedNamespace: string
Valore della proprietà
string
Dettagli metodo
getSchema(string, GetSchemaOptions)
Ottiene uno schema esistente in base all'ID. Se lo schema non è stato trovato, verrà generato un RestError con codice di stato 404, che potrebbe essere rilevato come segue:
...
} catch (e) {
if (typeof e === "object" && e.statusCode === 404) {
...;
}
throw e;
}
function getSchema(schemaId: string, options?: GetSchemaOptions): Promise<Schema>
Parametri
- schemaId
-
string
ID schema univoco.
- options
- GetSchemaOptions
Restituisce
Promise<Schema>
Schema con ID specificato.
getSchema(string, string, number, GetSchemaOptions)
Ottiene uno schema esistente in base alla versione. Se lo schema non è stato trovato, verrà generato un RestError con codice di stato 404, che potrebbe essere rilevato come segue:
...
} catch (e) {
if (typeof e === "object" && e.statusCode === 404) {
...;
}
throw e;
}
function getSchema(name: string, groupName: string, version: number, options?: GetSchemaOptions): Promise<Schema>
Parametri
- name
-
string
- groupName
-
string
- version
-
number
- options
- GetSchemaOptions
Restituisce
Promise<Schema>
Schema con ID specificato.
getSchemaProperties(SchemaDescription, GetSchemaPropertiesOptions)
Ottiene l'ID di uno schema esistente con nome, gruppo, tipo e definizione corrispondenti.
function getSchemaProperties(schema: SchemaDescription, options?: GetSchemaPropertiesOptions): Promise<SchemaProperties>
Parametri
- schema
- SchemaDescription
Schema da corrispondere.
- options
- GetSchemaPropertiesOptions
Restituisce
Promise<SchemaProperties>
ID dello schema corrispondente.
registerSchema(SchemaDescription, RegisterSchemaOptions)
Registra un nuovo schema e restituisce l'ID.
Se lo schema del nome specificato non esiste nel gruppo specificato, viene creato uno schema alla versione 1. Se lo schema del nome specificato esiste già nel gruppo specificato, lo schema viene creato alla versione più recente + 1.
function registerSchema(schema: SchemaDescription, options?: RegisterSchemaOptions): Promise<SchemaProperties>
Parametri
- schema
- SchemaDescription
Schema da registrare.
- options
- RegisterSchemaOptions
Restituisce
Promise<SchemaProperties>
ID dello schema registrato.