Package ZenModel :: Module MaintenanceWindow :: Class MaintenanceWindow
[hide private]
[frames] | no frames]

Class MaintenanceWindow

source code

                                                   object --+        
                                                            |        
                                    ZenModelBase.ZenModelBase --+    
                                                                |    
Products.ZenRelations.RelationshipManager.RelationshipManager --+    
                                                                |    
                                      ExtensionClass.Base --+   |    
                                                            |   |    
                                       OFS.History.Historical --+    
                                                                |    
                                                   object --+   |    
                                                            |   |    
                                          ZenPacker.ZenPacker --+    
                                                                |    
                                            ZenModelRM.ZenModelRM --+
                                                                    |
                                                                   MaintenanceWindow

Instance Methods [hide private]
 
__init__(self, id) source code
 
manage_afterAdd(self, item, container) source code
 
manage_beforeDelete(self, item, container) source code
 
set(self, start, duration, repeat, enabled=True) source code
 
displayName(self) source code
 
repeatOptions(self)
Provide the list of REPEAT options
source code
 
getTargetId(self) source code
 
niceDuration(self)
Return a human readable version of the duration in days, hours, minutes
source code
 
niceStartDate(self)
Return a date in the format use by the calendar javascript
source code
 
niceStartDateTime(self)
Return start time as a string with nice sort qualities
source code
 
niceStartProductionState(self)
Return a string version of the startProductionState
source code
 
niceStopProductionState(self)
Return a string version of the stopProductionState
source code
 
niceStartHour(self) source code
 
niceStartMinute(self) source code
 
manage_editMaintenanceWindow(self, startDate='', startHours='', startMinutes='00', durationDays='0', durationHours='00', durationMinutes='00', repeat='Never', startProductionState=300, stopProductionState=RETURN_TO_ORIG_PROD_STATE, enabled=True, skip=1, REQUEST=None)
Update the maintenance window from GUI elements
source code
 
nextEvent(self, now)
Return the time of the next begin() or end()
source code
list
>>> dmd.Devices.Server.breadCrumbs()
[('/zport/dmd/Devices', 'Devices'), 
    ('/zport/dmd/Devices/Server', 'Server')]
breadCrumbs(self, terminator='dmd')
fix up breadCrumbs to add a link back to the Manage tab
source code
 
next(self, now=None)
From Unix time_t now value, return next time_t value for the window to start, or None This adjusts for DST changes.
source code
 
_next(self, now) source code
 
target(self) source code
boolean
isActive(self)
Return whether or not the maintenance window is active.
source code
 
fetchDeviceMinProdStates(self, devices=None)
Return a dictionary of devices and their minimum production state from all maintenance windows.
source code
 
fetchDevices(self)
Get the list of devices from our maintenance window.
source code
 
setProdState(self, state, ending=False)
At any one time there is one production state for each device to be in, and that is the state that is the most 'blacked out' in all of the active maintenance windows affecting that device.
source code
 
begin(self, now=None)
Hook for entering the Maintenance Window: call if you override
source code
 
end(self)
Hook for leaving the Maintenance Window: call if you override
source code
 
execute(self, now=None)
Take the next step: either start or stop the Maintenance Window
source code
 
adjustDST(self, result) source code

Inherited from ZenModelRM.ZenModelRM: changePythonClass, creator, editableDeviceList, findChild, getCreatedTimeString, getDmdKey, getModificationTimeString, getSubObjects, getTreeItems, getZenRootNode, index_object, primarySortKey, reindex_all, rename, unindex_object, viewName, zmanage_addProperty, zmanage_delObjects, zmanage_delProperties, zmanage_editProperties, zmanage_exportObject, zmanage_importObject, zmanage_importObjects

Inherited from ZenModelBase.ZenModelBase: __call__, __hash__, all_meta_types, aqBaseHasAttr, callZenScreen, checkRemotePerm, checkValidId, createHierarchyObj, custPropertyIds, custPropertyMap, getBreadCrumbUrlPath, getDmd, getDmdObj, getDmdRoot, getHierarchyObj, getIconPath, getIdLink, getNowString, getObjByPath, getPrimaryDmdId, getUnusedId, getZ, getZopeObj, helpLink, isLocalName, manage_deleteObjects, prepId, saveCustProperties, todayDate, urlLink, view, visibleCustPropertyMap, yesterdayDate, zenScreenUrl, zenpathjoin, zenpathsplit, zentinelTabs

Inherited from OFS.History.Historical: manage_afterHistoryCopy, manage_beforeHistoryCopy, manage_change_history, manage_historicalComparison, manage_historyCompare, manage_historyCopy

Inherited from ZenPacker.ZenPacker: addToZenPack, eligiblePacks, findObject

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  meta_type = 'Maintenance Window'
  default_catalog = 'maintenanceWindowSearch'
  name = None
  start = None
  started = None
  duration = 60
  repeat = 'Never'
  startProductionState = 300
  stopProductionState = -99
  enabled = True
  skip = 1
  _properties = {'id': 'name', 'type': 'string', 'mode': 'w'}, {...
  factory_type_information = {'immediate_view': 'maintenanceWind...
  backCrumb = 'deviceManagement'
  _relations = "productionState", ToOne(ToManyCont, "Products.Ze...
  security = ClassSecurityInfo()
  REPEAT = "Never/Daily/Every Weekday/Weekly/Monthly/First Sunda...

Inherited from ZenModelRM.ZenModelRM: isInTree

Inherited from ZenModelBase.ZenModelBase: index_html, sub_meta_types

Inherited from OFS.History.Historical: HistoricalRevisions, __ac_permissions__, manage_change_history_page, manage_options

Inherited from OFS.History.Historical (private): _manage_historyComparePage

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, id)
(Constructor)

source code 
Overrides: ZenModelRM.ZenModelRM.__init__

breadCrumbs(self, terminator='dmd')

source code 
fix up breadCrumbs to add a link back to the Manage tab
Returns: list
>>> dmd.Devices.Server.breadCrumbs()
[('/zport/dmd/Devices', 'Devices'), 
    ('/zport/dmd/Devices/Server', 'Server')]
List of tuples to create a bread crumbs
Overrides: ZenModelBase.ZenModelBase.breadCrumbs

isActive(self)

source code 
Return whether or not the maintenance window is active.
Returns: boolean
is this window active or not?

fetchDeviceMinProdStates(self, devices=None)

source code 

Return a dictionary of devices and their minimum production state from
all maintenance windows.

Note: This method should be moved to the zenactions command in order to
      improve performance.

@return: dictionary of device_id:production_state
@rtype: dictionary

setProdState(self, state, ending=False)

source code 

At any one time there is one production state for each device to be in, and that is the state that is the most 'blacked out' in all of the active maintenance windows affecting that device. When the last maintenance window affecting a device has ended, the original production state of the device is used to determine the end state of the device.

Maintenance windows are processed by zenactions in batch so the ordering of when two maintenance windows that end at the same time get processed is non-deterministic. Since there is only one stop production state now, this is not an issue.
Parameters:
  • state (integer) - hint from the maint window about device's start or stop state
  • ending (boolean) - are we ending a maintenance window?

Class Variable Details [hide private]

_properties

Value:
{'id': 'name', 'type': 'string', 'mode': 'w'}, {'id': 'start', 'type':\
 'int', 'mode': 'w'}, {'id': 'started', 'type': 'int', 'mode': 'w'}, {\
'id': 'duration', 'type': 'int', 'mode': 'w'}, {'id': 'repeat', 'type'\
: 'string', 'mode': 'w'}, {'id': 'skip', 'type': 'int', 'mode': 'w'},

factory_type_information

Value:
{'immediate_view': 'maintenanceWindowDetail', 'actions':({'id': 'statu\
s', 'name': 'Status', 'action': 'maintenanceWindowDetail', 'permission\
s':(ZEN_MAINTENANCE_WINDOW_VIEW,)}, {'id': 'viewHistory', 'name': 'Mod\
ifications', 'action': 'viewHistory', 'permissions':(ZEN_VIEW_MODIFICA\
TIONS,)},)},

_relations

Value:
"productionState", ToOne(ToManyCont, "Products.ZenModel.MaintenanceWin\
dowable", "maintenanceWindows"),

REPEAT

Value:
"Never/Daily/Every Weekday/Weekly/Monthly/First Sunday of the Month".s\
plit('/')