description
aas_client3_2.description implements the Description API: every service describes itself at /description, in particular by the profiles it implements.
A profile is a subset of the operations of a service specification, such as the read profile of the Submodel Repository.
import requests
from aas_client3_2 import (
description as aas_client_description,
http as aas_client_http,
requests_transport as aas_client_requests_transport,
)
server = aas_client_http.Server(
transport=aas_client_requests_transport.RequestsTransport(
requests.Session()
),
base_url="http://localhost:5005",
)
for profile in aas_client_description.get_self_description_profiles(
server
):
print(profile)
get_self_description_profiles() gives all the profiles as strings, also the proprietary ones of the server.
get_self_description() gives the description as aas_core3_2.types.ServiceDescription, which knows only the profiles of the specification, so it leaves out the others, as the specification asks the clients to do:
service_description = aas_client_description.get_self_description(
server
)
print(len(service_description.profiles) > 0)
# Prints: True
To find out which functions of the client the server supports, see profiles.