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, CreateOptions?, 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, CreateOptions? 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.
schemaLabelsIReadOnlyList<Label>Labels applied to the parent Schema.
versionSchemaVersionAttributesThe attributes of the Schema Version to create.
optionsCreateOptionsThe CreateOptions that control the behavior of the create operation; when null, the created entity is persisted.
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?, 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, string? documentHash = 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.
documentHashstringWhen set, restricts the results to entities whose document has this hash.
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.
ListSchemasAsync(GroupSelector, Label?, TimeSpan?, CancellationToken)
Lists the XIDs of Schemas matching the query, optionally filtered by a single label.
Task<IReadOnlyList<ResourceXId>> ListSchemasAsync(GroupSelector groups, Label? label = null, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
groupsGroupSelectorThe Schema Groups to search; see GroupSelector for the available scopes.
labelLabelWhen set, restricts the results to Schemas 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<ResourceXId>>
A task whose result is the XIDs of the matching Schemas.