Class: RightScaleAPI::Ec2EbsVolume

Inherits:
Account::SubResource show all
Defined in:
lib/right-scale-api/ec2_ebs_volume.rb

Overview

Instance Attribute Summary

Attributes inherited from Account::SubResource

#account

Instance Method Summary collapse

Methods inherited from Base

api_name, attributes, create, #delete, #destroy, get, #get, #head, #initialize, #path, #post, #put, #reload!, #send_request, #update, #uri

Constructor Details

This class inherits a constructor from RightScaleAPI::Base

Instance Method Details

#attach_to_server(server, device, mount) ⇒ Object

Attaches the volume to a server

Parameters:

  • server (RightScaleAPI::Server)

    the server to attach the volume to

  • device (String)

    the device to mount the volume as e.g. /dev/sdk

  • mount (String)

    when to mount the device. Usually ‘boot’



22
23
24
25
26
27
28
29
30
31
# File 'lib/right-scale-api/ec2_ebs_volume.rb', line 22

def attach_to_server server, device, mount
  .post '/component_ec2_ebs_volumes', :body => {
    :component_ec2_ebs_volume => {
      :ec2_ebs_volume_href => uri,
      :component_href => server.href,
      :device => device,
      :mount => mount
    }
  }
end

#collection_uriObject



33
34
35
# File 'lib/right-scale-api/ec2_ebs_volume.rb', line 33

def collection_uri
  .path + "/ec2_ebs_volumes"
end