Class: SDM::NodeMaintenanceWindow
- Inherits:
-
Object
- Object
- SDM::NodeMaintenanceWindow
- Defined in:
- lib/models/porcelain.rb
Instance Attribute Summary collapse
-
#cron_schedule ⇒ Object
Cron job syntax for when this maintenance window is active.
-
#require_idleness ⇒ Object
Require Idleness defines whether this window can sever live connections.
Instance Method Summary collapse
-
#initialize(cron_schedule: nil, require_idleness: nil) ⇒ NodeMaintenanceWindow
constructor
A new instance of NodeMaintenanceWindow.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(cron_schedule: nil, require_idleness: nil) ⇒ NodeMaintenanceWindow
Returns a new instance of NodeMaintenanceWindow.
8440 8441 8442 8443 8444 8445 8446 |
# File 'lib/models/porcelain.rb', line 8440 def initialize( cron_schedule: nil, require_idleness: nil ) @cron_schedule = cron_schedule == nil ? "" : cron_schedule @require_idleness = require_idleness == nil ? false : require_idleness end |
Instance Attribute Details
#cron_schedule ⇒ Object
Cron job syntax for when this maintenance window is active. On this schedule, associated nodes will restart if requested, provided other checks allow the restart to proceed. Times are represented in UTC. e.g. * 7 * * 0,6 to check for a restart at every minute from 7:00 to 8:00 UTC on Sunday and Saturday. Not all possible inputs are supported: the month and day of month selections must be '*'.
8432 8433 8434 |
# File 'lib/models/porcelain.rb', line 8432 def cron_schedule @cron_schedule end |
#require_idleness ⇒ Object
Require Idleness defines whether this window can sever live connections. If true, this window will not allow a node to be restarted unless it is serving no connections. If false, given a restart of the node has been requested (for an update, usually), the node will restart as soon as it enters an allowed day / hour combination. At least one maintenance window, out of all configured windows for a node, must have this as false.
8438 8439 8440 |
# File 'lib/models/porcelain.rb', line 8438 def require_idleness @require_idleness end |
Instance Method Details
#to_json(options = {}) ⇒ Object
8448 8449 8450 8451 8452 8453 8454 |
# File 'lib/models/porcelain.rb', line 8448 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |