Skip to content

Vnet-as/cisco-olt-http-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cisco_olt_http

https://travis-ci.org/Vnet-as/cisco-olt-http-client.svg?branch=master Updates

Usage

from cisco_olt_http.client import Client
from cisco_olt_http.operations import (
    BulkOperation,
    ShowInterfacesOp,
    ShowEquipmentOp
)

client = Client('https://your.olt.box')
# unfortunately for now, there's no way to know if login was successful
client.login('username', 'password')

response = client.execute(ShowInterfacesOp)
pprint.pprint(dict(response.operations[0].result))
pprint.pprint(response.operations[0].error)

# or

cmd = ShowInterfacesOp(client)
response = cmd.execute()
pprint.pprint(dict(response.operations[0].result))
pprint.pprint(response.operations[0].error)

# also bulk operations are supported

bulk_op = BulkOperation(client)
bulk_op.add_operation(ShowInterfacesOp, {'@equipmentId': 1})
bulk_op.add_operation(ShowInterfacesOp, {'@equipmentId': 2})
bulk_op.add_operation(ShowEquipmentOp)
response = bulk_op.execute()

for op in response.operations:
    pprint.pprint(dict(op.result))

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages