Package Products :: Package Zuul :: Package routers :: Module network :: Class NetworkRouter
[hide private]
[frames] | no frames]

Class NetworkRouter

source code

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

A JSON/ExtDirect interface to operations on networks

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
DirectResponse
discoverDevices(self, uid)
Discover devices on a network.
source code
DirectResponse
addNode(self, newSubnet, contextUid)
Add a new subnet.
source code
DirectResponse
deleteNode(self, uid)
Delete a subnet.
source code
[dictionary]
getTree(self, id='/zport/dmd/Networks')
Returns the tree structure of an organizer hierarchy where the root node is the organizer identified by the id parameter.
source code
DirectResponse
getInfo(self, uid, keys=None)
Returns a dictionary of the properties of an object
source code
DirectResponse
setInfo(self, **data)
Main method for setting attributes on a network or network organizer.
source code
DirectResponse
getIpAddresses(self, uid, start=0, params=None, limit=50, sort='ipAddressAsInt', page=None, dir='ASC')
Given a subnet, get a list of IP addresses and their relations.
source code
 
removeIpAddresses(self, uids=None)
Removes every ip address specified by uids that are not attached to any device
source code
 
newDiscoveryJob(self, networks=None, zProperties=None, collector='localhost') 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)

discoverDevices(self, uid)

source code 

Discover devices on a network.

Parameters:
  • uid (string) - Unique identifier of the network to discover
Returns: DirectResponse
Properties:
  • jobId: (integer) The id of the discovery job
Decorators:
  • @require('Manage DMD')

addNode(self, newSubnet, contextUid)

source code 

Add a new subnet.

Parameters:
  • newSubnet (string) - New subnet to add
  • contextUid (string) - Unique identifier of the network parent of the new subnet
Returns: DirectResponse
Properties:
  • newNode: (dictionary) An object representing the new subnet node
Decorators:
  • @require('Manage DMD')
Overrides: TreeRouter.addNode

deleteNode(self, uid)

source code 

Delete a subnet.

Parameters:
  • uid (string) - Unique identifier of the subnet to delete
Returns: DirectResponse
Properties:
  • tree: (dictionary) An object representing the new network tree
Decorators:
  • @require('Manage DMD')
Overrides: TreeRouter.deleteNode

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

source code 

Returns the tree structure of an organizer hierarchy where the root node is the organizer identified by the id parameter.

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

getInfo(self, uid, keys=None)

source code 

Returns a dictionary of the properties of an object

Parameters:
  • uid (string) - Unique identifier of an object
  • keys (list) - (optional) List of keys to include in the returned dictionary. If None then all keys will be returned
Returns: DirectResponse
Properties
  • data: (dictionary) Object properties

setInfo(self, **data)

source code 

Main method for setting attributes on a network or network organizer. 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 an object
Returns: DirectResponse
Decorators:
  • @require('Manage DMD')

getIpAddresses(self, uid, start=0, params=None, limit=50, sort='ipAddressAsInt', page=None, dir='ASC')

source code 

Given a subnet, get a list of IP addresses and their relations.

Parameters:
  • uid (string) - Unique identifier of a subnet
  • start (integer) - Offset to return the results from; used in pagination
  • params (string) - Not used
  • limit (integer) - Number of items to return; used in pagination
  • sort (string) - (optional) Key on which to sort the return results; defaults to 'name'
  • order (string) - Sort order; can be either 'ASC' or 'DESC'
Returns: DirectResponse
Decorators:
  • @serviceConnectionError

removeIpAddresses(self, uids=None)

source code 

Removes every ip address specified by uids that are not attached to any device

Parameters:
  • uids (Array of Strings) - unique identfiers of the ip addresses to delete