Configuration service api
ConfigurationServiceInterface
Source code in hyrrokkin_engine/configuration_service_interface.py
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 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
clear_status()
abstractmethod
Clear the status message for the package configuration.
Source code in hyrrokkin_engine/configuration_service_interface.py
59 60 61 62 63 64 | |
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
124 125 126 127 128 129 130 131 132 133 134 135 | |
get_data(key)
abstractmethod
async
Get binary data associated with this package configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
a key to locate the data (can only contain alphanumeric characters and underscores) |
required |
Returns:
| Type | Description |
|---|---|
Union[bytes, None]
|
data or None if no data is associated with the key |
Source code in hyrrokkin_engine/configuration_service_interface.py
90 91 92 93 94 95 96 97 98 99 100 101 | |
get_data_keys()
abstractmethod
async
Returns the set of keys for which data is stored in this configuration
Returns:
| Type | Description |
|---|---|
list[str]
|
list of key names |
Source code in hyrrokkin_engine/configuration_service_interface.py
114 115 116 117 118 119 120 121 122 | |
get_package_version()
abstractmethod
Get the package version string from the schema.json metadata
Returns: package version string or "" if no version is defined in the metadata
Source code in hyrrokkin_engine/configuration_service_interface.py
41 42 43 44 45 46 47 | |
get_properties()
abstractmethod
async
Get the current properties associated with this configuration
Returns:
| Type | Description |
|---|---|
dict[str, JsonType]
|
properties |
Source code in hyrrokkin_engine/configuration_service_interface.py
66 67 68 69 70 71 72 73 74 | |
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
137 138 139 140 141 142 143 144 145 146 | |
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
29 30 31 32 33 34 35 36 37 38 39 | |
set_data(key, data)
abstractmethod
async
Set binary data associated with this package configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
a key to locate the data (can only contain alphanumeric characters and underscores) |
required |
data
|
Union[bytes, None]
|
binary data (bytes) to be stored (or None to remove previously stored data for this key) |
required |
Source code in hyrrokkin_engine/configuration_service_interface.py
103 104 105 106 107 108 109 110 111 112 | |
set_properties(properties)
abstractmethod
async
Set the current value for the configuration's property
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
properties
|
dict[str, JsonType]
|
the properties to set |
required |
Notes
properties should be a dictionary that is JSON-serialisable
Source code in hyrrokkin_engine/configuration_service_interface.py
76 77 78 79 80 81 82 83 84 85 86 87 | |
set_status(status_message='', level='info')
abstractmethod
Set a status message for the package configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status_message
|
str
|
a short descriptive message |
''
|
level
|
Literal['info', 'warning', 'error']
|
whether the message is "info", "warning" or "error" |
'info'
|
Source code in hyrrokkin_engine/configuration_service_interface.py
49 50 51 52 53 54 55 56 57 | |