class Importer:
Importer class to import various objects, configurations etc.
It is mainly run before the CSE is actually started or restarted.
| Method | assign |
Assign the imported attribute policies to each of the resources. This injects the imported attribute policies into all the Python Resource classes. |
| Method | import |
Import the resource attribute policies. |
| Method | import |
Import the configuration documentation from the resource path. |
| Method | import |
Import the enumeration types policies. |
| Method | import |
Import the attribute and hierarchy policies for flexContainer specializations. |
| Method | import |
Import the attribute, enum, flexContainer policies, and documentation. |
| Method | import |
Import the resource type policies from the resource paths. |
| Method | import |
Import the scripts from the resource path and additional directories specified in the configuration. |
| Method | initialize |
Initialization of an Importer instance. |
| Method | read |
Read and parse a JSON data structure from a file filename. |
| Method | remove |
Remove all previous imported scripts and definitions. |
| Method | remove |
Internally remove all imported scripts. |
| Method | replace |
No summary |
| Class Variable | __slots__ |
Slots for Importer class. |
| Class Variable | dispatcher |
Injected Dispatcher instance. |
| Class Variable | factory |
Injected Factory instance. |
| Class Variable | script |
ScriptManager instance. |
| Class Variable | validator |
Injected Validator instance. |
| Instance Variable | extended |
Extended list of script paths, which is used for importing scripts. |
| Instance Variable | is |
Boolean flag to indicate whether the importer is currently importing resources. |
| Instance Variable | macro |
Regular expression to match macros in scripts. |
| Instance Variable | resource |
Path to the directory from where to import resources, policies, scripts etc. |
| Instance Variable | rt |
Path to the directory from where to import additional resources, policies, scripts etc. |
| Method | _expand |
Expand an enum values list by parsing the range definitions and return a list of integer values. |
| Method | _finish |
Finish the importing process, e.g. re-enable access control. |
| Method | _parse |
Parse a single attribute definitions for common as well as for flexContainer attributes. |
| Method | _prepare |
Prepare the importing process. |
| Class Variable | _enum |
Imported enumeration values. |
| Instance Variable | _old |
Used to store the old value of the enableAcpChecks configuration setting during importing. |
Assign the imported attribute policies to each of the resources. This injects the imported attribute policies into all the Python Resource classes.
| Returns | |
bool | True if there were no errors during the assignment, False otherwise. |
Import the resource attribute policies.
| Parameters | |
path:str | Path to a directory from where to import attribute policies. |
| Returns | |
bool | True if the policies were successfully imported, False otherwise. |
Import the configuration documentation from the resource path.
| Returns | |
bool | True if the documentation was successfully imported, False otherwise. |
Import the enumeration types policies.
| Parameters | |
path:str | Path to a directory from where to import enumeration policies. |
| Returns | |
bool | True if the policies were successfully imported, False otherwise. |
Import the attribute and hierarchy policies for flexContainer specializations.
| Parameters | |
path:str | Path to a directory from where to import flexContainer policies. |
| Returns | |
bool | True if the policies were successfully imported, False otherwise. |
Import the attribute, enum, flexContainer policies, and documentation.
| Returns | |
bool | Boolean indicating success or failure |
Import the scripts from the resource path and additional directories specified in the configuration.
list[ int | str], typeShortname: str, fn: str) -> list[ int] | None:
¶
Expand an enum values list by parsing the range definitions and return a list of integer values.
| Parameters | |
evalues:list[ | A list of integer values or range definitions (e.g. "1..10") to expand. |
typestr | The type and attribute name (for logging purposes). |
fn:str | The filename where the enum values are defined (for logging purposes). |
| Returns | |
list[ | A list of integer values, or None in case of an error. |
JSON, fn: str, typeShortname: str | None = None, sname: str | None = None, checkListType: bool | None = True) -> AttributePolicy | None:
¶
Parse a single attribute definitions for common as well as for flexContainer attributes.
| Parameters | |
attr:JSON | JSON dictionary with the attribute definition to parse. |
fn:str | Filename that contains the attribute definition. |
typestr | None | Domain and attribute name. Mandatory for a flexContainer specialization, optional otherwise. |
sname:str | None | Shortname of the attribute. |
checkbool | None | Undocumented |
| Returns | |
AttributePolicy | None | The parsed definition in an AttributePolicy. |