Package ZenPacks :: Package zenoss :: Package Impact :: Module routers :: Class ImpactRouter
[frames] | no frames]

type ImpactRouter

source code

                                          object --+            
                                                   |            
     Products.ZenUtils.extdirect.router.DirectRouter --+        
                                                       |        
Products.ZenUtils.extdirect.zope.router.ZopeDirectRouter --+    
                                                           |    
                            Products.Zuul.routers.TreeRouter --+
                                                               |
                                                              ImpactRouter

Router for Zenoss Impact

Instance Methods
DirectResponse
addNode(self, contextUid, id)
Creates a new Dynamic Service designated by the id field
source code
DirectResponse
addOrganizer(self, contextUid, id)
Creates a new Dynamic Service Organizer
source code
DirectResponse
addStateTrigger(*args, **kwargs)
Set the state triggers for a service node
source code
DirectResponse
addToDynamicService(*args, **kwargs)
Make node(s) impact a Dynamic Service.
source code
DirectResponse
checkDatabaseState(self)
Determines whether the impact graph needs to be reset.
source code
DirectResponse
cloneService(self, uid, newId)
Clone a service into the same organizer with the same children and contextual policies.
source code
DirectResponse
deleteNode(self, uid)
Delete a Dynamic Service, Dynamic Service Organizer, or other kind of node
source code
boolean
filterByInImpactGraph(self, result)
Filters the search results by what is in the impact graph.
source code
dictionary
getAllResults(self, query, **kwargs)
Use the search provider but filter the search results to what is in the impact graph.
source code
dictionary
getCategoryCounts(self, query)
Returns the search categories for the given query.
source code
DirectResponse
getDependencies(self, uid, query='', sort=None, dir=None, limit=None, page=None, start=None)
Retrieves every item currently impacting the given Dynamic Service
source code
DirectResponse
getInfo(self, uid, keys=None)
Retrieve information about a dynamic service
source code
DirectResponse
getInfoFromGuid(self, guid, contextId=None)
Retrieve information about a dynamic service
source code
DirectResponse
getInstances(self, uid, start=0, params=None, limit=50, sort='name', page=None, stateType='availability', dir='ASC')
Get a list of DynamicServices for an organizer UID.
source code
DirectResponse
getServiceOrganizers(self, **data)
Get a list of all Dynamic Service Organizers.
source code
DirectResponse
getServices(self, uid=None, limit=None, sort=None, start=None, dir=None, keys=None, page=None)
Retrieves Info objects for all services of which the object represented by uid is a part.
source code
DirectResponse
getStateTriggers(self, contextUid, uid, policyType)
Retrieve all the state triggers for a service node
source code
dictionary
getTree(self, id=None)
Returns the dynamic services tree
source code
DirectResponse
moveNode(self, uids, targetUid)
Move a list of nodes to another organizer.
source code
DirectResponse
removeFromDynamicService(*args, **kwargs)
Remove impacts from a Dynamic Service.
source code
DirectResponse
removeStateTrigger(*args, **kwargs)
Remove a state trigger
source code
DirectResponse
resetImpactGraph(self)
Rebuilds the entire impact graph.
source code
DirectResponse
setInfo(*args, **kwargs)
Set variables on a Dynamic Service
source code
DirectResponse
setQuiet(self, guid, quiet)
Set whether or not a service should send service events.
source code
DirectResponse
setStateProvider(self, uid, stateType, stateMap, eventClass, applyTo)
Set state provider data.
source code
DirectResponse
setStateTrigger(*args, **kwargs)
Set the state triggers for a service node
source code

Inherited from Products.Zuul.routers.TreeRouter: asyncGetTree, moveOrganizer

Inherited from Products.ZenUtils.extdirect.zope.router.ZopeDirectRouter: __call__, __init__

Method Details

addNode(self, contextUid, id)

source code 

Creates a new Dynamic Service designated by the id field

Parameters:
  • contextUid (string) - organizer for the new service
  • id (string) - Unique identifier of the new Dynamic Service
Returns: DirectResponse
Marshaled form of the created node
Overrides: Products.Zuul.routers.TreeRouter.addNode

addOrganizer(self, contextUid, id)

source code 

Creates a new Dynamic Service Organizer

Parameters:
  • contextUid (string) - Not used but sent by the client
  • id (string) - Unique identifier of the new Dynamic Service Organizer
Returns: DirectResponse
  • Properties:
    • data (Info) - The Info object for the newly created service organizer

addToDynamicService(*args, **kwargs)

source code 

Make node(s) impact a Dynamic Service.

Parameters:
  • targetUid (string) - Unique Identifier of a Dynamic service
  • uids ([string]) - List of uids of items we are adding
Returns: DirectResponse
  • Properties:
    • numberAdded (integer) - Total number of added impacts

checkDatabaseState(self)

source code 

Determines whether the impact graph needs to be reset. This searches for the critical impact event generated from NotFoundException.

Returns: DirectResponse
  • Properties:
    • needsReset (boolean) - Whether or not the impact graph state needs to be reset

cloneService(self, uid, newId)

source code 

Clone a service into the same organizer with the same children and contextual policies.

Parameters:
  • uid (string) - Unique identifier of the Dynamic Service to clone
  • newId (string) - Identifier for the new clone
Returns: DirectResponse
  • Properties:
    • data ([dictionary]) - DynamicServiceInfo object on the new clone

deleteNode(self, uid)

source code 

Delete a Dynamic Service, Dynamic Service Organizer, or other kind of node

Parameters:
  • uid (string) - UID of the dynamic service to delete
Returns: DirectResponse
Properties:
  • msg: (string) Status message
Overrides: Products.Zuul.routers.TreeRouter.deleteNode

filterByInImpactGraph(self, result)

source code 

Filters the search results by what is in the impact graph. Note that to do this we have to wake up every object in the search results.

Parameters:
  • result (iterable) - search results (events and brains)
Returns: boolean
Whether the object should be returned

getAllResults(self, query, **kwargs)

source code 

Use the search provider but filter the search results to what is in the impact graph. This is used by an ExtJs ResultsGrid.

Returns: dictionary
  • Properties:
    • results ([dictionary]) - List of results
    • total (integer) - Total number of results

getCategoryCounts(self, query)

source code 

Returns the search categories for the given query.

Returns: dictionary
  • Properties:
    • results ([dictionary]) - List of results
    • total (integer) - Total number of results

getDependencies(self, uid, query='', sort=None, dir=None, limit=None, page=None, start=None)

source code 

Retrieves every item currently impacting the given Dynamic Service

Parameters:
  • uid (string) - Unique identifier of a Dynamic Service
  • query - unused
  • sort - unused
  • dir - unused
  • limit - unused
  • page - unused
  • start - unused
Returns: DirectResponse
  • Properties:
    • data [Info] - A list of Info objects of the items in the service

getInfo(self, uid, keys=None)

source code 

Retrieve information about a dynamic service

Parameters:
  • uid (string) - UID of the dynamic service to query
Returns: DirectResponse
  • Properties:
    • data (DynamicServiceInfo) - An Info object for the service
    • form (dictionary) - A dictionary containing the ExtJs form data for this object

getInfoFromGuid(self, guid, contextId=None)

source code 

Retrieve information about a dynamic service

Parameters:
  • guid (string) - GUID (global unique id) of the dynamic service to query
  • contextId (string) - The uid of the parent
Returns: DirectResponse
  • Properties:
    • data (DynamicServiceInfo) - An Info object for the service
    • form (dictionary) - A dictionary containing the ExtJs form data for this object

getInstances(self, uid, start=0, params=None, limit=50, sort='name', page=None, stateType='availability', dir='ASC')

source code 

Get a list of DynamicServices for an organizer UID.

Parameters:
  • uid (string) - Service UID to get instances of
  • start (integer) - (optional) Offset to return the results from; used in pagination
  • params - unused
  • limit (integer) - (optional) Number of items to return; used in pagination
  • sort (string) - (optional) Key on which to sort the return results
  • stateType (string) - (optional) Type of state for which to get results; Can be one of 'availability' or 'performance'.
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC'
Returns: DirectResponse
  • Properties:
    • data ([dict]) - List of objects representing service instances.
    • totalCount (integer) - Total number of instances.

getServiceOrganizers(self, **data)

source code 

Get a list of all Dynamic Service Organizers.

Parameters:
  • data - unused
Returns: DirectResponse
  • Properties:
    • serviceOrgs ([dictionary]) - List of service organizers
    • totalCount (integer) - Total number of service organizers

getServices(self, uid=None, limit=None, sort=None, start=None, dir=None, keys=None, page=None)

source code 

Retrieves Info objects for all services of which the object represented by uid is a part.

Returns: DirectResponse
  • Properties:
    • data ([DynamicServiceInfo]) - List of Info objects

getStateTriggers(self, contextUid, uid, policyType)

source code 

Retrieve all the state triggers for a service node

Returns: DirectResponse
  • Properties:
    • data (dictionary) - The trigger data

getTree(self, id=None)

source code 

Returns the dynamic services tree

Parameters:
  • id (String) - The root UID for which to generate a tree.
Returns: dictionary
Tree designed to be used by ExtJs. This does not return a DirectResponse because this method is intended to be used only by ExtJs and will return format that an ExtJs direct proxy can consume.

moveNode(self, uids, targetUid)

source code 

Move a list of nodes to another organizer.

Parameters:
  • uids ([string]) - List of uids to be moved, can be either organizers or dynamic services
  • targetUid (string) - Uid of a Dynamic Service Organizer
Returns: DirectResponse

removeFromDynamicService(*args, **kwargs)

source code 

Remove impacts from a Dynamic Service.

Parameters:
  • targetUid (string) - Unique Identifier of a Dynamic service
  • uids ([string]) - List of uids of items to remove
Returns: DirectResponse

resetImpactGraph(self)

source code 

Rebuilds the entire impact graph. This may take a few minutes.

Returns: DirectResponse

setInfo(*args, **kwargs)

source code 

Set variables on a Dynamic Service

Parameters:
  • uid (string) - UID of the dynamic service to update
  • data (dictionary) - Properties to update
Returns: DirectResponse
  • Properties:
    • data (DynamicServiceInfo) - The info object

setQuiet(self, guid, quiet)

source code 

Set whether or not a service should send service events.

Parameters:
  • guid (string) - The guid of the service to update
  • quiet (boolean) - Whether or not the service should send service events
Returns: DirectResponse

setStateProvider(self, uid, stateType, stateMap, eventClass, applyTo)

source code 

Set state provider data.

Parameters:
  • uid (string) - Service UID to update
  • stateType (string) - (optional) Type of state for which to apply update; Can be one of 'availability' or 'performance'.
  • stateMap (dictionary) - A mapping of event severity levels to states.
  • eventClass (string) - The eventClass for which the state provider should be applied.
  • applyTo (string) - The context to which the state provider should be applied to. Can be one of 'NODE', 'DEVICE', 'DEVICECLASS' or 'ALL'.
Returns: DirectResponse