From 66082d7be86f1f0cf80899236a91bad68f7df264 Mon Sep 17 00:00:00 2001 From: Wilhelm Wijkander Date: Wed, 17 Jan 2024 20:08:58 +0100 Subject: [PATCH] Add support for Huawei VRP CLI --- assets/platforms/huawei_vrp.yaml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 assets/platforms/huawei_vrp.yaml diff --git a/assets/platforms/huawei_vrp.yaml b/assets/platforms/huawei_vrp.yaml new file mode 100644 index 0000000..49b320b --- /dev/null +++ b/assets/platforms/huawei_vrp.yaml @@ -0,0 +1,38 @@ +--- +platform-type: 'huawei_vrp' +default: + driver-type: 'network' + privilege-levels: + user-view: + name: 'user-view' + pattern: '(?im)^<[\w.\-@/:]{1,63}>$' + previous-priv: + deescalate: + escalate: + escalate-auth: false + escalate-prompt: + system-view: + name: 'system-view' + pattern: '(?im)^[[\w.\-@/:]{1,63}]$' + previous-priv: 'user-view' + deescalate: 'quit' + escalate: 'system-view' + escalate-auth: false + escalate-prompt: + default-desired-privilege-level: 'user-view' + failed-when-contains: + - 'Error: Unrecognized command' + - 'Error: Wrong parameter' + # missing whitespace is intentional below + - 'Error:Ambiguous command' + - 'Error:Incomplete command' + textfsm-platform: 'huawei_vrp' # ignored in go because no ntc-templates + network-on-open: + - operation: 'acquire-priv' # targets default desired priv by default + - operation: 'driver.send-command' + command: 'screen-length 0 temporary' + network-on-close: + - operation: 'acquire-priv' + - operation: 'channel.write' + input: 'quit' + - operation: 'channel.return'