Class: WebServer::Instances

Inherits:
Shared::MutableCollection show all
Defined in:
lib/vas/web_server/instances.rb

Overview

Used to enumerate, create, and delete Web Server instances

Instance Attribute Summary

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods inherited from Shared::MutableCollection

#create_image

Methods inherited from Shared::Collection

#each, #reload

Constructor Details

#initialize(location, client) ⇒ Instances

Returns a new instance of Instances.



23
24
25
# File 'lib/vas/web_server/instances.rb', line 23

def initialize(location, client)
  super(location, client, "group-instances", Instance)
end

Instance Method Details

#create(installation, name, properties = nil) ⇒ Instance

Creates a new instance

Parameters:

  • installation (Installation)

    the installation to be used by the instance

  • name (String)

    the name of the instance

  • properties (Hash) (defaults to: nil)

    optional properties to use when creating the instance

Returns:



34
35
36
37
38
39
40
# File 'lib/vas/web_server/instances.rb', line 34

def create(installation, name, properties = nil)
  payload = { :installation => installation.location,
              :name => name}
  payload[:properties] = properties unless properties.nil?
  
  super(payload, 'group-instance')
end