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
versionIdis 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
groupIdGroupIdThe Schema Group. Use CloudDefault for the cloud-default Group (the configured namespace).
schemaIdstringThe Schema (Resource) identifier.
schemaLabelsIReadOnlyList<Label>Labels applied to the parent Schema.
versionSchemaVersionAttributesThe attributes of the Schema Version to create.
timeoutTimeSpan?The command timeout; when null, the client's default timeout is used.
cancellationTokenCancellationTokenA 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
groupIdGroupIdThe Schema Group. Use CloudDefault for the cloud-default Group (the configured namespace).
schemaIdstringThe Schema (Resource) identifier.
versionIdulongThe identifier of the Schema Version to delete.
optionsDeleteOptionsThe DeleteOptions that control the behavior of the delete operation; when null, Default is used.
timeoutTimeSpan?The command timeout; when null, the client's default timeout is used.
cancellationTokenCancellationTokenA 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
groupIdGroupIdThe Schema Group. Use CloudDefault for the cloud-default Group (the configured namespace).
schemaIdstringThe Schema (Resource) identifier.
versionIdGetSchemaVersionIdThe Version to retrieve. Use ResourceDefault for the Schema's default (latest) Version.
timeoutTimeSpan?The command timeout; when null, the client's default timeout is used.
cancellationTokenCancellationTokenA 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
groupsGroupSelectorThe Groups to search; see GroupSelector for the available scopes.
schemaIdstringWhen set, restricts the results to this Schema.
labelLabelWhen set, restricts the results to entities carrying this label.
timeoutTimeSpan?The command timeout; when null, the client's default timeout is used.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<IReadOnlyList<SchemaVersionXid>>
A task whose result is the XIDs of the matching Schema Versions.