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:
- Returns:
a page of the descriptors
- Raises:
ValueErrorbefore 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.
- 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.
- 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.
- 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.
- 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
querymust not select the identifiers ("$select": "id"); usequery_submodel_descriptor_ids()for that. Both functions implement the same operation, but give different results.- Parameters:
- Returns:
a page of the matching descriptors
- Raises:
ValueErrorbefore sending anything ifqueryselects 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
querymust select the identifiers ("$select": "id"); usequery_submodel_descriptors()for the descriptors. Both functions implement the same operation, but give different results.- Parameters:
- Returns:
a page of the identifiers of the matching submodels
- Raises:
ValueErrorbefore sending anything ifquerydoes 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 withaas_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:
- Returns:
the handle of the bulk operation
- Raises:
ValueErrorbefore sending anything ifsubmodel_descriptorsis 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. Seebulk_post_submodel()for how to follow the bulk operation.- Parameters:
- Returns:
the handle of the bulk operation
- Raises:
ValueErrorbefore sending anything ifsubmodel_descriptorsis 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:
- Returns:
the handle of the bulk operation
- Raises:
ValueErrorbefore sending anything ifsubmodel_identifiersis empty- Implements:
BulkDeleteSubmodelDescriptorsById –
DELETE /bulk/submodel-descriptors