Configuration service api
Configuration Services API
When a hyrrokkin package configuration instance is created, the constructor is passed a configuration services instance which implements the following methods
ConfigurationServiceInterface
Source code in hyrrokkin_engine/configuration_service_interface.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
get_configuration(package_id)
abstractmethod
Obtain a configuration object if defined for the specified package.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
package_id
|
str
|
the id of the package configuration to obtain |
required |
Returns:
Type | Description |
---|---|
Union[None, ConfigurationInterface]
|
a configuration object or None |
Source code in hyrrokkin_engine/configuration_service_interface.py
92 93 94 95 96 97 98 99 100 101 102 103 |
|
get_data(key)
abstractmethod
async
Get binary data (bytes) associated with this package configuration.
:param key: a key to locate the data (can only contain alphanumeric characters and underscores)
:return: data or None if no data is associated with the key
Source code in hyrrokkin_engine/configuration_service_interface.py
71 72 73 74 75 76 77 78 79 80 |
|
get_property(property_name, default_value=None)
abstractmethod
Get the current value for configuration's property
:param property_name: the name of the property :param default_value: a default value to return if the named property is not defined on the configuration :return: property value
Source code in hyrrokkin_engine/configuration_service_interface.py
48 49 50 51 52 53 54 55 56 57 |
|
request_open_client(client_name, session_id)
abstractmethod
Called to request that a client of this configuration be opened
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client_name
|
str
|
the type of client to load |
required |
session_id
|
str
|
specify which session to send the request to (defaults to all sessions) |
required |
Source code in hyrrokkin_engine/configuration_service_interface.py
105 106 107 108 109 110 111 112 113 114 |
|
resolve_resource(resource_path)
abstractmethod
Resolve a relative resource path based on the location of the package schema
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_path
|
str
|
the file path to resolve |
required |
Returns:
Type | Description |
---|---|
str
|
resolved path as a string containing a URL |
Source code in hyrrokkin_engine/configuration_service_interface.py
26 27 28 29 30 31 32 33 34 35 36 |
|
set_data(key, data)
abstractmethod
async
Set binary data (bytes) associated with this package configuration.
:param key: a key to locate the data (can only contain alphanumeric characters and underscores) :param data: binary data (bytes) to be stored (or None to remove previously stored data for this key)
Source code in hyrrokkin_engine/configuration_service_interface.py
82 83 84 85 86 87 88 89 90 |
|
set_property(property_name, property_value)
abstractmethod
Set the current value for the configuration's property
:param property_name: the name of the property :param property_value: the property value
:notes: property values MUST be JSON-serialisable
Source code in hyrrokkin_engine/configuration_service_interface.py
59 60 61 62 63 64 65 66 67 68 69 |
|
set_status(status_message='', level='info')
abstractmethod
Set an info status message for the packahe configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
status_message
|
str
|
a short descriptive message or empty string (to clear the status) |
''
|
level
|
Literal['info', 'warning', 'error']
|
whether the message is "info", "warning" or "error" |
'info'
|
Source code in hyrrokkin_engine/configuration_service_interface.py
38 39 40 41 42 43 44 45 46 |
|