nmstate/.gitignore

50 lines
555 B
Plaintext
Raw Permalink Normal View History

2018-05-08 08:02:23 +03:00
__pycache__/
*.py[cod]
.tox/
.pytest_cache/
*.egg-info/
.eggs/
dist/
.coverage
htmlcov-*/
AUTHORS
ChangeLog
exported-artifacts
*.rpm
doc/nmstatectl.8
doc/nmstate.service.8
/ansible
/.vagrant
/Vagrantfile
_kubevirtci
rust/Cargo.lock
rust/target
rust/src/clib/test/nmstate_test
Introduce support of nmpolicy Introducing support of nmpolicy syntax[1] including rust, python and C bindings. Implementation workflow: * `NetworkPolicy` could deserialize from existing nmpolicy file. * Each of capture line will produce a new `NetworkState` and stored for follow up capture line processing. * Each capture line will be converted to `Vec<NetworkCaptureToken>`, then fill into `NetworkCaptureCommand` for filtering or updating matched `NetworkState`. * We use `serde_json::Map` to walk through the property defined in the format of `routes.running.next-hop-interface`. The cli tools could be used also: nmstatectl p <policy.yml> [-c current_state.yml] \ [-s saved_capture.yml] [-o /path/to/output_capture.yml] API: * Using running current to generate `NetworkState`: ```rust let policy: NetworkPolicy = serde_yaml::from_str(policy_content)?; let state = NetworkState::try_from(policy)? ``` * Use saved current to generate `NetworkState`: ```rust let mut policy: NetworkPolicy = serde_yaml::from_str(policy_content)?; policy.current = Some(serde_yaml::from_str(current_state_content)?); let state = NetworkState::try_from(policy)? ``` * Store captured data: ```rust let policy: NetworkPolicy = serde_yaml::from_str(policy_content)?; let current_state = serde_yaml::from_str(current_state_content)?; let captured_states = policy.capture.execute(&current_state)?; // Use your own way to store the captured data // You may also use `NetworkCaptureRules::execute()` directly. ``` * Load captured data: ```rust // Use your own way to load the data. We just need // HashMap<String, NetworkState> for captured_states let current_state = serde_yaml::from_str(current_state_content)?; let policy: NetworkPolicy = serde_yaml::from_str(policy_content)?; let state = policy.desired.fill_with_captured_data(&captured_states)?; // You may also use `NetworkStateTemplate::fill_with_captured_data()` // directly. ``` Both unit test cases and integration test case are included. [1]: https://nmstate.io/nmpolicy/user-guide/102-policy-syntax.html Signed-off-by: Gris Ge <fge@redhat.com>
2022-11-14 21:19:10 +08:00
rust/src/clib/test/nmpolicy_test
rust/src/clib/test/vgcore*
rust/src/clib/nmstate.h
rust/vendor/
*.swp
packaging/nmstate.spec
doc/nmstatectl.8
doc/nmstate-autoconf.8
nmstate-*.tar.gz
nmstate-*.tar.gz.asc
/tags
/.vscode
rust/src/clib/nmstate.pc
rust/src/python/build