aas_client3_2.aas_registry

Implement the operations of the Asset Administration Shell Registry API.

The module also implements the Async Bulk Asset Administration Shell 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.aas_registry.get_all_asset_administration_shell_descriptors(server: Server, *, asset_kind: AssetKind | None = None, asset_type: str | None = None, asset_ids: Sequence[SpecificAssetID] | None = None, created_from: datetime | None = None, updated_from: datetime | None = None, limit: int | None = None, cursor: str | None = None) → GetAssetAdministrationShellDescriptorsResult[source]

List a page of the descriptors of the Asset Administration Shells in the registry.

The filters are combined with “and”.

Parameters:
  • server – where to send the request

  • asset_kind – if set, only the descriptors of the assets of this kind

  • asset_type – if set, only the descriptors of the assets of this type

  • asset_ids – if set, only the descriptors with all these specific asset IDs

  • 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:
  • GetAllAssetAdministrationShellDescriptors – GET /shell-descriptors

aas_client3_2.aas_registry.post_asset_administration_shell_descriptor(server: Server, asset_administration_shell_descriptor: AssetAdministrationShellDescriptor) → AssetAdministrationShellDescriptor[source]

Register an Asset Administration Shell with a new descriptor.

Parameters:
  • server – where to send the request

  • asset_administration_shell_descriptor – the descriptor to be created

Returns:

the created descriptor, as stored by the server

Implements:
  • PostAssetAdministrationShellDescriptor – POST /shell-descriptors

aas_client3_2.aas_registry.get_asset_administration_shell_descriptor_by_id(server: Server, aas_identifier: str) → AssetAdministrationShellDescriptor[source]

Get the descriptor of the Asset Administration Shell with the given identifier.

Parameters:
  • server – where to send the request

  • aas_identifier – identifier of the Asset Administration Shell

Returns:

the descriptor

Implements:
  • GetAssetAdministrationShellDescriptorById – GET /shell-descriptors/{aasIdentifier}

aas_client3_2.aas_registry.put_asset_administration_shell_descriptor_by_id(server: Server, aas_identifier: str, asset_administration_shell_descriptor: AssetAdministrationShellDescriptor) → None[source]

Create or replace the descriptor of the Asset Administration Shell.

Parameters:
  • server – where to send the request

  • aas_identifier – identifier of the Asset Administration Shell

  • asset_administration_shell_descriptor – the descriptor to be stored

Implements:
  • PutAssetAdministrationShellDescriptorById – PUT /shell-descriptors/{aasIdentifier}

aas_client3_2.aas_registry.delete_asset_administration_shell_descriptor_by_id(server: Server, aas_identifier: str) → None[source]

De-register the Asset Administration Shell by deleting its descriptor.

Parameters:
  • server – where to send the request

  • aas_identifier – identifier of the Asset Administration Shell

Implements:
  • DeleteAssetAdministrationShellDescriptorById – DELETE /shell-descriptors/{aasIdentifier}

aas_client3_2.aas_registry.get_all_submodel_descriptors_through_superpath(server: Server, aas_identifier: str, *, limit: int | None = None, cursor: str | None = None) → GetSubmodelDescriptorsResult[source]

List a page of the submodel descriptors in the descriptor of the shell.

Parameters:
  • server – where to send the request

  • aas_identifier – identifier of the Asset Administration Shell

  • limit – maximum number of the submodel descriptors in the page

  • cursor – where to continue the listing from

Returns:

a page of the submodel descriptors

Implements:
  • GetAllSubmodelDescriptorsThroughSuperpath – GET /shell-descriptors/{aasIdentifier}/submodel-descriptors

aas_client3_2.aas_registry.post_submodel_descriptor_through_superpath(server: Server, aas_identifier: str, submodel_descriptor: SubmodelDescriptor) → SubmodelDescriptor[source]

Add a new submodel descriptor to the descriptor of the shell.

Parameters:
  • server – where to send the request

  • aas_identifier – identifier of the Asset Administration Shell

  • submodel_descriptor – the submodel descriptor to be created

Returns:

the created submodel descriptor, as stored by the server

Implements:
  • PostSubmodelDescriptor-ThroughSuperpath – POST /shell-descriptors/{aasIdentifier}/submodel-descriptors

aas_client3_2.aas_registry.get_submodel_descriptor_by_id_through_superpath(server: Server, aas_identifier: str, submodel_identifier: str) → SubmodelDescriptor[source]

Get the submodel descriptor with the given identifier from the descriptor of the shell.

Parameters:
  • server – where to send the request

  • aas_identifier – identifier of the Asset Administration Shell

  • submodel_identifier – identifier of the submodel

Returns:

the submodel descriptor

Implements:
  • GetSubmodelDescriptorByIdThroughSuperpath – GET /shell-descriptors/{aasIdentifier}/submodel-descriptors/{submodelIdentifier}

aas_client3_2.aas_registry.put_submodel_descriptor_by_id_through_superpath(server: Server, aas_identifier: str, submodel_identifier: str, submodel_descriptor: SubmodelDescriptor) → None[source]

Create or replace the submodel descriptor in the descriptor of the shell.

Parameters:
  • server – where to send the request

  • aas_identifier – identifier of the Asset Administration Shell

  • submodel_identifier – identifier of the submodel

  • submodel_descriptor – the submodel descriptor to be stored

Implements:
  • PutSubmodelDescriptorByIdThroughSuperpath – PUT /shell-descriptors/{aasIdentifier}/submodel-descriptors/{submodelIdentifier}

aas_client3_2.aas_registry.delete_submodel_descriptor_by_id_through_superpath(server: Server, aas_identifier: str, submodel_identifier: str) → None[source]

Delete the submodel descriptor from the descriptor of the shell.

Parameters:
  • server – where to send the request

  • aas_identifier – identifier of the Asset Administration Shell

  • submodel_identifier – identifier of the submodel

Implements:
  • DeleteSubmodelDescriptorByIdThroughSuperpath – DELETE /shell-descriptors/{aasIdentifier}/submodel-descriptors/{submodelIdentifier}

aas_client3_2.aas_registry.query_asset_administration_shell_descriptors(server: Server, query: Query, *, limit: int | None = None, cursor: str | None = None) → GetAssetAdministrationShellDescriptorsResult[source]

List a page of the descriptors of the shells which match query.

The query must not select the identifiers ("$select": "id"); use query_asset_administration_shell_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:
  • QueryAssetAdministrationShellDescriptors – POST /query/shell-descriptors

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

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

The query must select the identifiers ("$select": "id"); use query_asset_administration_shell_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 shells

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:
  • QueryAssetAdministrationShellDescriptors – POST /query/shell-descriptors

aas_client3_2.aas_registry.bulk_post_asset_administration_shell_descriptor(server: Server, asset_administration_shell_descriptors: Sequence[AssetAdministrationShellDescriptor]) → OperationHandle[source]

Start registering the Asset Administration Shells with new descriptors at once.

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

  • asset_administration_shell_descriptors – the descriptors to be created

Returns:

the handle of the bulk operation

Raises:

ValueError before sending anything if asset_administration_shell_descriptors is empty

Implements:
  • BulkPostAssetAdministrationShellDescriptor – POST /bulk/shell-descriptors

aas_client3_2.aas_registry.bulk_put_asset_administration_shell_descriptor_by_id(server: Server, asset_administration_shell_descriptors: Sequence[AssetAdministrationShellDescriptor]) → OperationHandle[source]

Start creating or replacing the descriptors of the shells at once.

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

Parameters:
  • server – where to send the request

  • asset_administration_shell_descriptors – the descriptors to be stored

Returns:

the handle of the bulk operation

Raises:

ValueError before sending anything if asset_administration_shell_descriptors is empty

Implements:
  • BulkPutAssetAdministrationShellDescriptorById – PUT /bulk/shell-descriptors

aas_client3_2.aas_registry.bulk_delete_asset_administration_shell_descriptor_by_id(server: Server, aas_identifiers: Sequence[str]) → OperationHandle[source]

Start de-registering the Asset Administration Shells at once.

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

Parameters:
  • server – where to send the request

  • aas_identifiers – identifiers of the shells whose descriptors are deleted

Returns:

the handle of the bulk operation

Raises:

ValueError before sending anything if aas_identifiers is empty

Implements:
  • BulkDeleteAssetAdministrationShellDescriptorById – DELETE /bulk/shell-descriptors