Skip to content

ServiceRouter

getClassNames(**query, **uid)
deleteNode() Deletes a node from the tree.

B{NOTE}: You can not delete a root node of a tree

@type uid: string
@param uid: Unique identifier of the node we wish to delete
@rtype: DirectResponse
@return: B{Properties}:
- msg: (string) Status message
asyncGetTree(**additionalKeys, **id) Server side method for asynchronous tree calls. Retrieves
the immediate children of the node specified by "id"

NOTE: our convention on the UI side is if we are asking
for the root node then return the root and its children
otherwise just return the children

@type id: string
@param id: The uid of the node we are getting the children for
@rtype: [dictionary]
@return: Object representing the immediate children
addNode() Add a node to the existing tree underneath the node specified
by the context UID

@type type: string
@param type: Either 'class' or 'organizer'
@type contextUid: string
@param contextUid: Path to the node that will
be the new node's parent (ex. /zport/dmd/Devices)
@type id: string
@param id: Identifier of the new node, must be unique in the
parent context
@type description: string
@param description: (optional) Describes this new node (default: None)
@rtype: dictionary
@return: Marshaled form of the created node
getInfo(uid, **keys) Get the properties of a service.

@type uid: string
@param uid: Unique identifier of a service
@type keys: list
@param keys: (optional) List of keys to include in the returned
dictionary. If None then all keys will be returned
(default: None)
@rtype: DirectResponse
@return: B{Properties}
- data: (dictionary) Object representing a service's properties
- disabled: (boolean) True if current user cannot manage services
getTree(id) Returns the tree structure of an organizer hierarchy.

@type id: string
@param id: Id of the root node of the tree to be returned
@rtype: [dictionary]
@return: Object representing the tree
getOrganizerTree(id) Returns the tree structure of an organizer hierarchy, only including
organizers.

@type id: string
@param id: Id of the root node of the tree to be returned
@rtype: [dictionary]
@return: Object representing the organizer tree
gzip_b64(string) gzip an arbitrary string, base64 encode it, and return it
moveServices(sourceUids, targetUid) Move service(s) from one organizer to another.

@type sourceUids: [string]
@param sourceUids: UID(s) of the service(s) to move
@type targetUid: string
@param targetUid: UID of the organizer to move to
@rtype: DirectResponse
@return: Success messsage
setInfo() Set attributes on a service.
This method accepts any keyword argument for the property that you wish
to set. The only required property is "uid".

@type uid: string
@keyword uid: Unique identifier of a service
@rtype: DirectResponse
@return: Success message
objectExists(uid) @rtype: DirectResponse
@return:
- Properties:
- B{exists} - Returns true if we can find the object specified by the uid
query(**sort, **uid, **start, **limit, **criteria, **params, **page, **dir, **history) Retrieve a list of services based on a set of parameters.

@type limit: integer
@param limit: (optional) Number of items to return; used in pagination
(default: None)
@type start: integer
@param start: (optional) Offset to return the results from; used in
pagination (default: None)
@type sort: string
@param sort: (optional) Key on which to sort the return results (default:
None)
@type dir: string
@param dir: (optional) Sort order; can be either 'ASC' or 'DESC'
(default: None)
@type params: dictionary
@param params: (optional) Key-value pair of filters for this search.
@type history: boolean
@param history: not used
@type uid: string
@param uid: Service class UID to query
@type criteria: list
@param criteria: not used
@rtype: DirectResponse
@return: B{Properties}:
- services: ([dictionary]) List of objects representing services
- totalCount: (integer) Total number of services
- hash: (string) Hashcheck of the current services state
- disabled: (boolean) True if current user cannot manage services
getInstances(uid, **sort, **start, **params, **limit, **page, **dir) Get a list of instances for a service UID.

@type uid: string
@param uid: Service UID to get instances of
@type start: integer
@param start: (optional) Offset to return the results from; used in
pagination (default: 0)
@type params: dictionary
@param params: (optional) Key-value pair of filters for this search.
@type limit: integer
@param limit: (optional) Number of items to return; used in pagination
(default: 50)
@type sort: string
@param sort: (optional) Key on which to sort the return results (default:
'name')
@type dir: string
@param dir: (optional) Sort order; can be either 'ASC' or 'DESC'
(default: 'ASC')
@rtype: DirectResponse
@return: B{Properties}:
- data: ([dictionary]) List of objects representing service instances
- totalCount: (integer) Total number of instances
gunzip_b64(string) Base 64 decode a string, then gunzip it and return the result as JSON.
The input to this method should be gzipped, base 64 encoded JSON. Base
64 encoded strings are allowed to have up to 2 '='s of padding. The zenoss
Ext router eats these, so there is some logic to try padding them back into
the string should initial decoding fail.
moveOrganizer(targetUid, organizerUid) Move the organizer uid to be underneath the organizer
specified by the targetUid.

@type targetUid: string
@param targetUid: New parent of the organizer
@type organizerUid: string
@param organizerUid: The organizer to move
@rtype: DirectResponse
@return: B{Properties}:
- data: (dictionary) Moved organizer
getMonitoredStartModes(uid, **query) Get a list of monitored start modes for a Windows service.

@type uid: string
@param uid: Unique ID of a Windows service.
@rtype: DirectResponse
@return: B{Properties}:
- data: ([string]) List of monitored start modes for a Windows service
getUnmonitoredStartModes(uid) Get a list of unmonitored start modes for a Windows service.

@type uid: string
@param uid: Unique ID of a Windows service.
@rtype: DirectResponse
@return: B{Properties}:
- data: ([string]) List of unmonitored start modes for a Windows service
addClass(contextUid, id, **posQuery) Add a new service class.

@type contextUid: string
@param contextUid: Unique ID of the service ogranizer to add new class to
@type id: string
@param id: ID of the new service
@type posQuery: dictionary
@param posQuery: Object defining a query where the returned position will lie
@rtype: DirectResponse
@return: B{Properties}:
- newIndex: (integer) Index of the newly added class in the query
defined by posQuery