Table of Contents

Interface ISchemaRegistryClient

Namespace
Azure.Iot.Operations.Services.EdgeRegistry
Assembly
Azure.Iot.Operations.Services.dll

Client for the xRegistry Schema extension: create, retrieve, list, and delete Schema Versions. Schema Versions use integer (ulong) version identifiers assigned by the service. The parent Schema (Resource) and Schema Group are implicitly created when a Version is created.

public interface ISchemaRegistryClient

Remarks

The Schema extension is the core xRegistry model specialized for schemas; the generic concepts map directly (see ICoreClient):

  • Schema Group = xRegistry Group (schemagroups).
  • Schema = xRegistry Resource — the named schema that owns its revisions.
  • Schema Version = xRegistry Version — one immutable revision of a schema document. SchemaVersion carries the document bytes plus the revision's metadata; its versionId is a service-assigned integer, not a semantic version.

Methods

CreateSchemaVersionAsync(GroupId, string, IReadOnlyList<Label>, SchemaVersionAttributes, TimeSpan?, CancellationToken)

Creates a Schema Version under the given Schema, implicitly creating the parent Schema if needed.

Task<SchemaVersion> CreateSchemaVersionAsync(GroupId groupId, string schemaId, IReadOnlyList<Label> schemaLabels, SchemaVersionAttributes version, TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

groupId GroupId

The Schema Group. Use CloudDefault for the cloud-default Group (the configured namespace).

schemaId string

The Schema (Resource) identifier.

schemaLabels IReadOnlyList<Label>

Labels applied to the parent Schema.

version SchemaVersionAttributes

The attributes of the Schema Version to create.

timeout TimeSpan?

The command timeout; when null, the client's default timeout is used.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<SchemaVersion>

A task whose result is the created SchemaVersion.

DeleteSchemaVersionAsync(GroupId, string, ulong, DeleteOptions?, TimeSpan?, CancellationToken)

Deletes a specific Schema Version.

Task DeleteSchemaVersionAsync(GroupId groupId, string schemaId, ulong versionId, DeleteOptions? options = null, TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

groupId GroupId

The Schema Group. Use CloudDefault for the cloud-default Group (the configured namespace).

schemaId string

The Schema (Resource) identifier.

versionId ulong

The identifier of the Schema Version to delete.

options DeleteOptions

The DeleteOptions that control the behavior of the delete operation; when null, Default is used.

timeout TimeSpan?

The command timeout; when null, the client's default timeout is used.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task

A task that completes when the Schema Version has been deleted.

GetSchemaVersionAsync(GroupId, string, GetSchemaVersionId, TimeSpan?, CancellationToken)

Retrieves a Schema Version.

Task<SchemaVersion> GetSchemaVersionAsync(GroupId groupId, string schemaId, GetSchemaVersionId versionId, TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

groupId GroupId

The Schema Group. Use CloudDefault for the cloud-default Group (the configured namespace).

schemaId string

The Schema (Resource) identifier.

versionId GetSchemaVersionId

The Version to retrieve. Use ResourceDefault for the Schema's default (latest) Version.

timeout TimeSpan?

The command timeout; when null, the client's default timeout is used.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<SchemaVersion>

A task whose result is the requested SchemaVersion.

ListSchemaVersionsAsync(GroupSelector, string?, Label?, TimeSpan?, CancellationToken)

Lists the XIDs of Schema Versions matching the query, optionally filtered by Schema id and/or a single label.

Task<IReadOnlyList<SchemaVersionXid>> ListSchemaVersionsAsync(GroupSelector groups, string? schemaId = null, Label? label = null, TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

groups GroupSelector

The Groups to search; see GroupSelector for the available scopes.

schemaId string

When set, restricts the results to this Schema.

label Label

When set, restricts the results to entities carrying this label.

timeout TimeSpan?

The command timeout; when null, the client's default timeout is used.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<IReadOnlyList<SchemaVersionXid>>

A task whose result is the XIDs of the matching Schema Versions.