Class: Rig::Command::Environment::Protect
- Inherits:
-
Abstract
- Object
- Clamp::Command
- Abstract
- Rig::Command::Environment::Protect
show all
- Defined in:
- lib/rig/command/environment/protect.rb
Instance Method Summary
collapse
Methods inherited from Abstract
#instance_list, #print_table
Instance Method Details
#execute ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/rig/command/environment/protect.rb', line 8
def execute
env = Rig::Model::Environment.find(name)
raise "Environment #{name} not found" if env.nil?
connection = Rig::Connection.compute
val = undo? ? "false" : "true"
env.servers.each do |s|
connection.create_tags(s.id, "Protected" => val)
end
end
|