profiles
aas_client3_2.profiles lists the profiles of the specification, each with the functions of the client which implement its operations.
Combined with the profiles a server announces (see description), it tells you which functions you can call on that server:
import requests
from aas_client3_2 import (
description as aas_client_description,
http as aas_client_http,
profiles as aas_client_profiles,
requests_transport as aas_client_requests_transport,
submodel_repository as aas_client_submodel_repository,
)
server = aas_client_http.Server(
transport=aas_client_requests_transport.RequestsTransport(
requests.Session()
),
base_url="http://localhost:5005",
)
supported = aas_client_profiles.functions_of(
aas_client_description.get_self_description_profiles(server)
)
if aas_client_submodel_repository.query_submodels in supported:
print("The server answers the queries.")
functions_of() ignores the identifiers it does not know, such as the proprietary profiles and those of the earlier versions of the specification.
Each profile is also given as a constant, with its identifier and its functions:
read = (
aas_client_profiles.SUBMODEL_REPOSITORY_SERVICE_SPECIFICATION_SSP_002
)
print(read.identifier)
# Prints: https://admin-shell.io/aas/API/3/2/SubmodelRepositoryServiceSpecification/SSP-002
print(
aas_client_submodel_repository.get_submodel_by_id
in read.functions
)
# Prints: True
print(
aas_client_submodel_repository.put_submodel_by_id
in read.functions
)
# Prints: False
The constant PROFILES lists all the profiles, and BY_IDENTIFIER maps their identifiers to them.