Comware V7 Extended Python Api; Importing And Using The Comware V7 Extended Python Api; Comware V7 Extended Python Api Functions; Cli Class - HP FlexFabric 7900 Series Configuration Manual

Hide thumbs Also See for FlexFabric 7900 Series:
Table of Contents

Advertisement

Comware V7 extended Python API

The Comware V7 extended Python API is compatible with the Python syntax.
Importing and using the Comware V7 extended
Python API
To use the Comware V7 extended Python API, you must import the API to Python.
Use either of the following methods to import and use the Comware V7 extended Python API:
Use import comware to import the entire API and use comware.API to execute an API.
For example, to use the extended API Transfer to download file test.cfg from TFTP server
192.168.1.26:
<Sysname> python
Python 2.7.3 (default, May 24 2013, 14:37:26)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import comware
>>> comware.Transfer('tftp', '192.168.1.26', 'test.cfg', 'flash:/test.cfg', user='',
password='')
<comware.Transfer object at 0xb7eab0e0>
Use from comware import API to import an API and use API to execute the API.
For example, to use the extended API Transfer to download file test.cfg from TFTP server
192.168.1.26:
<Sysname> python
Python 2.7.3 (default, May 24 2013, 14:37:26)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from comware import Transfer
>>> Transfer('tftp', '192.168.1.26', 'test.cfg', 'flash:/test.cfg', user='',
password='')
<comware.Transfer object at 0xb7e5e0e0>

Comware V7 extended Python API functions

CLI class

CLI
Use CLI to execute Comware V7 CLI commands and create CLI objects.
Syntax
CLI(command='', do_print=True)
125

Advertisement

Table of Contents
loading

Table of Contents