Class: Gemfire::LocatorInstances
- Inherits:
-
Shared::MutableCollection
- Object
- Shared::Resource
- Shared::Collection
- Shared::MutableCollection
- Gemfire::LocatorInstances
- Defined in:
- lib/vas/gemfire/locator_instances.rb
Overview
Used to enumerate, create, and delete locator instances.
Instance Attribute Summary
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#create(installation, name, options = {}) ⇒ Object
Creates a new instance named
name
, using the giveninstallation
. -
#initialize(location, client) ⇒ LocatorInstances
constructor
:nodoc:.
Methods inherited from Shared::MutableCollection
Methods inherited from Shared::Collection
Constructor Details
#initialize(location, client) ⇒ LocatorInstances
:nodoc:
23 24 25 |
# File 'lib/vas/gemfire/locator_instances.rb', line 23 def initialize(location, client) #:nodoc: super(location, client, "locator-group-instances", LocatorInstance) end |
Instance Method Details
#create(installation, name, options = {}) ⇒ Object
Creates a new instance named name
, using the given installation
. Creation can be customized using options
.
Recognized options are:
- peer
-
true
if the locator should act as a peer, otherwisefalse
. Defaults totrue
- port
-
The port on which the locator should listen. If omitted the locator will listen on the default port (10334)
- server
-
true
if the locator should act as a server, otherwisefalse
. Defaults totrue
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/vas/gemfire/locator_instances.rb', line 35 def create(installation, name, = {}) payload = { :installation => installation.location, :name => name } if .has_key?(:peer) payload[:peer] = [:peer] end if .has_key?(:port) payload[:port] = [:port] end if .has_key?(:server) payload[:server] = [:server] end LocatorInstance.new(client.post(location, payload, "locator-group-instance"), client) end |