vas 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +174 -0
- data/NOTICE +5 -0
- data/README.md +26 -0
- data/Rakefile +20 -0
- data/lib/vas.rb +103 -0
- data/lib/vas/gemfire/agent_configuration.rb +28 -0
- data/lib/vas/gemfire/agent_instances.rb +49 -0
- data/lib/vas/gemfire/agent_live_configurations.rb +29 -0
- data/lib/vas/gemfire/agent_logs.rb +38 -0
- data/lib/vas/gemfire/agent_node_instances.rb +38 -0
- data/lib/vas/gemfire/agent_pending_configurations.rb +38 -0
- data/lib/vas/gemfire/application_code.rb +54 -0
- data/lib/vas/gemfire/application_code_images.rb +76 -0
- data/lib/vas/gemfire/cache_server_configuration.rb +28 -0
- data/lib/vas/gemfire/cache_server_instances.rb +57 -0
- data/lib/vas/gemfire/cache_server_live_configurations.rb +29 -0
- data/lib/vas/gemfire/cache_server_logs.rb +38 -0
- data/lib/vas/gemfire/cache_server_node_instances.rb +46 -0
- data/lib/vas/gemfire/cache_server_pending_configurations.rb +38 -0
- data/lib/vas/gemfire/disk_stores.rb +63 -0
- data/lib/vas/gemfire/gemfire.rb +47 -0
- data/lib/vas/gemfire/groups.rb +50 -0
- data/lib/vas/gemfire/installation_images.rb +38 -0
- data/lib/vas/gemfire/installations.rb +53 -0
- data/lib/vas/gemfire/live_application_codes.rb +29 -0
- data/lib/vas/gemfire/locator_configuration.rb +28 -0
- data/lib/vas/gemfire/locator_instances.rb +109 -0
- data/lib/vas/gemfire/locator_live_configurations.rb +29 -0
- data/lib/vas/gemfire/locator_logs.rb +38 -0
- data/lib/vas/gemfire/locator_node_instances.rb +53 -0
- data/lib/vas/gemfire/locator_pending_configurations.rb +38 -0
- data/lib/vas/gemfire/nodes.rb +61 -0
- data/lib/vas/gemfire/pending_application_codes.rb +34 -0
- data/lib/vas/gemfire/statistics.rb +66 -0
- data/lib/vas/rabbitmq/configuration.rb +28 -0
- data/lib/vas/rabbitmq/groups.rb +42 -0
- data/lib/vas/rabbitmq/installation_images.rb +38 -0
- data/lib/vas/rabbitmq/installations.rb +43 -0
- data/lib/vas/rabbitmq/instances.rb +53 -0
- data/lib/vas/rabbitmq/live_configurations.rb +29 -0
- data/lib/vas/rabbitmq/logs.rb +38 -0
- data/lib/vas/rabbitmq/node_instances.rb +38 -0
- data/lib/vas/rabbitmq/nodes.rb +50 -0
- data/lib/vas/rabbitmq/pending_configurations.rb +38 -0
- data/lib/vas/rabbitmq/plugin_images.rb +67 -0
- data/lib/vas/rabbitmq/plugins.rb +85 -0
- data/lib/vas/rabbitmq/rabbitmq.rb +45 -0
- data/lib/vas/shared/collection.rb +46 -0
- data/lib/vas/shared/configuration.rb +59 -0
- data/lib/vas/shared/groups.rb +74 -0
- data/lib/vas/shared/installation_images.rb +62 -0
- data/lib/vas/shared/installations.rb +67 -0
- data/lib/vas/shared/instances.rb +74 -0
- data/lib/vas/shared/logs.rb +89 -0
- data/lib/vas/shared/mutable_collection.rb +27 -0
- data/lib/vas/shared/node_instances.rb +58 -0
- data/lib/vas/shared/nodes.rb +70 -0
- data/lib/vas/shared/pending_configuration.rb +40 -0
- data/lib/vas/shared/resource.rb +44 -0
- data/lib/vas/shared/security.rb +51 -0
- data/lib/vas/shared/state_resource.rb +44 -0
- data/lib/vas/tc_server/applications.rb +89 -0
- data/lib/vas/tc_server/configuration.rb +29 -0
- data/lib/vas/tc_server/groups.rb +42 -0
- data/lib/vas/tc_server/installation_images.rb +38 -0
- data/lib/vas/tc_server/installations.rb +54 -0
- data/lib/vas/tc_server/instances.rb +102 -0
- data/lib/vas/tc_server/live_configurations.rb +29 -0
- data/lib/vas/tc_server/logs.rb +38 -0
- data/lib/vas/tc_server/node_applications.rb +76 -0
- data/lib/vas/tc_server/node_instances.rb +55 -0
- data/lib/vas/tc_server/node_revisions.rb +55 -0
- data/lib/vas/tc_server/nodes.rb +50 -0
- data/lib/vas/tc_server/pending_configurations.rb +38 -0
- data/lib/vas/tc_server/revision_images.rb +67 -0
- data/lib/vas/tc_server/revisions.rb +71 -0
- data/lib/vas/tc_server/tc_server.rb +50 -0
- data/lib/vas/tc_server/template_images.rb +67 -0
- data/lib/vas/tc_server/templates.rb +70 -0
- data/lib/vas/util/client.rb +159 -0
- data/lib/vas/util/link_utils.rb +43 -0
- data/lib/vas/vas_exception.rb +32 -0
- data/lib/vas/vfabric/agent_image.rb +50 -0
- data/lib/vas/vfabric/nodes.rb +47 -0
- data/lib/vas/vfabric/v_fabric.rb +34 -0
- data/lib/vas/vfabric_administration_server.rb +50 -0
- metadata +213 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# vFabric Administration Server Ruby API
|
|
3
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#++
|
|
17
|
+
|
|
18
|
+
module Gemfire
|
|
19
|
+
|
|
20
|
+
class DiskStores < Shared::MutableCollection
|
|
21
|
+
|
|
22
|
+
def initialize(location, client)
|
|
23
|
+
super(location, client, 'disk-stores', DiskStore)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class DiskStore < Shared::Resource
|
|
29
|
+
|
|
30
|
+
# The last modified time of the disk store
|
|
31
|
+
attr_reader :last_modified
|
|
32
|
+
|
|
33
|
+
# The name of the disk store
|
|
34
|
+
attr_reader :name
|
|
35
|
+
|
|
36
|
+
# The size of the disk store
|
|
37
|
+
attr_reader :size
|
|
38
|
+
|
|
39
|
+
# The disk store's cache server node instance
|
|
40
|
+
attr_reader :instance
|
|
41
|
+
|
|
42
|
+
def initialize(location, client)
|
|
43
|
+
super(location, client)
|
|
44
|
+
|
|
45
|
+
@last_modified = details['last-modified']
|
|
46
|
+
@name = details['name']
|
|
47
|
+
@size = details['size']
|
|
48
|
+
@instance = CacheServerNodeInstance.new(Util::LinkUtils.get_link_href(details, 'cache-server-node-instance'), client)
|
|
49
|
+
@content_location = Util::LinkUtils.get_link_href(details, 'content')
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Retrieves the disk store's content and passes it to the +block+
|
|
53
|
+
def content(&block)
|
|
54
|
+
client.get_stream(@content_location, &block)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def to_s
|
|
58
|
+
"#<#{self.class} name='#@name'>"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# vFabric Administration Server Ruby API
|
|
3
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#++
|
|
17
|
+
|
|
18
|
+
module Gemfire
|
|
19
|
+
|
|
20
|
+
# The entry point to the API for administering GemFire
|
|
21
|
+
class Gemfire
|
|
22
|
+
|
|
23
|
+
# The GemFire groups
|
|
24
|
+
attr_reader :groups
|
|
25
|
+
|
|
26
|
+
# The GemFire installation images
|
|
27
|
+
attr_reader :installation_images
|
|
28
|
+
|
|
29
|
+
# The GemFire nodes
|
|
30
|
+
attr_reader :nodes
|
|
31
|
+
|
|
32
|
+
# The GemFire application code images
|
|
33
|
+
attr_reader :application_code_images
|
|
34
|
+
|
|
35
|
+
def initialize(location, client) #:nodoc:
|
|
36
|
+
|
|
37
|
+
json = client.get(location)
|
|
38
|
+
|
|
39
|
+
@groups = Groups.new(Util::LinkUtils.get_link_href(json, "groups"), client)
|
|
40
|
+
@installation_images = InstallationImages.new(Util::LinkUtils.get_link_href(json, "installation-images"), client)
|
|
41
|
+
@nodes = Nodes.new(Util::LinkUtils.get_link_href(json, "nodes"), client)
|
|
42
|
+
@application_code_images = ApplicationCodeImages.new(Util::LinkUtils.get_link_href(json, "application-code-images"), client)
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# vFabric Administration Server Ruby API
|
|
3
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#++
|
|
17
|
+
|
|
18
|
+
module Gemfire
|
|
19
|
+
|
|
20
|
+
# Used to enumerate, create, and delete GemFire groups.
|
|
21
|
+
class Groups < Shared::Groups
|
|
22
|
+
|
|
23
|
+
def initialize(location, client) #:nodoc:#
|
|
24
|
+
super(location, client, Group)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# A tc Server group
|
|
30
|
+
class Group < Shared::MutableGroup
|
|
31
|
+
|
|
32
|
+
# The group's agent instances
|
|
33
|
+
attr_reader :agent_instances
|
|
34
|
+
|
|
35
|
+
# The group's cache server instances
|
|
36
|
+
attr_reader :cache_server_instances
|
|
37
|
+
|
|
38
|
+
# The group's locator instances
|
|
39
|
+
attr_reader :locator_instances
|
|
40
|
+
|
|
41
|
+
def initialize(location, client) #:nodoc:#
|
|
42
|
+
super(location, client, Node, Installations)
|
|
43
|
+
@agent_instances = AgentInstances.new(Util::LinkUtils.get_link_href(details, "agent-group-instances"), client)
|
|
44
|
+
@cache_server_instances = CacheServerInstances.new(Util::LinkUtils.get_link_href(details, "cache-server-group-instances"), client)
|
|
45
|
+
@locator_instances = LocatorInstances.new(Util::LinkUtils.get_link_href(details, "locator-group-instances"), client)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# vFabric Administration Server Ruby API
|
|
3
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#++
|
|
17
|
+
|
|
18
|
+
module Gemfire
|
|
19
|
+
|
|
20
|
+
# Used to enumerate, create, and delete GemFire installation images.
|
|
21
|
+
class InstallationImages < Shared::InstallationImages
|
|
22
|
+
|
|
23
|
+
def initialize(location, client) #:nodoc:
|
|
24
|
+
super(location, client, InstallationImage)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# A GemFire installation image
|
|
30
|
+
class InstallationImage < Shared::InstallationImage
|
|
31
|
+
|
|
32
|
+
def initialize(location, client) #:nodoc:
|
|
33
|
+
super(location, client, Installation)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# vFabric Administration Server Ruby API
|
|
3
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#++
|
|
17
|
+
|
|
18
|
+
module Gemfire
|
|
19
|
+
|
|
20
|
+
# Used to enumerate, create, and delete GemFire installations.
|
|
21
|
+
class Installations < Shared::Installations
|
|
22
|
+
|
|
23
|
+
def initialize(location, client) #:nodoc:
|
|
24
|
+
super(location, client, Installation)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# A GemFire installation
|
|
30
|
+
class Installation < Shared::Installation
|
|
31
|
+
|
|
32
|
+
def initialize(location, client) #:nodoc:
|
|
33
|
+
super(location, client, InstallationImage, Group)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array of the agent instances that are using the installation
|
|
37
|
+
def agent_instances
|
|
38
|
+
retrieve_instances("agent-group-instance", AgentInstance);
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# An array of the agent instances that are using the installation
|
|
42
|
+
def cache_server_instances
|
|
43
|
+
retrieve_instances("cache-server-group-instance", CacheServerInstance);
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# An array of the locator instances that are using the installation
|
|
47
|
+
def locator_instances
|
|
48
|
+
retrieve_instances("locator-group-instance", LocatorInstance);
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# vFabric Administration Server Ruby API
|
|
3
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#++
|
|
17
|
+
|
|
18
|
+
module Gemfire
|
|
19
|
+
|
|
20
|
+
# Used to enumerate a cache server's live application code.
|
|
21
|
+
class LiveApplicationCodes < Shared::Collection
|
|
22
|
+
|
|
23
|
+
def initialize(location, client) #:nodoc:
|
|
24
|
+
super(location, client, "live-application-code", ApplicationCode)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# vFabric Administration Server Ruby API
|
|
3
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#++
|
|
17
|
+
|
|
18
|
+
module Gemfire
|
|
19
|
+
|
|
20
|
+
# A configuration file in a locator instance
|
|
21
|
+
class LocatorConfiguration < Shared::Configuration
|
|
22
|
+
|
|
23
|
+
def initialize(location, client) #:nodoc:
|
|
24
|
+
super(location, client, "locator-group-instance", LocatorInstance)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# vFabric Administration Server Ruby API
|
|
3
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#++
|
|
17
|
+
|
|
18
|
+
module Gemfire
|
|
19
|
+
|
|
20
|
+
# Used to enumerate, create, and delete locator instances.
|
|
21
|
+
class LocatorInstances < Shared::MutableCollection
|
|
22
|
+
|
|
23
|
+
def initialize(location, client) #:nodoc:
|
|
24
|
+
super(location, client, "locator-group-instances", LocatorInstance)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Creates a new instance named +name+, using the given +installation+.
|
|
28
|
+
# Creation can be customized using +options+.
|
|
29
|
+
#
|
|
30
|
+
# Recognized options are:
|
|
31
|
+
#
|
|
32
|
+
# peer:: +true+ if the locator should act as a peer, otherwise +false+. Defaults to +true+
|
|
33
|
+
# port:: The port on which the locator should listen. If omitted the locator will listen on the default port (10334)
|
|
34
|
+
# server:: +true+ if the locator should act as a server, otherwise +false+. Defaults to +true+
|
|
35
|
+
def create(installation, name, options = {})
|
|
36
|
+
payload = { :installation => installation.location, :name => name }
|
|
37
|
+
|
|
38
|
+
if options.has_key?(:peer)
|
|
39
|
+
payload[:peer] = options[:peer]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
if options.has_key?(:port)
|
|
43
|
+
payload[:port] = options[:port]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
if options.has_key?(:server)
|
|
47
|
+
payload[:server] = options[:server]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
LocatorInstance.new(client.post(location, payload, "locator-group-instance"), client)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# A locator instance
|
|
56
|
+
class LocatorInstance < Shared::Instance
|
|
57
|
+
|
|
58
|
+
def initialize(location, client) #:nodoc:
|
|
59
|
+
super(location, client, Group, Installation, LocatorLiveConfigurations, LocatorPendingConfigurations, LocatorNodeInstance, 'locator-node-instance')
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Updates the instance using the supplied +options+.
|
|
63
|
+
#
|
|
64
|
+
# Recognized options are:
|
|
65
|
+
#
|
|
66
|
+
# installation:: The installation to use when running the locator instance. If omitted or nil, the installation configuration will not be changed
|
|
67
|
+
# peer:: Whether or not the locator will act as a peer. If omitted, the configuration will not be changed
|
|
68
|
+
# port:: The port on which the locator will listen. If omitted, the port configuration will not be changed
|
|
69
|
+
# server:: Whether or not the locator will act as a server. If omitted, the configuration will not be changed
|
|
70
|
+
def update(options)
|
|
71
|
+
payload = {}
|
|
72
|
+
|
|
73
|
+
if options.has_key?(:installation)
|
|
74
|
+
payload[:installation] = options[:installation].location
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if options.has_key?(:peer)
|
|
78
|
+
payload[:peer] = options[:peer]
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if options.has_key?(:port)
|
|
82
|
+
payload[:port] = options[:port]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if options.has_key?(:server)
|
|
86
|
+
payload[:server] = options[:server]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
client.post(location, payload)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# The port that the locator will listen on
|
|
93
|
+
def port
|
|
94
|
+
client.get(location)['port']
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# +true+ if the locator will act as a peer, +false+ if it will not
|
|
98
|
+
def peer
|
|
99
|
+
client.get(location)['peer']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# +true+ if the locator will act as a server, +false+ if it will not
|
|
103
|
+
def server
|
|
104
|
+
client.get(location)['server']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# vFabric Administration Server Ruby API
|
|
3
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#++
|
|
17
|
+
|
|
18
|
+
module Gemfire
|
|
19
|
+
|
|
20
|
+
# Used to enumerate a locator instance's live configuration
|
|
21
|
+
class LocatorLiveConfigurations < Shared::Collection
|
|
22
|
+
|
|
23
|
+
def initialize(location, client) #:nodoc:
|
|
24
|
+
super(location, client, "live-configurations", LocatorConfiguration)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|