capella_rm_bridge package#
Subpackages#
- capella_rm_bridge.changeset package
- Submodules
- capella_rm_bridge.changeset.actiontypes module
- capella_rm_bridge.changeset.change module
MissingCapellaModule
TrackerChange
TrackerChange.__init__()
TrackerChange.actions
TrackerChange.attribute_definition_create_action()
TrackerChange.attribute_definition_mod_action()
TrackerChange.attribute_value_create_action()
TrackerChange.attribute_value_mod_action()
TrackerChange.calculate_change()
TrackerChange.check_attribute_value_is_valid()
TrackerChange.check_requirements_module()
TrackerChange.config
TrackerChange.data_type_create_action()
TrackerChange.data_type_definition_mod_actions()
TrackerChange.data_type_definitions
TrackerChange.data_type_mod_action()
TrackerChange.errors
TrackerChange.gather_logs
TrackerChange.invalidate_deletion()
TrackerChange.model
TrackerChange.req_delete_actions()
TrackerChange.req_module
TrackerChange.reqt_folder
TrackerChange.reqtype_fields_filter
TrackerChange.requirement_type_create_action()
TrackerChange.requirement_type_delete_actions()
TrackerChange.requirement_type_mod_action()
TrackerChange.requirement_types
TrackerChange.requirement_types_folder_create_action()
TrackerChange.tracker
TrackerChange.yield_data_type_definition_create_actions()
TrackerChange.yield_requirement_type_create_actions()
TrackerChange.yield_requirements_create_actions()
TrackerChange.yield_requirements_mod_actions()
make_requirement_delete_actions()
- capella_rm_bridge.changeset.find module
- Module contents
Submodules#
capella_rm_bridge.auditing module#
Functionality for reporting changes during model modification.
- class capella_rm_bridge.auditing.ChangeAuditor#
Bases:
object
Audits changes to ModelElements via its Accessors.
Warning
This will permanently add an audit hook to the global hook table. The auditor will keep the model alive, which may consume excessive memory. To avoid this, call the auditor object’s
detach()
method once you are done with it. This is automatically done if you use it as a context manager.Examples
>>> with ChangeAuditor(model) as changes: ... comp = model.la.all_components.by_name("Hogwarts") ... comp.name = "Not Hogwarts anymore" ... comp.allocated_functions.insert( ... 0, model.la.all_functions[0] ... ) ... del comp.components[0] ... >>> changes [ Modification( module="853cb005-cba0-489b-8fe3-bb694ad4543b", parent="<LogicalComponent 'Hogwarts' (0d2edb8f-fa34-4e73-89e...)>", attribute="name", new="Not Hogwarts anymore", old="Hogwarts", ), Extension( module="853cb005-cba0-489b-8fe3-bb694ad4543b", parent="<LogicalComponent 'Hogwarts' (0d2edb8f-fa34-4e73-89e...)>", attribute="allocated_functions", element="<LogicalFunction 'Root Logical Function' (f2...)>", uuid="f28ec0f8-f3b3-43a0-8af7-79f194b29a2d", ), Deletion( module="853cb005-cba0-489b-8fe3-bb694ad4543b", parent="<LogicalComponent 'Hogwarts' (0d2edb8f-fa34-4e73-89e...)>", attribute="components", element="<LogicalComponent 'Campus' (6583b560-6d2f-...)>", uuid="6583b560-6d2f-4190-baa2-94eef179c8ea", ) ]
Filtering the context by class-names:
>>> with ChangeAuditor(model, {"LogicalComponent"}) as changes: ... comp = model.la.all_components.by_name("Hogwarts") ... comp.name = "Not Hogwarts anymore" ... fnc = model.la.all_functions[0] ... fnc.name = "Not Hogwarts anymore" ... >>> changes [ Modification( module="853cb005-cba0-489b-8fe3-bb694ad4543b", parent="<LogicalComponent 'Hogwarts' (0d2edb8f-fa34-4e73-89e...)>", attribute="name", new="Not Hogwarts anymore", old="Hogwarts", ) ]
Securing writable context with the
dump()
function:>>> with ChangeAuditor(model) as changes: ... comp = model.la.all_components.by_name("Hogwarts") ... comp.name = "Not Hogwarts anymore" ... comp.allocated_functions.insert( ... 0, model.la.all_functions[0] ... ) ... del comp.components[0] ... >>> dump(changes) [ { "_type": "Modification, "module": "853cb005-cba0-489b-8fe3-bb694ad4543b", "parent": "<LogicalComponent 'Hogwarts' (0d2edb8f-fa34-4e73-...)>", "attribute": "name", "new": "Not Hogwarts anymore", "old": "Hogwarts" }, { "_type": "Extension", "module": "853cb005-cba0-489b-8fe3-bb694ad4543b", "parent": "<LogicalComponent 'Hogwarts' (0d2edb8f-fa34-4e73-...)>", "attribute": "allocated_functions", "element": "<LogicalFunction 'Fnc' (f28ec0f8-f3b3-43a...)>", "uuid": "f28ec0f8-f3b3-43a0-8af7-79f194b29a2d" }, { "_type": "Deletion", "module": "853cb005-cba0-489b-8fe3-bb694ad4543b", "parent": "<LogicalComponent 'Hogwarts' (0d2edb8f-fa34-4e73-...)>", "attribute": "components", "element": "<LogicalComponent 'Comp' (6583b560-6d2f-4...)>", "uuid": "6583b560-6d2f-4190-baa2-94eef179c8ea" } ]
- __init__(model, classes=())#
Initialize a ChangeAuditor.
- Parameters:
model (MelodyModel) – A model instance to audit changes for.
classes (Container[str]) – An optional class-name filter. Only changes to
ModelObject
s with matching class-type are stored in context.
- Return type:
None
- detach()#
Delete the reference to the model instance.
- Return type:
None
- class capella_rm_bridge.auditing.Deletion#
Bases:
Extension
Data that describes the context for a deletion event.
- class capella_rm_bridge.auditing.Extension#
Bases:
_Change
Data that describes the context for an extension event.
- __init__(module, parent, attribute, element, uuid)#
- class capella_rm_bridge.auditing.Modification#
Bases:
_Change
Data that describes the context for a modification event.
- __init__(module, parent, attribute, new, old)#
- class capella_rm_bridge.auditing.RMReporter#
Bases:
object
Stores and reports on all changes that were made to a model.
- __init__(model)#
- Parameters:
model (MelodyModel) –
- Return type:
None
- create_commit_message(tool_metadata)#
Return a commit message for all changes in the store.
- model: MelodyModel#
The model instance that was changed.
- ptrn = re.compile('<(?P<ClassName>[A-Za-z]+)\\b.*?>')#
Regex for matching the class name from a short representation.
- store: dict[str, list[Union[capella_rm_bridge.auditing.Modification, capella_rm_bridge.auditing.Extension, capella_rm_bridge.auditing.Deletion]]]#
A change-store that maps identifiers to a sequence of changes.
- capella_rm_bridge.auditing.dump(context)#
Convert a
ChangeContext
into something savely writable.- Parameters:
context (list[Union[capella_rm_bridge.auditing.Modification, capella_rm_bridge.auditing.Extension, capella_rm_bridge.auditing.Deletion]]) –
- Return type:
- capella_rm_bridge.auditing.formulate_statement(change, source)#
Return an audit statement about the given change.
- Parameters:
change (Modification | Extension | Deletion) –
source (str) –
- Return type:
- capella_rm_bridge.auditing.generate_main_message(categories)#
Return the main commit message corpus listing all categories.
capella_rm_bridge.load module#
- capella_rm_bridge.load.load_yaml(config_path)#
Return Requirements Management (RM) Bridge YAML configuration.
trackers: # List all trackers for which a snapshot should be exported - external-id : 25093 capella-uuid: 3be8d0fc-c693-4b9b-8fa1-d59a9eec6ea4 fields: - Capella ID - Type - Status - Color - Submitted at model: path: PATH/TO/YOUR_MODEL.aird # Additional sections which configure the snapshot importer # may also appear here
Module contents#
The rm_bridge package.