|
AAS HTTP Client Documentation
|
Classes | |
| class | AasHttpClient |
| Represents a AasHttpClient to communicate with a REST API. More... | |
Functions | |
| AasHttpClient|None | create_client_by_url (str base_url, str basic_auth_username="", str basic_auth_password="", str o_auth_client_id="", str o_auth_client_secret="", str o_auth_token_url="", str bearer_auth_token="", str http_proxy="", str https_proxy="", int time_out=200, int connection_time_out=60, bool ssl_verify=True, bool trust_env=True, bool encoded_ids=True) |
| Create a HTTP client for a AAS server connection from the given parameters. | |
| AasHttpClient|None | create_client_by_dict (dict configuration, str basic_auth_password="", str o_auth_client_secret="", str bearer_auth_token="") |
| Create a HTTP client for a AAS server connection from the given configuration. | |
| AasHttpClient|None | create_client_by_config (Path config_file, str basic_auth_password="", str o_auth_client_secret="", str bearer_auth_token="") |
| Create a HTTP client for a AAS server connection from a given configuration file. | |
| AasHttpClient|None | _create_client (str config_string, str basic_auth_password, str o_auth_client_secret, str bearer_auth_token) |
| Create and initialize an AAS HTTP client from configuration string. | |
| bool | _connect_to_api (AasHttpClient client) |
| Test the connection to the AAS server API with retry logic. | |
Variables | |
| logger = logging.getLogger(__name__) | |
|
protected |
Test the connection to the AAS server API with retry logic.
This internal method attempts to establish a connection to the AAS server by calling the get_root() method. It retries the connection for the duration specified in the client's connection_time_out setting, sleeping 1 second between attempts.
| client | The AasHttpClient instance to test the connection for |
Definition at line 458 of file aas_client.py.
|
protected |
Create and initialize an AAS HTTP client from configuration string.
This internal method validates the configuration, sets authentication credentials, initializes the client, and tests the connection to the AAS server.
| config_string | JSON configuration string containing AAS server settings |
| basic_auth_password | Password for basic authentication, defaults to "" |
| o_auth_client_secret | Client secret for OAuth authentication, defaults to "" |
| bearer_auth_token | Bearer token for authentication, defaults to "" |
Definition at line 415 of file aas_client.py.
| AasHttpClient | None aas_client.create_client_by_config | ( | Path | config_file, |
| str | basic_auth_password = "", |
||
| str | o_auth_client_secret = "", |
||
| str | bearer_auth_token = "" |
||
| ) |
Create a HTTP client for a AAS server connection from a given configuration file.
| config_file | Path to the configuration file containing the AAS server connection settings |
| basic_auth_password | Password for the AAS server basic authentication, defaults to "" |
| o_auth_client_secret | Client secret for OAuth authentication, defaults to "" |
| bearer_auth_token | Bearer token for authentication, defaults to "" |
Definition at line 385 of file aas_client.py.
| AasHttpClient | None aas_client.create_client_by_dict | ( | dict | configuration, |
| str | basic_auth_password = "", |
||
| str | o_auth_client_secret = "", |
||
| str | bearer_auth_token = "" |
||
| ) |
Create a HTTP client for a AAS server connection from the given configuration.
| configuration | Dictionary containing the AAS server connection settings |
| basic_auth_password | Password for the AAS server basic authentication, defaults to "" |
| o_auth_client_secret | Client secret for OAuth authentication, defaults to "" |
| bearer_auth_token | Bearer token for authentication, defaults to "" |
Definition at line 368 of file aas_client.py.
| AasHttpClient | None aas_client.create_client_by_url | ( | str | base_url, |
| str | basic_auth_username = "", |
||
| str | basic_auth_password = "", |
||
| str | o_auth_client_id = "", |
||
| str | o_auth_client_secret = "", |
||
| str | o_auth_token_url = "", |
||
| str | bearer_auth_token = "", |
||
| str | http_proxy = "", |
||
| str | https_proxy = "", |
||
| int | time_out = 200, |
||
| int | connection_time_out = 60, |
||
| bool | ssl_verify = True, |
||
| bool | trust_env = True, |
||
| bool | encoded_ids = True |
||
| ) |
Create a HTTP client for a AAS server connection from the given parameters.
| base_url | Base URL of the AAS server, e.g. "http://basyx_python_server:80/" |
| basic_auth_username | Username for the AAS server basic authentication, defaults to "" |
| basic_auth_password | Password for the AAS server basic authentication, defaults to "" |
| o_auth_client_id | Client ID for OAuth authentication, defaults to "" |
| o_auth_client_secret | Client secret for OAuth authentication, defaults to "" |
| o_auth_token_url | Token URL for OAuth authentication, defaults to "" |
| bearer_auth_token | Bearer token for authentication, defaults to "" |
| http_proxy | HTTP proxy URL, defaults to "" |
| https_proxy | HTTPS proxy URL, defaults to "" |
| time_out | Timeout for the API calls, defaults to 200 |
| connection_time_out | Timeout for the connection to the API, defaults to 60 |
| ssl_verify | Whether to verify SSL certificates, defaults to True |
| trust_env | Whether to trust environment variables for proxy settings, defaults to True |
| encoded_ids | If enabled, all IDs used in API requests have to be base64-encoded |
Definition at line 322 of file aas_client.py.
| aas_client.logger = logging.getLogger(__name__) |
Definition at line 32 of file aas_client.py.