aas_client3_2.submodel_registry

Implement the operations of the Submodel Registry API.

The module also implements the Async Bulk Submodel Registry API. The status and the result of the bulk operations are in aas_client3_2.async_bulk, since both registries share them.

Every public function implements exactly one operation of the specification. The private functions _build_* and _parse_* build the request and parse the response of the operation. They do no I/O, and constitute a semi-public interface for the testing client, which is released in lockstep with this client.

aas_client3_2.submodel_registry.get_all_submodel_descriptors(server: Server, *, created_from: datetime | None = None, updated_from: datetime | None = None, limit: int | None = None, cursor: str | None = None) → GetSubmodelDescriptorsResult[source]

List a page of the submodel descriptors in the registry.

Parameters:
  • server – where to send the request

  • created_from – if set, only the descriptors created at or after this time

  • updated_from – if set, only the descriptors updated at or after this time

  • limit – maximum number of the descriptors in the page

  • cursor – where to continue the listing from

Returns:

a page of the descriptors

Raises:

ValueError before sending anything if a time has no time zone

Implements:
  • GetAllSubmodelDescriptors – GET /submodel-descriptors

aas_client3_2.submodel_registry.post_submodel_descriptor(server: Server, submodel_descriptor: SubmodelDescriptor) → SubmodelDescriptor[source]

Register a submodel with a new descriptor.

Parameters:
  • server – where to send the request

  • submodel_descriptor – the descriptor to be created

Returns:

the created descriptor, as stored by the server

Implements:
  • PostSubmodelDescriptor – POST /submodel-descriptors

aas_client3_2.submodel_registry.get_submodel_descriptor_by_id(server: Server, submodel_identifier: str) → SubmodelDescriptor[source]

Get the descriptor of the submodel with the given identifier.

Parameters:
  • server – where to send the request

  • submodel_identifier – identifier of the submodel

Returns:

the descriptor

Implements:
  • GetSubmodelDescriptorById – GET /submodel-descriptors/{submodelIdentifier}

aas_client3_2.submodel_registry.put_submodel_descriptor_by_id(server: Server, submodel_identifier: str, submodel_descriptor: SubmodelDescriptor) → None[source]

Create or replace the descriptor of the submodel with the given identifier.

Parameters:
  • server – where to send the request

  • submodel_identifier – identifier of the submodel

  • submodel_descriptor – the descriptor to be stored

Implements:
  • PutSubmodelDescriptorById – PUT /submodel-descriptors/{submodelIdentifier}

aas_client3_2.submodel_registry.delete_submodel_descriptor_by_id(server: Server, submodel_identifier: str) → None[source]

De-register the submodel by deleting its descriptor.

Parameters:
  • server – where to send the request

  • submodel_identifier – identifier of the submodel

Implements:
  • DeleteSubmodelDescriptorById – DELETE /submodel-descriptors/{submodelIdentifier}

aas_client3_2.submodel_registry.query_submodel_descriptors(server: Server, query: Query, *, limit: int | None = None, cursor: str | None = None) → GetSubmodelDescriptorsResult[source]

List a page of the submodel descriptors which match query.

The query must not select the identifiers ("$select": "id"); use query_submodel_descriptor_ids() for that. Both functions implement the same operation, but give different results.

Parameters:
  • server – where to send the request

  • query – query in the AAS Query Language

  • limit – maximum number of the descriptors in the page

  • cursor – where to continue the listing from

Returns:

a page of the matching descriptors

Raises:

ValueError before sending anything if query selects the identifiers, or can not be serialized to JSON (e.g., a number literal is not finite)

Implements:
  • QuerySubmodelDescriptors – POST /query/submodel-descriptors

aas_client3_2.submodel_registry.query_submodel_descriptor_ids(server: Server, query: Query, *, limit: int | None = None, cursor: str | None = None) → IdsResult[source]

List a page of the identifiers of the submodels whose descriptors match query.

The query must select the identifiers ("$select": "id"); use query_submodel_descriptors() for the descriptors. Both functions implement the same operation, but give different results.

Parameters:
  • server – where to send the request

  • query – query in the AAS Query Language

  • limit – maximum number of the identifiers in the page

  • cursor – where to continue the listing from

Returns:

a page of the identifiers of the matching submodels

Raises:

ValueError before sending anything if query does not select the identifiers, or can not be serialized to JSON (e.g., a number literal is not finite)

Implements:
  • QuerySubmodelDescriptors – POST /query/submodel-descriptors

aas_client3_2.submodel_registry.bulk_post_submodel(server: Server, submodel_descriptors: Sequence[SubmodelDescriptor]) → OperationHandle[source]

Start registering the submodels with new descriptors at once.

The operation ID of the OpenAPI speaks of submodels, but the operation creates their descriptors.

The server processes the bulk request asynchronously. Follow its progress with aas_client3_2.async_bulk.bulk_get_async_status(), and fetch its result with aas_client3_2.async_bulk.bulk_get_async_result(). The server may accept a bulk request which it later finds invalid; only the result tells.

Parameters:
  • server – where to send the request

  • submodel_descriptors – the descriptors to be created

Returns:

the handle of the bulk operation

Raises:

ValueError before sending anything if submodel_descriptors is empty

Implements:
  • BulkPostSubmodel – POST /bulk/submodel-descriptors

aas_client3_2.submodel_registry.bulk_put_submodel_descriptors_by_id(server: Server, submodel_descriptors: Sequence[SubmodelDescriptor]) → OperationHandle[source]

Start creating or replacing the submodel descriptors at once.

The descriptors are matched to the stored ones by their id. See bulk_post_submodel() for how to follow the bulk operation.

Parameters:
  • server – where to send the request

  • submodel_descriptors – the descriptors to be stored

Returns:

the handle of the bulk operation

Raises:

ValueError before sending anything if submodel_descriptors is empty

Implements:
  • BulkPutSubmodelDescriptorsById – PUT /bulk/submodel-descriptors

aas_client3_2.submodel_registry.bulk_delete_submodel_descriptors_by_id(server: Server, submodel_identifiers: Sequence[str]) → OperationHandle[source]

Start de-registering the submodels at once.

See bulk_post_submodel() for how to follow the bulk operation.

Parameters:
  • server – where to send the request

  • submodel_identifiers – identifiers of the submodels whose descriptors are deleted

Returns:

the handle of the bulk operation

Raises:

ValueError before sending anything if submodel_identifiers is empty

Implements:
  • BulkDeleteSubmodelDescriptorsById – DELETE /bulk/submodel-descriptors