Class: Sqlfire::ServerInstances

Inherits:
Shared::MutableCollection show all
Defined in:
lib/vas/sqlfire/server_instances.rb

Overview

Used to enumerate, create, and delete 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) ⇒ ServerInstances

Returns a new instance of ServerInstances.



36
37
38
# File 'lib/vas/sqlfire/server_instances.rb', line 36

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

Instance Method Details

#create(installation, name, options = {}) ⇒ ServerInstance

Creates a new server instance

Parameters:

  • installation (Installation)

    the installation that the instance will use

  • name (String)

    the name of the instance

  • options (Hash) (defaults to: {})

    optional configuration for the instance

Options Hash (options):

  • The ('bind-address'String)

    property in a node’s metadata to use to determine the address that the server binds to for peer-to-peer communication. If omitted, or if the property does not exist, the server will use the node’s hostname

  • The ('client-bind-address'String)

    property in a node’s metadata to use to determine the address that the server binds to for client communication. If omitted, or if the property does not exist, the server will use the node’s hostname. Only takes effect if run-netserver is true

  • The ('client-port'Integer)

    port that the server listens on for client connections. Only take effect if run-netserver is true

  • Critical ('critical-heap-percentage'Integer)

    heap threshold as a percentage of the old generation heap

  • The ('initial-heap'String)

    intial heap size to be used by the server’s JVM. If not specified, the JVM’s default is used

  • The ('jvm-options'String[])

    JVM options that are passed to the server’s JVM when it is started

  • The ('max-heap'String)

    maximum heap size to be used by the server’s JVM. If not specified, the JVM’s default is used

  • Whether ('run-netserver'Boolean)

    the locator should run a netserver that can service thin clients. Default is true.

Returns:



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/vas/sqlfire/server_instances.rb', line 65

def create(installation, name, options = {})
  payload = { :installation => installation.location, :name => name }

  options.each { |key, value|
    if (CREATE_PAYLOAD_KEYS.include?(key))
      payload[key] = value
    end
  }

  super(payload, 'server-group-instance')
end