Class: Chef::Knife::ProfitbricksVolumeAttach
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::ProfitbricksVolumeAttach
- Includes:
- ProfitbricksBase
- Defined in:
- lib/chef/knife/profitbricks_volume_attach.rb
Instance Method Summary collapse
Methods included from ProfitbricksBase
#connection, included, #msg_pair
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/chef/knife/profitbricks_volume_attach.rb', line 23 def run connection @name_args.each do |volume_id| volume = ProfitBricks::Volume.get(config[:datacenter_id], nil, volume_id) volume if volume.nil? ui.error("Volume ID #{volume_id} not found. Skipping.") next end volume.attach(config[:server_id]) ui.msg("Volume #{volume_id} attached to server") end end |