class Configuration(object):
The static class Configuration holds all the configuration values of the CSE. It is initialized only once by calling the static method init(). Access to configuration valus is done by calling Configuration.get(<key>) or by accessing an attribute with the same name as the configuration key (with all "." replaced by "_").
Example
print(Configuration.get('http.port'))
print(Configuration.http_port)
| Static Method | add |
Adds a documentation for a configuration key. |
| Static Method | all |
Returns the complete configuration as a dictionary. |
| Static Method | get |
Retrieve a configuration value or None if no configuration could be found for a key. The key is case-insensitive and dots are replaced by underscores. |
| Static Method | get |
Retrieves the documentation for a configuration key. |
| Static Method | has |
Check whether a configuration setting exsists. |
| Static Method | init |
Initialize and read the configuration. This method must be called before accessing any configuration value. |
| Static Method | init |
Initialize the directories for the configuration. This method must be called before accessing any configuration value. |
| Static Method | print |
Prints the current configuration to the console. |
| Static Method | update |
Update a configuration value and inform other components via an event. |
| Class Variable | base |
The base directory of the ACME module. |
| Class Variable | coap |
The address to listen on for CoAP. |
| Class Variable | coap_client |
The size of the client connection cache. |
| Class Variable | coap |
Enable or disable the CoAP server. |
| Class Variable | coap_listen |
The network interface to listen on for CoAP. |
| Class Variable | coap |
The port to listen on for CoAP. |
| Class Variable | coap_security_ca |
The CA certificate file for CoAP. |
| Class Variable | coap_security_ca |
The CA private key file for CoAP. |
| Class Variable | coap_security_dtls |
The DTLS version for CoAP. |
| Class Variable | coap_security_use |
Enable or disable DTLS for CoAP. |
| Class Variable | coap_security_verify |
Enable or disable certificate verification for CoAP. |
| Class Variable | coap |
The timeout for CoAP requests. |
| Class Variable | configfile |
The configuration file. |
| Class Variable | config |
The ACMEConfiguration instance holding the configuration values. |
| Class Variable | console_confirm |
Confirm quitting the console. |
| Class Variable | console |
Run the CSE in headless mode. |
| Class Variable | console_hide |
Resources to hide in the console. |
| Class Variable | console_refresh |
The refresh interval for the console. |
| Class Variable | console |
The theme for the console. |
| Class Variable | console_tree |
Include virtual resources in the console tree. |
| Class Variable | console_tree |
The tree mode for the console. |
| Class Variable | console |
"rich", "simple". |
| Class Variable | cse_announcements_allow |
Allow announcements to the hosting CSE. |
| Class Variable | cse_announcements_delay |
The delay after registration for announcements. |
| Class Variable | cse_async |
Enable or disable asynchronous subscription notifications. |
| Class Variable | cse_check |
The interval to check for resource expirations. |
| Class Variable | cse_cse |
The CSE-ID of the CSE. |
| Class Variable | cse_default |
The default serialization for the CSE. |
| Class Variable | cse_enable |
Enable or disable remote CSEs. |
| Class Variable | cse_enable |
Enable or disable resource expiration. |
| Class Variable | cse_enable |
Enable or disable subscription verification requests. |
| Class Variable | cse_flex |
The flex blocking preference for the CSE. |
| Class Variable | cse_id |
The length of the generated resource IDs. |
| Class Variable | cse_max |
The maximum expiration delta for resources. |
| Class Variable | cse_operation_jobs_balance |
The latency for balancing jobs. |
| Class Variable | cse_operation_jobs_balance |
The reduce factor for balancing jobs. |
| Class Variable | cse_operation_jobs_balance |
The target for balancing jobs. |
| Class Variable | cse_operation_plugins_disabled |
A list of disabled plugins. |
| Class Variable | cse |
Replace existing plugins with the same name. |
| Class Variable | cse |
Enable or disable operation requests. |
| Class Variable | cse |
The size of the operation requests. |
| Class Variable | cse |
The originator for the CSE. |
| Class Variable | cse |
The Points of Access for the CSE. |
| Class Variable | cse |
A dictionary of CSE or service provider CSEs registrars. The keys are the CSE IDs, the values are dictionaries with the registrar information. |
| Class Variable | cse_registration_allowed |
Allowed AE originators for registration. |
| Class Variable | cse_registration_allowed |
Allowed CSR originators for registration. |
| Class Variable | cse_registration_check |
Time interval to check liveliness of registration(s). |
| Class Variable | cse_registration_check |
Check liveliness for registration. |
| Class Variable | cse_registration_unregister |
Unregister the CSR resource when stopping the CSE. |
| Class Variable | cse_release |
The release version of the CSE. |
| Class Variable | cse_request |
The request expiration delta for the CSE. |
| Class Variable | cse_resource |
The resource ID of the CSE. |
| Class Variable | cse_resource |
The resource name of the CSE. |
| Class Variable | cse_resources |
The path to the resources. |
| Class Variable | cse_security_enable |
Enable or disable ACP checks. |
| Class Variable | cse_security_full |
Full access for admin. |
| Class Variable | cse |
The main secret key for the CSE. |
| Class Variable | cse_send |
Send the To and From in responses. |
| Class Variable | cse |
Enable or disable the action processing service. This includes the ActionManager plugin and the related features in the CSE. |
| Class Variable | cse |
Enable or disable the announcement service. This includes the AnnouncementManager plugin and the related features in the CSE. |
| Class Variable | cse |
Enable or disable the group service. This includes the GroupManager plugin and the related features in the CSE. |
| Class Variable | cse |
Enable or disable the location service. This includes the LocationManager plugin and the related features in the CSE. |
| Class Variable | cse_service_remote |
Enable or disable the remote CSE service. This includes the RemoteCSEManager plugin and the related features in the CSE. |
| Class Variable | cse |
Enable or disable the semantic service. This includes the SemanticManager plugin and the related features in the CSE. |
| Class Variable | cse |
Enable or disable the time service. This includes the TimeManager plugin and the related features in the CSE. |
| Class Variable | cse_service_time |
Enable or disable the time series service. This includes the TimeSeriesManager plugin and the related features in the CSE. |
| Class Variable | cse_service |
The service provider ID of the CSE. |
| Class Variable | cse_sort |
Sort discovered resources. |
| Class Variable | cse |
Enable or disable statistics. |
| Class Variable | cse_statistics_write |
The write interval for statistics. |
| Class Variable | cse_supported |
The supported release versions of the CSE. |
| Class Variable | cse |
The type of the CSE. |
| Class Variable | database_backup |
The path for the database backup. |
| Class Variable | database |
The database of the PostgreSQL database. |
| Class Variable | database |
The host of the PostgreSQL database. |
| Class Variable | database |
The password of the PostgreSQL database. |
| Class Variable | database |
The port of the PostgreSQL database. |
| Class Variable | database |
The role of the PostgreSQL database. |
| Class Variable | database |
The schema of the PostgreSQL database. |
| Class Variable | database_reset |
Reset the database on startup. |
| Class Variable | database_tinydb_cache |
The cache size for the TinyDB database. |
| Class Variable | database |
The path to the TinyDB database. |
| Class Variable | database_tinydb_write |
The write delay for the TinyDB database. |
| Class Variable | database |
The type of the database. |
| Class Variable | http |
The address to listen on for HTTP the http server. |
| Class Variable | http_allow |
Allow PATCH for DELETE operations. |
| Class Variable | http |
Enable or disable CORS. |
| Class Variable | http |
The resources for CORS. |
| Class Variable | http |
Enable or disable the HTTP server. |
| Class Variable | http_enable |
Enable the management endpoint. |
| Class Variable | http_enable |
Enable the structure endpoint. |
| Class Variable | http_enable |
Enable the upper tester endpoint. |
| Class Variable | http_external |
The non-local root path of the HTTP path. This is used when the CSE is accessed from non-local addresses, e.g. in a Kubernetes cluster. |
| Class Variable | http_listen |
The network interface to listen on for HTTP. |
| Class Variable | http |
The port to listen on for HTTP. |
| Class Variable | http |
The root of the HTTP path. |
| Class Variable | http_security_basic |
The file for basic authentication for HTTP. |
| Class Variable | http_security_ca |
The CA certificate file for HTTP. |
| Class Variable | http_security_ca |
The CA private key file for HTTP. |
| Class Variable | http_security_enable |
Enable or disable basic authentication for HTTP. |
| Class Variable | http_security_enable |
Enable or disable token authentication for HTTP. |
| Class Variable | http_security_tls |
The TLS version for HTTP. |
| Class Variable | http_security_token |
The file for token authentication for HTTP. |
| Class Variable | http_security_use |
Enable or disable TLS for HTTP. |
| Class Variable | http_security_verify |
Enable or disable certificate verification for HTTP. |
| Class Variable | http |
The timeout for HTTP requests. |
| Class Variable | http_wsgi_connection |
The connection limit for the WSGI server. |
| Class Variable | http |
Enable or disable the WSGI server. |
| Class Variable | http_wsgi_thread |
The thread pool size for the WSGI server. |
| Class Variable | init |
The init directory of the ACME module. |
| Class Variable | logging |
The number of log entries. |
| Class Variable | logging_enable |
Enable or disable bindings logging. |
| Class Variable | logging_enable |
Enable or disable file logging. |
| Class Variable | logging_enable |
Enable or disable screen logging. |
| Class Variable | logging_enable |
Enable or disable UTC timezone. |
| Class Variable | logging |
The filter for logging. |
| Class Variable | logging |
The log level. |
| Class Variable | logging_max |
The maximum log message length. |
| Class Variable | logging |
The path for logging. |
| Class Variable | logging_queue |
The queue size for logging. |
| Class Variable | logging |
The size of the log. |
| Class Variable | logging_stack |
Enable or disable stack trace on error. |
| Class Variable | module |
The base directory of the ACME module. |
| Class Variable | mqtt |
The address to listen on for the MQTT server. |
| Class Variable | mqtt |
Enable or disable the MQTT server. |
| Class Variable | mqtt |
The keepalive for MQTT. |
| Class Variable | mqtt_listen |
The network interface to listen on for MQTT. |
| Class Variable | mqtt |
The port to listen on for MQTT. |
| Class Variable | mqtt_security_allowed |
The allowed credential IDs for MQTT. |
| Class Variable | mqtt_security_ca |
The CA certificate file for MQTT. |
| Class Variable | mqtt |
The password for MQTT. |
| Class Variable | mqtt |
The username for MQTT. |
| Class Variable | mqtt_security_use |
Enable or disable TLS for MQTT. |
| Class Variable | mqtt_security_verify |
Enable or disable certificate verification for MQTT. |
| Class Variable | mqtt |
The timeout for MQTT requests. |
| Class Variable | mqtt_topic |
The topic prefix for MQTT. |
| Class Variable | mqtt |
Enable or disable the MQTT over WebSocket. |
| Class Variable | mqtt |
The WebSocket path for MQTT. |
| Class Variable | mqtt |
The WebSocket port for MQTT. |
| Class Variable | resource_acp_self |
The self permission for ACP. |
| Class Variable | resource_actr_ecp |
The continuous for ACTR. |
| Class Variable | resource_actr_ecp |
The periodic for ACTR. |
| Class Variable | resource_cnt_enable |
Enable or disable limits for CNT. |
| Class Variable | resource |
The MBS for CNT. |
| Class Variable | resource |
The MIA for CNT. |
| Class Variable | resource |
The MNI for CNT. |
| Class Variable | resource_fcnt_enable |
Enable or disable limits for FCNT. |
| Class Variable | resource |
The MBS for FCNT. |
| Class Variable | resource |
The MIA for FCNT. |
| Class Variable | resource |
The MNI for FCNT. |
| Class Variable | resource_grp_result |
The result expiration time for GRP. |
| Class Variable | resource |
The MBS for LCP. |
| Class Variable | resource |
The MNI for LCP. |
| Class Variable | resource |
The expiration time for REQ. |
| Class Variable | resource_sub_batch |
The batch notify duration for SUB. |
| Class Variable | resource_ts_enable |
Enable or disable limits for TS. |
| Class Variable | resource |
The MBS for TS. |
| Class Variable | resource |
The MDN for TS. |
| Class Variable | resource |
The MIA for TS. |
| Class Variable | resource |
The MNI for TS. |
| Class Variable | resource |
The BCNI for TSB. |
| Class Variable | resource |
The BCNT for TSB. |
| Class Variable | scripting_file |
The file monitoring interval for scripting. |
| Class Variable | scripting_max |
The maximum runtime for scripting. |
| Class Variable | scripting_script |
The script directories for scripting. |
| Class Variable | scripting |
Enable or disable verbose mode for scripting. |
| Class Variable | textui |
Enable or disable the text UI. |
| Class Variable | textui_enable |
Enable or disable text editor syntax highlighting for the text UI. |
| Class Variable | textui_max |
The maximum request size for the text UI. |
| Class Variable | textui_notification |
The notification timeout for the text UI. |
| Class Variable | textui_refresh |
The refresh interval for the text UI. |
| Class Variable | textui_start |
Start with the text UI. |
| Class Variable | textui |
The theme for the text UI. |
| Class Variable | websocket |
The address to listen on for the WebSocket server. |
| Class Variable | websocket |
Enable or disable the WebSocket server. |
| Class Variable | websocket_listen |
The network interface to listen on for WebSocket. |
| Class Variable | websocket |
The log level for WebSocket. |
| Class Variable | websocket |
The port to listen on for WebSocket. |
| Class Variable | websocket_security_basic |
The file for basic authentication for WebSocket. |
| Class Variable | websocket_security_ca |
The CA certificate file for WebSocket. |
| Class Variable | websocket_security_ca |
The CA private key file for WebSocket. |
| Class Variable | websocket_security_enable |
Enable or disable basic authentication for WebSocket. |
| Class Variable | websocket_security_enable |
Enable or disable token authentication for WebSocket. |
| Class Variable | websocket_security_tls |
The TLS version for WebSocket. |
| Class Variable | websocket_security_token |
The file for token authentication for WebSocket. |
| Class Variable | websocket_security_use |
Enable or disable TLS for WebSocket. |
| Class Variable | websocket_security_verify |
Enable or disable certificate verification for WebSocket. |
| Class Variable | websocket |
The timeout for WebSocket requests. |
| Class Variable | webui |
Enable or disable the web UI. |
| Class Variable | webui |
The root path for the web UI. |
| Static Method | _error |
Print an error message to the console. |
| Static Method | _print |
Print a message to the console. If the CSE is running in headless mode, then the message is not printed. |
| Static Method | _warning |
Print a warning message to the console. |
| Class Variable | _args_base |
The runtime data directory passed as argument. This overrides the default (the CWD). |
| Class Variable | _args_coap |
The coap enabled flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args |
The configuration file passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_ |
The DB data directory passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_ |
The reset DB flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_ |
The DB storage mode passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args |
The headless flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_http |
The http address passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_http |
The http port passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_init |
The import directory passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_light |
The light scheme flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_listen |
The network interface passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args |
The log level passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_mqtt |
The mqtt enabled flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_remote |
The remote CSE enabled flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_run |
The https flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_run |
The http WSGI flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_statistics |
The statistics enabled flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_text |
The text UI flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_ws |
The WebSocket enabled flag passed as argument. This overrides the respective value in the configuration file. |
| Class Variable | _args_zk |
The Zookeeper host passed as argument. There is no equivalent in the configuration file. |
| Class Variable | _args_zk |
The Zookeeper port passed as argument. There is no equivalent in the configuration file. |
| Class Variable | _args_zk |
The Zookeeper root node passed as argument. There is no equivalent in the configuration file. |
| Class Variable | _configuration |
The configuration values documentation as a dictionary. |
| Class Variable | _cse_operation_plugins_enabled |
An internal dictionary of enabled plugins. The keys are the component names, the values are booleans indicating whether the corresponding plugin is enabled. |
| Class Variable | _default |
The default configuration file. |
| Class Variable | _default |
The default init file. |
Adds a documentation for a configuration key.
| Parameters | |
key:str | The configuration key to add the documentation for. |
markdown:str | The documentation in markdown format. |
Returns the complete configuration as a dictionary.
| Returns | |
dict[ | A dictionary with the complete configuration. |
Retrieve a configuration value or None if no configuration could be found for a key. The key is case-insensitive and dots are replaced by underscores.
Example
The following example retrieves the value of the configuration key 'http.port':
print(Configuration.get('http.port'))
| Parameters | |
key:str | The configuration key to retrieve. |
| Returns | |
Any | The configuration value or None if no configuration could be found for a key. |
Retrieves the documentation for a configuration key.
| Parameters | |
key:str | The configuration key to retrieve the documentation for. |
| Returns | |
str | None | The documentation in markdown format or None if no documentation could be found for the key. |
Check whether a configuration setting exsists.
| Parameters | |
key:str | The configuration key to check. |
| Returns | |
bool | True if the configuration key exists, False otherwise. |
Initialize and read the configuration. This method must be called before accessing any configuration value.
| Parameters | |
args:argparse.Namespace | None | Optional arguments. If not given, then the command line arguments are used. |
| Returns | |
bool | True on success, False otherwise. |
Initialize the directories for the configuration. This method must be called before accessing any configuration value.
| Returns | |
bool | True on success, False otherwise. |
Update a configuration value and inform other components via an event.
| Parameters | |
key:str | The configuration key to update. |
value:Any | The new value for the configuration key. |
| Returns | |
str | None | None if no error occurs, or a string with an error message, what has gone wrong while validating |
A dictionary of CSE or service provider CSEs registrars. The keys are the CSE IDs, the values are dictionaries with the registrar information.
Enable or disable the action processing service. This includes the ActionManager plugin and the related features in the CSE.
Enable or disable the announcement service. This includes the AnnouncementManager plugin and the related features in the CSE.
Enable or disable the group service. This includes the GroupManager plugin and the related features in the CSE.
Enable or disable the location service. This includes the LocationManager plugin and the related features in the CSE.
Enable or disable the remote CSE service. This includes the RemoteCSEManager plugin and the related features in the CSE.
Enable or disable the semantic service. This includes the SemanticManager plugin and the related features in the CSE.
Enable or disable the time service. This includes the TimeManager plugin and the related features in the CSE.
Enable or disable the time series service. This includes the TimeSeriesManager plugin and the related features in the CSE.
The non-local root path of the HTTP path. This is used when the CSE is accessed from non-local addresses, e.g. in a Kubernetes cluster.
Print a message to the console. If the CSE is running in headless mode, then the message is not printed.
| Parameters | |
msg:str | The message to print. |
markup:bool | None | If True, then the message is printed with markup. If False, then the message is printed without markup. |
The coap enabled flag passed as argument. This overrides the respective value in the configuration file.
The configuration file passed as argument. This overrides the respective value in the configuration file.
The DB data directory passed as argument. This overrides the respective value in the configuration file.
The reset DB flag passed as argument. This overrides the respective value in the configuration file.
The DB storage mode passed as argument. This overrides the respective value in the configuration file.
The headless flag passed as argument. This overrides the respective value in the configuration file.
The import directory passed as argument. This overrides the respective value in the configuration file.
The light scheme flag passed as argument. This overrides the respective value in the configuration file.
The network interface passed as argument. This overrides the respective value in the configuration file.
The mqtt enabled flag passed as argument. This overrides the respective value in the configuration file.
The remote CSE enabled flag passed as argument. This overrides the respective value in the configuration file.
The http WSGI flag passed as argument. This overrides the respective value in the configuration file.
The statistics enabled flag passed as argument. This overrides the respective value in the configuration file.
The WebSocket enabled flag passed as argument. This overrides the respective value in the configuration file.