Represents a AasHttpClient to communicate with a REST API.
More...
|
| | initialize (self) |
| | Initialize the AasHttpClient with the given URL, username and password.
|
| |
| Session|None | get_session (self) |
| | Get the HTTP session used by the client.
|
| |
| dict|None | get_root (self) |
| | Get the root endpoint of the AAS server API to test connectivity.
|
| |
| str|None | set_token (self) |
| | Set authentication token in session headers based on configured authentication method.
|
| |
| None|dict | get_endpoint (self, str end_point_url) |
| | Generic GET request for endpoint.
|
| |
| None|dict | put_endpoint (self, str end_point_url, dict request_body) |
| | Generic PUT request for endpoint.
|
| |
| None|dict | post_endpoint (self, str end_point_url, dict request_body) |
| | Generic POST request for endpoint.
|
| |
| None|dict | patch_endpoint (self, str end_point_url, dict request_body) |
| | Generic PATCH request for endpoint.
|
| |
| None|dict | delete_endpoint (self, str end_point_url) |
| | Generic DELETE request for endpoint.
|
| |
|
| str | base_url = Field(..., alias="BaseUrl", description="Base URL of the AAS server.") |
| |
| AuthenticationConfig | auth_settings |
| |
| str | https_proxy = Field(default=None, alias="HttpsProxy", description="HTTPS proxy URL.") |
| |
| str | http_proxy = Field(default=None, alias="HttpProxy", description="HTTP proxy URL.") |
| |
| int | time_out = Field(default=200, alias="TimeOut", description="Timeout for HTTP requests.") |
| |
| int | connection_time_out = Field(default=100, alias="ConnectionTimeOut", description="Connection timeout for HTTP requests.") |
| |
| bool | ssl_verify = Field(default=True, alias="SslVerify", description="Enable SSL verification.") |
| |
| bool | trust_env = Field(default=True, alias="TrustEnv", description="Trust environment variables.") |
| |
| bool | encoded_ids = Field(default=True, alias="EncodedIds", description="If enabled, all IDs used in API requests have to be base64-encoded.") |
| |
| ShellRepoImplementation | shells = Field(default=None) |
| |
| SubmodelRepoImplementation | submodels = Field(default=None) |
| |
| ShellRegistryImplementation | shell_registry = Field(default=None) |
| |
| ExperimentalImplementation | experimental = Field(default=None) |
| |
| SubmodelRegistryImplementation | submodel_registry = Field(default=None) |
| |
|
| Session | _session = PrivateAttr(default=None) |
| |
| AuthMethod | _auth_method = PrivateAttr(default=AuthMethod.basic_auth) |
| |
| TokenData | _cached_token = PrivateAttr(default=None) |
| |
Represents a AasHttpClient to communicate with a REST API.
Definition at line 36 of file aas_client.py.
◆ _handle_auth_method()
| aas_client.AasHttpClient._handle_auth_method |
( |
|
self | ) |
|
|
protected |
Handles the authentication method based on the provided settings.
Definition at line 99 of file aas_client.py.
◆ delete_endpoint()
| None | dict aas_client.AasHttpClient.delete_endpoint |
( |
|
self, |
|
|
str |
end_point_url |
|
) |
| |
Generic DELETE request for endpoint.
- Parameters
-
| end_point_url | The endpoint URL to send the DELETE request to. |
- Returns
- The base URL of the AAS server.
Definition at line 285 of file aas_client.py.
◆ get_endpoint()
| None | dict aas_client.AasHttpClient.get_endpoint |
( |
|
self, |
|
|
str |
end_point_url |
|
) |
| |
Generic GET request for endpoint.
- Parameters
-
| end_point_url | The endpoint URL to send the GET request to. |
- Returns
- The base URL of the AAS server.
Definition at line 190 of file aas_client.py.
◆ get_root()
| dict | None aas_client.AasHttpClient.get_root |
( |
|
self | ) |
|
Get the root endpoint of the AAS server API to test connectivity.
This method calls the '/shells' endpoint to verify that the AAS server is accessible
and responding. It automatically handles authentication token setup if service
provider authentication is configured.
- Returns
- Response data as a dictionary containing shell information, or None if an error occurred
Definition at line 128 of file aas_client.py.
◆ get_session()
| Session | None aas_client.AasHttpClient.get_session |
( |
|
self | ) |
|
Get the HTTP session used by the client.
- Returns
- The requests.Session object used for HTTP communication
Definition at line 93 of file aas_client.py.
◆ initialize()
| aas_client.AasHttpClient.initialize |
( |
|
self | ) |
|
Initialize the AasHttpClient with the given URL, username and password.
Definition at line 59 of file aas_client.py.
◆ patch_endpoint()
| None | dict aas_client.AasHttpClient.patch_endpoint |
( |
|
self, |
|
|
str |
end_point_url, |
|
|
dict |
request_body |
|
) |
| |
Generic PATCH request for endpoint.
- Parameters
-
| end_point_url | The endpoint URL to send the PATCH request to. |
| request_body | The request body to send with the PATCH request. |
- Returns
- The base URL of the AAS server.
Definition at line 262 of file aas_client.py.
◆ post_endpoint()
| None | dict aas_client.AasHttpClient.post_endpoint |
( |
|
self, |
|
|
str |
end_point_url, |
|
|
dict |
request_body |
|
) |
| |
Generic POST request for endpoint.
- Parameters
-
| end_point_url | The endpoint URL to send the POST request to. |
| request_body | The request body to send with the POST request. |
- Returns
- The base URL of the AAS server.
Definition at line 238 of file aas_client.py.
◆ put_endpoint()
| None | dict aas_client.AasHttpClient.put_endpoint |
( |
|
self, |
|
|
str |
end_point_url, |
|
|
dict |
request_body |
|
) |
| |
Generic PUT request for endpoint.
- Parameters
-
| end_point_url | The endpoint URL to send the PUT request to. |
| request_body | The request body to send with the PUT request. |
- Returns
- The base URL of the AAS server.
Definition at line 214 of file aas_client.py.
◆ set_token()
| str | None aas_client.AasHttpClient.set_token |
( |
|
self | ) |
|
Set authentication token in session headers based on configured authentication method.
- Returns
- The access token if set, otherwise None
Definition at line 160 of file aas_client.py.
◆ _auth_method [1/2]
| AuthMethod aas_client.AasHttpClient._auth_method = PrivateAttr(default=AuthMethod.basic_auth) |
|
staticprotected |
◆ _auth_method [2/2]
| aas_client.AasHttpClient._auth_method |
|
protected |
◆ _cached_token [1/2]
| TokenData aas_client.AasHttpClient._cached_token = PrivateAttr(default=None) |
|
staticprotected |
◆ _cached_token [2/2]
| aas_client.AasHttpClient._cached_token |
|
protected |
◆ _session [1/2]
| Session aas_client.AasHttpClient._session = PrivateAttr(default=None) |
|
staticprotected |
◆ _session [2/2]
| aas_client.AasHttpClient._session |
|
protected |
◆ auth_settings
| AuthenticationConfig aas_client.AasHttpClient.auth_settings |
|
static |
Initial value:= Field(
default_factory=AuthenticationConfig, alias="AuthenticationSettings", description="Authentication settings for the AAS server."
)
Definition at line 39 of file aas_client.py.
◆ base_url [1/2]
| str aas_client.AasHttpClient.base_url = Field(..., alias="BaseUrl", description="Base URL of the AAS server.") |
|
static |
◆ base_url [2/2]
| aas_client.AasHttpClient.base_url |
◆ connection_time_out
| int aas_client.AasHttpClient.connection_time_out = Field(default=100, alias="ConnectionTimeOut", description="Connection timeout for HTTP requests.") |
|
static |
◆ encoded_ids
| bool aas_client.AasHttpClient.encoded_ids = Field(default=True, alias="EncodedIds", description="If enabled, all IDs used in API requests have to be base64-encoded.") |
|
static |
◆ experimental [1/2]
| ExperimentalImplementation aas_client.AasHttpClient.experimental = Field(default=None) |
|
static |
◆ experimental [2/2]
| aas_client.AasHttpClient.experimental |
◆ http_proxy
| str aas_client.AasHttpClient.http_proxy = Field(default=None, alias="HttpProxy", description="HTTP proxy URL.") |
|
static |
◆ https_proxy
| str aas_client.AasHttpClient.https_proxy = Field(default=None, alias="HttpsProxy", description="HTTPS proxy URL.") |
|
static |
◆ shell_registry [1/2]
| ShellRegistryImplementation aas_client.AasHttpClient.shell_registry = Field(default=None) |
|
static |
◆ shell_registry [2/2]
| aas_client.AasHttpClient.shell_registry |
◆ shells [1/2]
| ShellRepoImplementation aas_client.AasHttpClient.shells = Field(default=None) |
|
static |
◆ shells [2/2]
| aas_client.AasHttpClient.shells |
◆ ssl_verify
| bool aas_client.AasHttpClient.ssl_verify = Field(default=True, alias="SslVerify", description="Enable SSL verification.") |
|
static |
◆ submodel_registry [1/2]
| SubmodelRegistryImplementation aas_client.AasHttpClient.submodel_registry = Field(default=None) |
|
static |
◆ submodel_registry [2/2]
| aas_client.AasHttpClient.submodel_registry |
◆ submodels [1/2]
| SubmodelRepoImplementation aas_client.AasHttpClient.submodels = Field(default=None) |
|
static |
◆ submodels [2/2]
| aas_client.AasHttpClient.submodels |
◆ time_out
| int aas_client.AasHttpClient.time_out = Field(default=200, alias="TimeOut", description="Timeout for HTTP requests.") |
|
static |
◆ trust_env
| bool aas_client.AasHttpClient.trust_env = Field(default=True, alias="TrustEnv", description="Trust environment variables.") |
|
static |
The documentation for this class was generated from the following file: