1###### 2v0.6.0 3###### 4 52016-02-22 6 7New Modules 8^^^^^^^^^^^ 9* None 10 11Enhancements 12^^^^^^^^^^^^ 13 14* Added support for multiline commands without having to pass them as a dictionary (`78 <https://github.com/arista-eosplus/pyeapi/pull/78>`_) [`dbarrosop <https://github.com/dbarrosop>`_] 15 (See example below) 16 17.. code-block:: python 18 19 >>> import pyeapi 20 >>> connection = pyeapi.client.connect( 21 ... transport='https', 22 ... host='192.168.56.201', 23 ... username='vagrant', 24 ... password='vagrant', 25 ... port=443, 26 ... timeout=60 27 ... ) 28 >>> device = pyeapi.client.Node(connection) 29 >>> device.run_commands('show hostname') 30 [{u'hostname': u'localhost', u'fqdn': u'localhost'}] 31 >>> device.run_commands('show banner login') 32 [{u'loginBanner': u''}] 33 >>> my_commands = [ 34 ... 'configure session whatever', 35 ... 'hostname new-hostname', 36 ... 'banner login MULTILINE:This is a new banner\nwith different lines!!!', 37 ... 'end' 38 ... ] 39 >>> 40 >>> device.run_commands(my_commands) 41 [{}, {}, {}, {}] 42 >>> print device.run_commands(['show session-config named whatever diffs'], encoding='text')[0]['output'] 43 --- system:/running-config 44 +++ session:/whatever-session-config 45 @@ -3,6 +3,8 @@ 46 ! boot system flash:/vEOS-lab.swi 47 ! 48 transceiver qsfp default-mode 4x10G 49 +! 50 +hostname new-hostname 51 ! 52 spanning-tree mode mstp 53 ! 54 @@ -22,6 +24,11 @@ 55 ! 56 no ip routing 57 ! 58 +banner login 59 +This is a new banner 60 +with different lines!!! 61 +EOF 62 +! 63 management api http-commands 64 no shutdown 65 ! 66 >>> device.run_commands(['configure session whatever', 'commit']) 67 [{}, {}] 68 >>> device.run_commands('show hostname') 69 [{u'hostname': u'new-hostname', u'fqdn': u'new-hostname'}] 70 >>> device.run_commands('show banner login') 71 [{u'loginBanner': u'This is a new banner\nwith different lines!!!\n'}] 72 >>> 73