Package Products :: Package Zuul :: Package routers :: Module mibs :: Class MibRouter
[hide private]
[frames] | no frames]

Class MibRouter

source code

ZenUtils.Ext.DirectRouter --+    
                            |    
                   TreeRouter --+
                                |
                               MibRouter

A JSON/ExtDirect interface to operations on MIBs

Instance Methods [hide private]
 
__init__(self, context, request) source code
 
_getFacade(self)
Abstract method for child classes to use to get their facade
source code
[dictionary]
getTree(self, id='/zport/dmd/Mibs')
Returns the tree structure of an organizer hierarchy.
source code
[dictionary]
getOrganizerTree(self, id)
Returns the tree structure of an organizer hierarchy, only including organizers.
source code
DirectResponse
addNode(self, contextUid='', id='', type='')
Add an organizer or new blank MIB.
source code
DirectResponse
addMIB(self, package, organizer='/')
Add a new MIB by URL or local file.
source code
DirectResponse
deleteNode(self, uid)
Remove an organizer or MIB.
source code
DirectResponse
moveNode(self, uids, target)
Move an organizer or MIB from one organizer to another.
source code
DirectResponse
getInfo(self, uid, useFieldSets=True)
Get the properties of a MIB
source code
DirectResponse
setInfo(self, **data)
Set attributes on a MIB.
source code
 
_validateOid(self, oid)
Check for illegal characters in OID
source code
 
addOidMapping(self, uid, id, oid, nodetype='node') source code
 
addTrap(self, uid, id, oid, nodetype='notification') source code
 
deleteOidMapping(self, uid) source code
 
deleteTrap(self, uid) source code
 
getOidMappings(self, uid, dir='ASC', sort='name', start=0, page=None, limit=256) source code
 
getTraps(self, uid, dir='ASC', sort='name', start=0, page=None, limit=256) source code
 
getMibNodeTree(self, id=None)
A MIB node is a regular OID (ie you can hit it with snmpwalk)
source code
 
getMibTrapTree(self, id=None)
A MIB trap node is an OID received from a trap
source code

Inherited from TreeRouter: asyncGetTree, gunzip_b64, gzip_b64, moveOrganizer, objectExists

Inherited from TreeRouter (private): _canDeleteUid

Method Details [hide private]

_getFacade(self)

source code 

Abstract method for child classes to use to get their facade

Overrides: TreeRouter._getFacade
(inherited documentation)

getTree(self, id='/zport/dmd/Mibs')

source code 

Returns the tree structure of an organizer hierarchy. Default tree root is MIBs.

Parameters:
  • id (string) - (optional) Id of the root node of the tree to be returned (default: '/zport/dmd/Mibs')
Returns: [dictionary]
Object representing the tree

getOrganizerTree(self, id)

source code 

Returns the tree structure of an organizer hierarchy, only including organizers.

Parameters:
  • id (string) - Id of the root node of the tree to be returned
Returns: [dictionary]
Object representing the organizer tree

addNode(self, contextUid='', id='', type='')

source code 

Add an organizer or new blank MIB.

Parameters:
  • contextUid (string) - Context to attach new node
  • id (string) - Id of the new orgainzer or blank MIB
  • type (string) - Type of new node. Can be 'organizer' or 'MIB'
Returns: DirectResponse
Properties:
  • tree: ([dictionary]) Object representing the new tree
Decorators:
  • @require('Manage DMD')
Overrides: TreeRouter.addNode

addMIB(self, package, organizer='/')

source code 

Add a new MIB by URL or local file.

Parameters:
  • package (string) - URL or local file path to MIB file
  • organizer (string) - ID of the organizer to add MIB to
Returns: DirectResponse
Properties:
  • jobId: (string) ID of the add MIB job

deleteNode(self, uid)

source code 

Remove an organizer or MIB.

Parameters:
  • uid (string) - UID of organizer or MIB to remove
Returns: DirectResponse
Properties:
  • tree: ([dictionary]) Object representing the new tree
Decorators:
  • @require('Manage DMD')
Overrides: TreeRouter.deleteNode

moveNode(self, uids, target)

source code 

Move an organizer or MIB from one organizer to another.

Parameters:
  • uids ([string]) - UIDs of organizers and MIBs to move
  • target (string) - UID of the organizer to move to
Returns: DirectResponse
Properties:
  • data: (dictionary) Object representing the new parent organizer
Decorators:
  • @require('Manage DMD')

getInfo(self, uid, useFieldSets=True)

source code 

Get the properties of a MIB

Parameters:
  • uid (string) - Unique identifier of a MIB
  • useFieldSets (boolean) - True to return a fieldset version of the info form (default: True)
Returns: DirectResponse
Properties
  • data: (dictionary) Object representing a MIB's properties
  • form: (dictionary) Object representing an edit form for a MIB's properties

setInfo(self, **data)

source code 

Set attributes on a MIB. This method accepts any keyword argument for the property that you wish to set. The only required property is "uid".

Parameters:
  • uid (string) - Unique identifier of a MIB
Returns: DirectResponse
Properties
  • data: (dictionary) Object representing a MIB's new properties