Class: StudioApi::Appliance::Configuration

Inherits:
ActiveResource::Base
  • Object
show all
Extended by:
StudioResource
Defined in:
lib/studio_api/appliance.rb

Overview

Represent appliance configuration

Examples:

set LVM in appliance ( require rails 3 for newly initialized variables )

configuration = appliance.configuration
configuration.lvm.enabled = "true"
configuration.lvm.volume_group = "fooVG"
configuration.lvm.volumes = [ { :path => "/test", :size => "500M" } ]
configuration.save

Defined Under Namespace

Classes: Firewall

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from StudioResource

collection_path, element_path, extended, studio_connection, studio_connection=

Class Method Details

+ (Object) find(id, prefix_options = {})



38
39
40
41
42
# File 'lib/studio_api/appliance.rb', line 38

def self.find (id, prefix_options={})
  request_str = "/appliances/#{id.to_i}/configuration"
  response = GenericRequest.new(studio_connection).get request_str
  Configuration.parse response
end

Instance Method Details

- (Object) update



44
45
46
47
48
49
50
# File 'lib/studio_api/appliance.rb', line 44

def update
  appliance_id = id
  attributes.delete "id"
  rq = GenericRequest.new self.class.studio_connection
  rq.put "/appliances/#{appliance_id.to_i}/configuration", :__raw => to_xml
  attributes["id"] = appliance_id
end