EasyManuals Logo

HP 5920 Series Fundamentals Configuration Guide

HP 5920 Series
215 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #169 background imageLoading...
Page #169 background image
161
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 2014, 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 2014, 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)

Table of Contents

Other manuals for HP 5920 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP 5920 Series and is the answer not in the manual?

HP 5920 Series Specifications

General IconGeneral
BrandHP
Model5920 Series
CategorySwitch
LanguageEnglish

Related product manuals