Class: Asg::Rebooter::Configuration::TargetGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/asg/rebooter/configuration/target_group.rb

Constant Summary collapse

DEREGISTRATION_DELAY_DURING_REBOOT_PROCEDURE =
'60'
DEREGISTRATION_CONFIG =
[
  key: 'deregistration_delay.timeout_seconds',
  value: DEREGISTRATION_DELAY_DURING_REBOOT_PROCEDURE
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_group) ⇒ TargetGroup

Returns a new instance of TargetGroup.



14
15
16
17
18
# File 'lib/asg/rebooter/configuration/target_group.rb', line 14

def initialize(target_group)
  @target_group = target_group

  @original_attributes = target_group.attributes
end

Instance Attribute Details

#original_attributesObject (readonly)

Returns the value of attribute original_attributes.



12
13
14
# File 'lib/asg/rebooter/configuration/target_group.rb', line 12

def original_attributes
  @original_attributes
end

#target_groupObject (readonly)

Returns the value of attribute target_group.



12
13
14
# File 'lib/asg/rebooter/configuration/target_group.rb', line 12

def target_group
  @target_group
end

Instance Method Details

#prepareObject



20
21
22
23
24
# File 'lib/asg/rebooter/configuration/target_group.rb', line 20

def prepare
  target_group.update_attributes(DEREGISTRATION_CONFIG)

  # Validate?
end

#restoreObject



26
27
28
29
30
# File 'lib/asg/rebooter/configuration/target_group.rb', line 26

def restore
  target_group.update_attributes(original_attributes)

  # Validate?
end