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))
-
Notifications
You must be signed in to change notification settings - Fork 0
License
Vnet-as/cisco-olt-http-client
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published