scrapli 2.0.0a3__py3-none-musllinux_1_1_aarch64.whl → 2.0.0a5__py3-none-musllinux_1_1_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. scrapli/__init__.py +5 -5
  2. scrapli/auth.py +14 -7
  3. scrapli/cli.py +334 -66
  4. scrapli/cli_parse.py +1 -1
  5. scrapli/cli_result.py +42 -0
  6. scrapli/definitions/aethra_atosnt.yaml +9 -0
  7. scrapli/definitions/alcatel_aos.yaml +9 -0
  8. scrapli/definitions/arista_eos.yaml +1 -0
  9. scrapli/definitions/aruba_aoscx.yaml +33 -0
  10. scrapli/definitions/cisco_aireos.yaml +31 -0
  11. scrapli/definitions/cisco_asa.yaml +48 -0
  12. scrapli/definitions/cisco_cbs.yaml +50 -0
  13. scrapli/definitions/cisco_ftd.yaml +42 -0
  14. scrapli/definitions/cisco_nxos.yaml +2 -0
  15. scrapli/definitions/cumulus_linux.yaml +28 -0
  16. scrapli/definitions/cumulus_vtysh.yaml +42 -0
  17. scrapli/definitions/datacom_dmos.yaml +30 -0
  18. scrapli/definitions/datacom_dmswitch.yaml +32 -0
  19. scrapli/definitions/default.yaml +9 -0
  20. scrapli/definitions/dell_emc.yaml +46 -0
  21. scrapli/definitions/dell_enterprisesonic.yaml +40 -0
  22. scrapli/definitions/dlink_os.yaml +46 -0
  23. scrapli/definitions/edgecore_ecs.yaml +35 -0
  24. scrapli/definitions/eltex_esr.yaml +43 -0
  25. scrapli/definitions/fortinet_fortios.yaml +20 -0
  26. scrapli/definitions/fortinet_wlc.yaml +33 -0
  27. scrapli/definitions/hp_comware.yaml +31 -0
  28. scrapli/definitions/huawei_smartax.yaml +61 -0
  29. scrapli/definitions/huawei_vrp.yaml +56 -0
  30. scrapli/definitions/juniper_junos.yaml +3 -0
  31. scrapli/definitions/nokia_srlinux.yaml +13 -2
  32. scrapli/definitions/nokia_sros.yaml +31 -0
  33. scrapli/definitions/nokia_sros_classic.yaml +33 -0
  34. scrapli/definitions/nokia_sros_classic_aram.yaml +25 -0
  35. scrapli/definitions/paloalto_panos.yaml +36 -0
  36. scrapli/definitions/raisecom_ros.yaml +45 -0
  37. scrapli/definitions/ruckus_fastiron.yaml +45 -0
  38. scrapli/definitions/ruckus_unleashed.yaml +64 -0
  39. scrapli/definitions/siemens_roxii.yaml +28 -0
  40. scrapli/definitions/versa_flexvnf.yaml +45 -0
  41. scrapli/definitions/vyos_vyos.yaml +35 -0
  42. scrapli/definitions/zyxel_dslam.yaml +18 -0
  43. scrapli/ffi.py +1 -1
  44. scrapli/ffi_mapping.py +92 -37
  45. scrapli/ffi_mapping_cli.py +146 -22
  46. scrapli/ffi_mapping_netconf.py +28 -60
  47. scrapli/ffi_mapping_options.py +38 -6
  48. scrapli/ffi_types.py +43 -3
  49. scrapli/helper.py +56 -0
  50. scrapli/lib/{libscrapli.0.0.1-alpha.10.dylib → libscrapli.0.0.1-alpha.17.dylib} +0 -0
  51. scrapli/lib/{libscrapli.so.0.0.1-alpha.10 → libscrapli.so.0.0.1-alpha.17} +0 -0
  52. scrapli/netconf.py +36 -147
  53. scrapli/transport.py +71 -130
  54. {scrapli-2.0.0a3.dist-info → scrapli-2.0.0a5.dist-info}/METADATA +1 -1
  55. scrapli-2.0.0a5.dist-info/RECORD +68 -0
  56. scrapli-2.0.0a3.dist-info/RECORD +0 -35
  57. {scrapli-2.0.0a3.dist-info → scrapli-2.0.0a5.dist-info}/WHEEL +0 -0
  58. {scrapli-2.0.0a3.dist-info → scrapli-2.0.0a5.dist-info}/licenses/LICENSE +0 -0
  59. {scrapli-2.0.0a3.dist-info → scrapli-2.0.0a5.dist-info}/top_level.txt +0 -0
scrapli/cli_parse.py CHANGED
@@ -93,7 +93,7 @@ def textfsm_parse(
93
93
  originating textfsm.parser.TextFSMError exception.
94
94
 
95
95
  """
96
- import textfsm
96
+ import textfsm # noqa: PLC0415
97
97
 
98
98
  if isinstance(template, str):
99
99
  if template.startswith("http://") or template.startswith("https://"):
scrapli/cli_result.py CHANGED
@@ -4,6 +4,7 @@ from typing import Any, TextIO
4
4
 
5
5
  from scrapli.cli_parse import genie_parse, textfsm_get_template, textfsm_parse
6
6
  from scrapli.exceptions import ParsingException
7
+ from scrapli.helper import bulid_result_preview, unix_nano_timestmap_to_iso
7
8
 
8
9
  OPERATION_DELIMITER = "__libscrapli__"
9
10
 
@@ -48,6 +49,30 @@ class Result:
48
49
  self.textfsm_platform = textfsm_platform
49
50
  self.genie_platform = genie_platform
50
51
 
52
+ def __str__(self) -> str:
53
+ """
54
+ Magic str method for Result class
55
+
56
+ Args:
57
+ N/A
58
+
59
+ Returns:
60
+ str: str for class object
61
+
62
+ Raises:
63
+ N/A
64
+
65
+ """
66
+ return (
67
+ "<-----\n"
68
+ f"\tInput(s) : {self.inputs}\n"
69
+ f"\tStart Time : {unix_nano_timestmap_to_iso(timestamp=self.start_time)}\n"
70
+ f"\tEnd Time : {unix_nano_timestmap_to_iso(timestamp=self.end_time)}\n"
71
+ f"\tElapsed Time (s) : {self.elapsed_time_seconds:.2f}s\n"
72
+ f"\tResult : {bulid_result_preview(result=self.result)}\n"
73
+ "----->"
74
+ )
75
+
51
76
  def extend(self, result: "Result") -> None:
52
77
  """
53
78
  Extends this Result object with another Result object.
@@ -141,6 +166,23 @@ class Result:
141
166
  """
142
167
  return "\n".join(self.results)
143
168
 
169
+ @property
170
+ def result_raw(self) -> bytes:
171
+ """
172
+ Returns the results (raw) joined on newline chars. Note this does *not* include inputs sent.
173
+
174
+ Args:
175
+ N/A
176
+
177
+ Returns:
178
+ bytes: joined results
179
+
180
+ Raises:
181
+ N/A
182
+
183
+ """
184
+ return b"\n".join(self.results_raw)
185
+
144
186
  def textfsm_parse(
145
187
  self,
146
188
  index: int = 0,
@@ -0,0 +1,9 @@
1
+ ---
2
+ prompt_pattern: '^[a-z0-9.\-_@]{1,64}>>'
3
+ default_mode: 'exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^[a-z0-9.\-_@]{1,64}>>'
7
+ on_close_instructions:
8
+ - write:
9
+ input: '\x04'
@@ -0,0 +1,9 @@
1
+ ---
2
+ prompt_pattern: '^[a-zA-Z0-9.\-_@\/:]{1,63}[>|#]\s*'
3
+ default_mode: 'exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^[a-zA-Z0-9.\-_@\/:]{1,63}[>|#]\s*'
7
+ on_close_instructions:
8
+ - write:
9
+ input: 'exit'
@@ -62,3 +62,4 @@ on_close_instructions:
62
62
  requested_mode: 'privileged_exec'
63
63
  - write:
64
64
  input: 'exit'
65
+ ntc_templates_platform: 'arista_eos'
@@ -0,0 +1,33 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'privileged_exec'
4
+ modes:
5
+ - name: 'privileged_exec'
6
+ prompt_pattern: '^[\w.\-@/:]{1,63}#\s?$'
7
+ accessible_modes:
8
+ - name: 'configuration'
9
+ instructions:
10
+ - send_input:
11
+ input: 'configure terminal'
12
+ - name: 'configuration'
13
+ prompt_pattern: '^[\w.\-@/:]{1,63}\(config[\w.\-@/:]{0,32}\)#\s?$'
14
+ accessible_modes:
15
+ - name: 'privileged_exec'
16
+ instructions:
17
+ - send_input:
18
+ input: 'exit'
19
+ failure_indicators:
20
+ - '% Command incomplete.'
21
+ - 'Invalid input:'
22
+ - 'doesn''t exist'
23
+ on_open_instructions:
24
+ - enter_mode:
25
+ requested_mode: 'privileged_exec'
26
+ - send_input:
27
+ input: 'no page'
28
+ on_close_instructions:
29
+ - enter_mode:
30
+ requested_mode: 'privileged_exec'
31
+ - write:
32
+ input: 'exit'
33
+ ntc_templates_platform: 'aruba_aoscx'
@@ -0,0 +1,31 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^\([\w. -]{1,31}\) >$'
7
+ accessible_modes:
8
+ - name: 'configuration'
9
+ instructions:
10
+ - send_input:
11
+ input: 'config'
12
+ - name: 'configuration'
13
+ prompt_pattern: '^\([\w. -]{1,31}\) config>$'
14
+ accessible_modes:
15
+ - name: 'exec'
16
+ instructions:
17
+ - send_input:
18
+ input: 'exit'
19
+ failure_indicators:
20
+ - 'Incorrect Usage. Use the ''?'' or <TAB> key to list commands.'
21
+ - 'Incorrect input!'
22
+ on_open_instructions:
23
+ - send_input:
24
+ input: 'config paging disable'
25
+ on_close_instructions:
26
+ - enter_mode:
27
+ requested_mode: 'exec'
28
+ - write:
29
+ input: 'logout'
30
+ force_in_session_auth: true
31
+ ntc_templates_platform: 'cisco_wlc_ssh'
@@ -0,0 +1,48 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'privileged_exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^[\w\./-]{1,63}>\s?$'
7
+ accessible_modes:
8
+ - name: 'privileged_exec'
9
+ instructions:
10
+ - send_prompted_input:
11
+ input: 'enable'
12
+ prompt_pattern: '^(P|p)assword:\s?$'
13
+ response: '__lookup::enable'
14
+ - name: 'privileged_exec'
15
+ prompt_pattern: '^[\w\./-]{1,63}#\s?$'
16
+ accessible_modes:
17
+ - name: 'exec'
18
+ instructions:
19
+ - send_input:
20
+ input: 'disable'
21
+ - name: 'configuration'
22
+ instructions:
23
+ - send_input:
24
+ input: 'configure terminal'
25
+ - name: 'configuration'
26
+ prompt_pattern: '^[\w\./-]{1,63}\([\w-]{0,32}\)#\s?$'
27
+ accessible_modes:
28
+ - name: 'privileged_exec'
29
+ instructions:
30
+ - send_input:
31
+ input: 'exit'
32
+ failure_indicators:
33
+ - '% Ambiguous command'
34
+ - '% Incomplete command'
35
+ - '% Invalid input detected'
36
+ - '% Unknown command'
37
+ on_open_instructions:
38
+ - enter_mode:
39
+ requested_mode: 'privileged_exec'
40
+ - send_input:
41
+ input: 'terminal pager 0'
42
+ on_close_instructions:
43
+ - enter_mode:
44
+ requested_mode: 'privileged_exec'
45
+ - write:
46
+ input: 'logout'
47
+ ntc_templates_platform: 'cisco_asa'
48
+ genie_platform: 'asa'
@@ -0,0 +1,50 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'privileged_exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^[a-zA-Z0-9-.]{1,58}>$'
7
+ accessible_modes:
8
+ - name: 'privileged_exec'
9
+ instructions:
10
+ - send_prompted_input:
11
+ input: 'enable'
12
+ prompt_exact: '^(?:enable\s){0,1}Password:\s?$'
13
+ response: '__lookup::enable'
14
+ - name: 'privileged_exec'
15
+ prompt_pattern: '^[a-zA-Z0-9-.]{1,58}#$'
16
+ accessible_modes:
17
+ - name: 'exec'
18
+ instructions:
19
+ - send_input:
20
+ input: 'disable'
21
+ - name: 'configuration'
22
+ instructions:
23
+ - send_input:
24
+ input: 'configure terminal'
25
+ - name: 'configuration'
26
+ prompt_pattern: '^[a-zA-Z0-9-.]{1,58}\([\w.\-@/:+]{1,32}\)#$'
27
+ accessible_modes:
28
+ - name: 'privileged_exec'
29
+ instructions:
30
+ - send_input:
31
+ input: 'end'
32
+ failure_indicators:
33
+ - '% Incomplete command'
34
+ - '% Unrecognized command'
35
+ - '% missing mandatory parameter'
36
+ - '% bad parameter value'
37
+ - '% Ambiguous command'
38
+ on_open_instructions:
39
+ - enter_mode:
40
+ requested_mode: 'privileged_exec'
41
+ - send_input:
42
+ input: 'terminal datadump'
43
+ - send_input:
44
+ input: 'terminal width 0'
45
+ on_close_instructions:
46
+ - enter_mode:
47
+ requested_mode: 'privileged_exec'
48
+ - write:
49
+ input: 'exit'
50
+ ntc_templates_platform: 'cisco_s300'
@@ -0,0 +1,42 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^>\s*'
7
+ accessible_modes:
8
+ - name: 'expert'
9
+ instructions:
10
+ - send_input:
11
+ input: 'expert'
12
+ - name: 'expert'
13
+ prompt_pattern: '^[\w.-]{1,63}@[^$]+\$\s*$'
14
+ accessible_modes:
15
+ - name: 'exec'
16
+ instructions:
17
+ - send_input:
18
+ input: 'exit'
19
+ - name: 'root'
20
+ instructions:
21
+ - send_prompted_input:
22
+ input: 'sudo su -'
23
+ prompt_exact: '^Password:\s?$'
24
+ response: '__lookup::root'
25
+ - name: 'root'
26
+ prompt_pattern: '^root@[^#]+#\s*$'
27
+ accessible_modes:
28
+ - name: 'expert'
29
+ instructions:
30
+ - send_input:
31
+ input: 'exit'
32
+ failure_indicators:
33
+ - 'Syntax error:'
34
+ on_open_instructions:
35
+ - enter_mode:
36
+ requested_mode: 'exec'
37
+ on_close_instructions:
38
+ - enter_mode:
39
+ requested_mode: 'privileged_exec'
40
+ - write:
41
+ input: 'logout'
42
+ ntc_templates_platform: 'cisco_ftd'
@@ -62,3 +62,5 @@ on_close_instructions:
62
62
  requested_mode: 'privileged_exec'
63
63
  - write:
64
64
  input: 'exit'
65
+ ntc_templates_platform: 'cisco_nxos'
66
+ genie_platform: 'nxos'
@@ -0,0 +1,28 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^\S+@\S+:\S+:\S+[\$|#]\s*$'
7
+ accessible_modes:
8
+ - name: 'root'
9
+ instructions:
10
+ - send_prompted_input:
11
+ input: 'sudo su'
12
+ prompt_exact: ':'
13
+ response: '__lookup::enable'
14
+ - name: 'root'
15
+ prompt_pattern: '^\S+@\S+:\S+:\S+#\s*$'
16
+ accessible_modes:
17
+ - name: 'exec'
18
+ instructions:
19
+ - send_input:
20
+ input: 'exit'
21
+ failure_indicators:
22
+ - 'Permission denied'
23
+ - 'ERROR:'
24
+ on_close_instructions:
25
+ - enter_mode:
26
+ requested_mode: 'root'
27
+ - write:
28
+ input: 'exit'
@@ -0,0 +1,42 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'exec'
4
+ modes:
5
+ - name: 'linux'
6
+ prompt_pattern: '^\S+@\S+:\S+:\S+[\$|#]\s*$'
7
+ accessible_modes:
8
+ - name: 'exec'
9
+ instructions:
10
+ - send_input:
11
+ input: 'vtysh'
12
+ - name: 'exec'
13
+ prompt_pattern: '^[\w\.\-]+#\s*$'
14
+ accessible_modes:
15
+ - name: 'linux'
16
+ instructions:
17
+ - send_input:
18
+ input: 'exit'
19
+ - name: 'configuration'
20
+ instructions:
21
+ - send_input:
22
+ input: 'conifgure terminal'
23
+ - name: 'configuration'
24
+ prompt_pattern: '^[\w\.\-]+\(config\)#\s*$'
25
+ accessible_modes:
26
+ - name: 'exec'
27
+ instructions:
28
+ - send_input:
29
+ input: 'exit'
30
+ failure_indicators:
31
+ - 'Permission denied'
32
+ - 'ERROR:'
33
+ - '% Unknown command.'
34
+ - '% Command incomplete.'
35
+ on_open_instructions:
36
+ - enter_mode:
37
+ requested_mode: 'exec'
38
+ on_close_instructions:
39
+ - enter_mode:
40
+ requested_mode: 'exec'
41
+ - write:
42
+ input: 'exit'
@@ -0,0 +1,30 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^[\w\.\-]+#\s*$$'
7
+ accessible_modes:
8
+ - name: 'configuration'
9
+ instructions:
10
+ - send_input:
11
+ input: 'configure terminal'
12
+ - name: 'configuration'
13
+ prompt_pattern: '^[\w\.\-]+\(config\)#\s*$'
14
+ accessible_modes:
15
+ - name: 'exec'
16
+ instructions:
17
+ - send_input:
18
+ input: 'exit'
19
+ failure_indicators:
20
+ - 'Error:'
21
+ on_open_instructions:
22
+ - enter_mode:
23
+ requested_mode: 'exec'
24
+ - send_input:
25
+ input: 'paginate false'
26
+ on_close_instructions:
27
+ - enter_mode:
28
+ requested_mode: 'exec'
29
+ - write:
30
+ input: 'exit'
@@ -0,0 +1,32 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^[\w\.\-]+#\s*$$'
7
+ accessible_modes:
8
+ - name: 'configuration'
9
+ instructions:
10
+ - send_input:
11
+ input: 'configure'
12
+ - name: 'configuration'
13
+ prompt_pattern: '^[\w\.\-]+\(config\)#\s*$'
14
+ accessible_modes:
15
+ - name: 'exec'
16
+ instructions:
17
+ - send_input:
18
+ input: 'exit'
19
+ failure_indicators:
20
+ - 'Error:'
21
+ on_open_instructions:
22
+ - enter_mode:
23
+ requested_mode: 'configuration'
24
+ - send_input:
25
+ input: 'no terminal paging'
26
+ - enter_mode:
27
+ requested_mode: 'exec'
28
+ on_close_instructions:
29
+ - enter_mode:
30
+ requested_mode: 'exec'
31
+ - write:
32
+ input: 'exit'
@@ -0,0 +1,9 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'cli'
4
+ modes:
5
+ - name: 'cli'
6
+ prompt_pattern: '^.*[>#$]\s?+$'
7
+ on_close_instructions:
8
+ - write:
9
+ input: 'exit'
@@ -0,0 +1,46 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'privileged_exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^[\w.\-@/:]{1,63}>$'
7
+ accessible_modes:
8
+ - name: 'privileged_exec'
9
+ instructions:
10
+ - send_prompted_input:
11
+ input: 'enable'
12
+ prompt_pattern: '^(?:enable\s){0,1}password:\s?$'
13
+ response: '__lookup::enable'
14
+ - name: 'privileged_exec'
15
+ prompt_pattern: '^[\w.\-@/:]{1,63}#$'
16
+ accessible_modes:
17
+ - name: 'exec'
18
+ instructions:
19
+ - send_input:
20
+ input: 'disable'
21
+ - name: 'configuration'
22
+ instructions:
23
+ - send_input:
24
+ input: 'configure terminal'
25
+ - name: 'configuration'
26
+ prompt_pattern: '^[\w.\-@/:]{1,63}\([\w.\-@/:+]{0,32}\)#$'
27
+ accessible_modes:
28
+ - name: 'privileged_exec'
29
+ instructions:
30
+ - send_input:
31
+ input: 'end'
32
+ failure_indicators:
33
+ - 'Command not found'
34
+ - 'Incomplete command'
35
+ - '% Invalid input detected at ''^'' marker.'
36
+ - 'An invalid interface has been used for this command.'
37
+ on_open_instructions:
38
+ - enter_mode:
39
+ requested_mode: 'privileged_exec'
40
+ - send_input:
41
+ input: 'term length 0'
42
+ on_close_instructions:
43
+ - enter_mode:
44
+ requested_mode: 'privileged_exec'
45
+ - write:
46
+ input: 'exit'
@@ -0,0 +1,40 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'exec'
4
+ modes:
5
+ - name: 'linux'
6
+ prompt_pattern: '^[\w.-]+@[\w.-]+:[\w\/~]+[#$]\s*$'
7
+ accessible_modes:
8
+ - name: 'exec'
9
+ instructions:
10
+ - send_input:
11
+ input: 'sonic-cli'
12
+ - name: 'exec'
13
+ prompt_pattern: '^[\w.-]+#\s*$'
14
+ accessible_modes:
15
+ - name: 'configuration'
16
+ instructions:
17
+ - send_input:
18
+ input: 'conifgure terminal'
19
+ - name: 'configuration'
20
+ prompt_pattern: '^[\w.-]+\(config(\S*)?\)#\s*$'
21
+ accessible_modes:
22
+ - name: 'exec'
23
+ instructions:
24
+ - send_input:
25
+ input: 'exit'
26
+ failure_indicators:
27
+ - 'command not found'
28
+ - 'Permission denied'
29
+ - '% Error:'
30
+ - 'Warning: Idle timeout'
31
+ on_open_instructions:
32
+ - enter_mode:
33
+ requested_mode: 'exec'
34
+ - send_input:
35
+ input: 'term length 0'
36
+ on_close_instructions:
37
+ - enter_mode:
38
+ requested_mode: 'exec'
39
+ - write:
40
+ input: 'exit'
@@ -0,0 +1,46 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'privileged_exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^[a-z0-9.\-_@()/:]{1,63}:(user|oper|puser|3|4|6)#$'
7
+ accessible_modes:
8
+ - name: 'privileged_exec'
9
+ instructions:
10
+ - send_prompted_input:
11
+ input: 'enable admin'
12
+ prompt_pattern: '^[pP]ass[wW]ord:$'
13
+ response: '__lookup::enable'
14
+ - name: 'privileged_exec'
15
+ prompt_pattern: '^[a-z0-9.\-_@/:]{1,63}:(admin|5)#$'
16
+ accessible_modes:
17
+ - name: 'exec'
18
+ instructions:
19
+ - send_input:
20
+ input: 'disable'
21
+ - name: 'configuration'
22
+ instructions:
23
+ - send_input:
24
+ input: 'configure terminal'
25
+ - name: 'configuration'
26
+ prompt_pattern: '^[a-z0-9.\-_@/:]{1,63}:(admin|5)#$'
27
+ accessible_modes:
28
+ - name: 'privileged_exec'
29
+ instructions:
30
+ - send_input:
31
+ input: 'end'
32
+ failure_indicators:
33
+ - 'Next possible completions:'
34
+ - 'Available commands:'
35
+ on_open_instructions:
36
+ - enter_mode:
37
+ requested_mode: 'privileged_exec'
38
+ - send_input:
39
+ input: 'enable clipaging'
40
+ on_close_instructions:
41
+ - enter_mode:
42
+ requested_mode: 'privileged_exec'
43
+ - write:
44
+ input: 'disable clipaging'
45
+ - write:
46
+ input: 'exit'
@@ -0,0 +1,35 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'privileged_exec'
4
+ modes:
5
+ - name: 'privileged_exec'
6
+ prompt_pattern: '^[a-z0-9.\-_@()/:]{1,48}#\s*$'
7
+ accessible_modes:
8
+ - name: 'configuration'
9
+ instructions:
10
+ - send_input:
11
+ input: 'conf'
12
+ - name: 'configuration'
13
+ prompt_pattern: '^[a-z0-9.\-_@/:]{1,63}\(conf[a-z0-9.\-@/:\+]{0,32}\)#$'
14
+ accessible_modes:
15
+ - name: 'privileged_exec'
16
+ instructions:
17
+ - send_input:
18
+ input: 'end'
19
+ failure_indicators:
20
+ - '% Ambiguous command'
21
+ - '% Incomplete command'
22
+ - '% Invalid input detected'
23
+ - '% Unknown command'
24
+ on_open_instructions:
25
+ - enter_mode:
26
+ requested_mode: 'privileged_exec'
27
+ - send_input:
28
+ input: 'term width 300'
29
+ - send_input:
30
+ input: 'term len 0'
31
+ on_close_instructions:
32
+ - enter_mode:
33
+ requested_mode: 'privileged_exec'
34
+ - write:
35
+ input: 'exit'
@@ -0,0 +1,43 @@
1
+ ---
2
+ prompt_pattern: '^.*[>#$]\s?+$'
3
+ default_mode: 'privileged_exec'
4
+ modes:
5
+ - name: 'exec'
6
+ prompt_pattern: '^(\\n)?[a-z0-9.\-_@/:]{1,63}>\s*$'
7
+ accessible_modes:
8
+ - name: 'privileged_exec'
9
+ instructions:
10
+ - send_prompted_input:
11
+ input: 'enable'
12
+ prompt_pattern: '^\s*[pP]assword:\s*$'
13
+ response: '__lookup::enable'
14
+ - name: 'privileged_exec'
15
+ prompt_pattern: '^(\\n)?[a-z0-9.\-_@/:]{1,63}#\s*$'
16
+ accessible_modes:
17
+ - name: 'exec'
18
+ instructions:
19
+ - send_input:
20
+ input: 'end'
21
+ - name: 'configuration'
22
+ instructions:
23
+ - send_input:
24
+ input: 'configure terminal'
25
+ - name: 'configuration'
26
+ prompt_pattern: '^(\\n)?[a-z0-9.\-_@/:]{1,63}\(conf[a-z0-9.\-@/:\+]{0,32}\)#\s*$'
27
+ accessible_modes:
28
+ - name: 'privileged_exec'
29
+ instructions:
30
+ - send_input:
31
+ input: 'end'
32
+ failure_indicators:
33
+ - 'Syntax error:'
34
+ on_open_instructions:
35
+ - enter_mode:
36
+ requested_mode: 'privileged_exec'
37
+ - send_input:
38
+ input: 'terminal datadump'
39
+ on_close_instructions:
40
+ - enter_mode:
41
+ requested_mode: 'privileged_exec'
42
+ - write:
43
+ input: 'exit'