vas 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +25 -5
- data/lib/vas.rb +2 -7
- data/lib/vas/gemfire/agent_instances.rb +16 -6
- data/lib/vas/gemfire/agent_live_configurations.rb +14 -4
- data/lib/vas/gemfire/agent_logs.rb +5 -4
- data/lib/vas/gemfire/agent_node_instances.rb +5 -4
- data/lib/vas/gemfire/agent_pending_configurations.rb +5 -4
- data/lib/vas/gemfire/application_code.rb +7 -6
- data/lib/vas/gemfire/application_code_images.rb +19 -11
- data/lib/vas/gemfire/cache_server_instances.rb +18 -8
- data/lib/vas/gemfire/cache_server_live_configurations.rb +14 -4
- data/lib/vas/gemfire/cache_server_logs.rb +5 -4
- data/lib/vas/gemfire/cache_server_node_instances.rb +7 -6
- data/lib/vas/gemfire/cache_server_pending_configurations.rb +6 -5
- data/lib/vas/gemfire/disk_stores.rb +23 -13
- data/lib/vas/gemfire/gemfire.rb +8 -7
- data/lib/vas/gemfire/groups.rb +9 -8
- data/lib/vas/gemfire/installation_images.rb +5 -4
- data/lib/vas/gemfire/installations.rb +11 -10
- data/lib/vas/gemfire/live_application_codes.rb +3 -3
- data/lib/vas/gemfire/locator_instances.rb +25 -20
- data/lib/vas/gemfire/locator_live_configurations.rb +14 -4
- data/lib/vas/gemfire/locator_logs.rb +5 -4
- data/lib/vas/gemfire/locator_node_instances.rb +7 -6
- data/lib/vas/gemfire/locator_pending_configurations.rb +6 -5
- data/lib/vas/gemfire/nodes.rb +20 -21
- data/lib/vas/gemfire/pending_application_codes.rb +8 -4
- data/lib/vas/gemfire/statistics.rb +21 -13
- data/lib/vas/rabbitmq/groups.rb +8 -7
- data/lib/vas/rabbitmq/installation_images.rb +7 -6
- data/lib/vas/rabbitmq/installations.rb +8 -7
- data/lib/vas/rabbitmq/instances.rb +20 -10
- data/lib/vas/rabbitmq/live_configurations.rb +15 -5
- data/lib/vas/rabbitmq/logs.rb +7 -6
- data/lib/vas/rabbitmq/node_instances.rb +7 -6
- data/lib/vas/rabbitmq/nodes.rb +13 -15
- data/lib/vas/rabbitmq/pending_configurations.rb +7 -6
- data/lib/vas/rabbitmq/plugin_images.rb +14 -8
- data/lib/vas/rabbitmq/plugins.rb +24 -23
- data/lib/vas/rabbitmq/rabbitmq.rb +10 -7
- data/lib/vas/shared/collection.rb +12 -6
- data/lib/vas/shared/configuration.rb +16 -8
- data/lib/vas/shared/groups.rb +28 -10
- data/lib/vas/shared/installation_images.rb +20 -8
- data/lib/vas/shared/installations.rb +23 -12
- data/lib/vas/shared/{instances.rb → instance.rb} +11 -12
- data/lib/vas/shared/logs.rb +30 -21
- data/lib/vas/shared/mutable_collection.rb +5 -3
- data/lib/vas/shared/node_instances.rb +12 -7
- data/lib/vas/shared/nodes.rb +14 -12
- data/lib/vas/shared/pending_configuration.rb +12 -5
- data/lib/vas/shared/resource.rb +10 -6
- data/lib/vas/shared/security.rb +15 -11
- data/lib/vas/shared/state_resource.rb +12 -6
- data/lib/vas/tc_server/applications.rb +24 -21
- data/lib/vas/tc_server/configuration.rb +3 -3
- data/lib/vas/tc_server/groups.rb +7 -6
- data/lib/vas/tc_server/installation_images.rb +5 -4
- data/lib/vas/tc_server/installations.rb +11 -12
- data/lib/vas/tc_server/instances.rb +28 -20
- data/lib/vas/tc_server/live_configurations.rb +3 -3
- data/lib/vas/tc_server/logs.rb +1 -2
- data/lib/vas/tc_server/node_applications.rb +19 -19
- data/lib/vas/tc_server/node_instances.rb +9 -8
- data/lib/vas/tc_server/node_revisions.rb +12 -10
- data/lib/vas/tc_server/nodes.rb +11 -9
- data/lib/vas/tc_server/pending_configurations.rb +5 -4
- data/lib/vas/tc_server/revision_images.rb +19 -11
- data/lib/vas/tc_server/revisions.rb +22 -18
- data/lib/vas/tc_server/tc_server.rb +9 -8
- data/lib/vas/tc_server/template_images.rb +19 -11
- data/lib/vas/tc_server/templates.rb +19 -17
- data/lib/vas/util/client.rb +4 -3
- data/lib/vas/util/link_utils.rb +4 -3
- data/lib/vas/vas_exception.rb +6 -6
- data/lib/vas/vfabric/agent_image.rb +14 -3
- data/lib/vas/vfabric/nodes.rb +16 -10
- data/lib/vas/vfabric/v_fabric.rb +6 -3
- data/lib/vas/vfabric_administration_server.rb +11 -11
- metadata +13 -17
- data/lib/vas/gemfire/agent_configuration.rb +0 -28
- data/lib/vas/gemfire/cache_server_configuration.rb +0 -28
- data/lib/vas/gemfire/locator_configuration.rb +0 -28
- data/lib/vas/rabbitmq/configuration.rb +0 -28
data/README.md
CHANGED
@@ -13,13 +13,33 @@ The VAS Ruby API requires Ruby 1.8.7 or 1.9.x. It has been built and tested on 1
|
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
16
|
-
The VAS Ruby API is
|
17
|
-
gems can be [downloaded](https://github.com/vFabric/vas-ruby-api/downloads) and installed. For
|
18
|
-
example:
|
16
|
+
The VAS Ruby API is available on [RubyGems](https://rubygems.org/gems/vas). To install it run:
|
19
17
|
|
20
|
-
gem install vas
|
18
|
+
gem install vas
|
21
19
|
|
22
|
-
##
|
20
|
+
## Getting started
|
21
|
+
|
22
|
+
### Examples
|
23
|
+
|
24
|
+
A number of [examples](https://github.com/vFabric/vas-ruby-api/tree/master/examples) are provided:
|
25
|
+
|
26
|
+
#### tc Server
|
27
|
+
|
28
|
+
* [Provision tc Server and deploy a web application](https://github.com/vFabric/vas-ruby-api/tree/master/examples/tc-server/web-application)
|
29
|
+
|
30
|
+
#### RabbitMQ
|
31
|
+
|
32
|
+
* [Provision Rabbit and enable the management plugin](https://github.com/vFabric/vas-ruby-api/tree/master/examples/rabbitmq/management-plugin)
|
33
|
+
|
34
|
+
#### VAS
|
35
|
+
|
36
|
+
* [Download, install, and start the VAS agent](https://github.com/vFabric/vas-ruby-api/tree/master/examples/rabbitmq/management-plugin)
|
37
|
+
|
38
|
+
### Documentation
|
39
|
+
|
40
|
+
You may also like to look at the [API documentation](http://rubydoc.info/gems/vas/0.3.0/frames).
|
41
|
+
|
42
|
+
##Licence
|
23
43
|
|
24
44
|
The VAS Ruby API is licensed under the [Apache Licence, Version 2.0][asl2].
|
25
45
|
|
data/lib/vas.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#--
|
2
1
|
# vFabric Administration Server Ruby API
|
3
2
|
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
4
3
|
#
|
@@ -13,7 +12,7 @@
|
|
13
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
13
|
# See the License for the specific language governing permissions and
|
15
14
|
# limitations under the License.
|
16
|
-
|
15
|
+
|
17
16
|
|
18
17
|
require 'json'
|
19
18
|
require 'net/http'
|
@@ -29,11 +28,10 @@ require 'vas/shared/installation_images'
|
|
29
28
|
require 'vas/shared/pending_configuration'
|
30
29
|
require 'vas/shared/security'
|
31
30
|
require 'vas/shared/state_resource'
|
32
|
-
require 'vas/shared/
|
31
|
+
require 'vas/shared/instance'
|
33
32
|
require 'vas/shared/logs'
|
34
33
|
require 'vas/shared/node_instances'
|
35
34
|
require 'vas/shared/nodes'
|
36
|
-
require 'vas/gemfire/agent_configuration'
|
37
35
|
require 'vas/gemfire/agent_instances'
|
38
36
|
require 'vas/gemfire/agent_live_configurations'
|
39
37
|
require 'vas/gemfire/agent_logs'
|
@@ -41,7 +39,6 @@ require 'vas/gemfire/agent_node_instances'
|
|
41
39
|
require 'vas/gemfire/agent_pending_configurations'
|
42
40
|
require 'vas/gemfire/application_code_images'
|
43
41
|
require 'vas/gemfire/application_code'
|
44
|
-
require 'vas/gemfire/cache_server_configuration'
|
45
42
|
require 'vas/gemfire/cache_server_instances'
|
46
43
|
require 'vas/gemfire/cache_server_live_configurations'
|
47
44
|
require 'vas/gemfire/cache_server_logs'
|
@@ -53,7 +50,6 @@ require 'vas/gemfire/groups'
|
|
53
50
|
require 'vas/gemfire/installation_images'
|
54
51
|
require 'vas/gemfire/installations'
|
55
52
|
require 'vas/gemfire/live_application_codes'
|
56
|
-
require 'vas/gemfire/locator_configuration'
|
57
53
|
require 'vas/gemfire/locator_instances'
|
58
54
|
require 'vas/gemfire/locator_live_configurations'
|
59
55
|
require 'vas/gemfire/locator_logs'
|
@@ -62,7 +58,6 @@ require 'vas/gemfire/locator_pending_configurations'
|
|
62
58
|
require 'vas/gemfire/nodes'
|
63
59
|
require 'vas/gemfire/pending_application_codes'
|
64
60
|
require 'vas/gemfire/statistics'
|
65
|
-
require 'vas/rabbitmq/configuration'
|
66
61
|
require 'vas/rabbitmq/groups'
|
67
62
|
require 'vas/rabbitmq/installation_images'
|
68
63
|
require 'vas/rabbitmq/plugin_images'
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#--
|
2
1
|
# vFabric Administration Server Ruby API
|
3
2
|
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
4
3
|
#
|
@@ -13,18 +12,24 @@
|
|
13
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
13
|
# See the License for the specific language governing permissions and
|
15
14
|
# limitations under the License.
|
16
|
-
|
15
|
+
|
17
16
|
|
18
17
|
module Gemfire
|
19
18
|
|
20
19
|
# Used to enumerate, create, and delete agent instances.
|
21
20
|
class AgentInstances < Shared::MutableCollection
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, "agent-group-instances", AgentInstance)
|
25
25
|
end
|
26
26
|
|
27
|
-
# Creates a new instance
|
27
|
+
# Creates a new agent instance
|
28
|
+
#
|
29
|
+
# @param installation [Installation] the installation to be used by the instance
|
30
|
+
# @param name [String] the name of the instance
|
31
|
+
#
|
32
|
+
# @return [AgentInstance] the new agent instance
|
28
33
|
def create(installation, name)
|
29
34
|
payload = { :installation => installation.location, :name => name }
|
30
35
|
AgentInstance.new(client.post(location, payload, "agent-group-instance"), client)
|
@@ -35,11 +40,16 @@ module Gemfire
|
|
35
40
|
# An agent instance
|
36
41
|
class AgentInstance < Shared::Instance
|
37
42
|
|
38
|
-
|
43
|
+
# @private
|
44
|
+
def initialize(location, client)
|
39
45
|
super(location, client, Group, Installation, AgentLiveConfigurations, AgentPendingConfigurations, AgentNodeInstance, 'agent-node-instance')
|
40
46
|
end
|
41
47
|
|
42
|
-
# Updates the instance to use
|
48
|
+
# Updates the instance to use a different installation
|
49
|
+
#
|
50
|
+
# @param installation [Installation] the installation that the instance should use
|
51
|
+
#
|
52
|
+
# @return [void]
|
43
53
|
def update(installation)
|
44
54
|
client.post(location, { :installation => installation.location });
|
45
55
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#--
|
2
1
|
# vFabric Administration Server Ruby API
|
3
2
|
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
4
3
|
#
|
@@ -13,15 +12,26 @@
|
|
13
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
13
|
# See the License for the specific language governing permissions and
|
15
14
|
# limitations under the License.
|
16
|
-
|
15
|
+
|
17
16
|
|
18
17
|
module Gemfire
|
19
18
|
|
20
19
|
# Used to enumerate an agent instance's live configuration
|
21
20
|
class AgentLiveConfigurations < Shared::Collection
|
22
21
|
|
23
|
-
|
24
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
|
+
super(location, client, "live-configurations", AgentLiveConfiguration)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
# A live configuration file in an agent instance
|
30
|
+
class AgentLiveConfiguration < Shared::Configuration
|
31
|
+
|
32
|
+
# @private
|
33
|
+
def initialize(location, client)
|
34
|
+
super(location, client, "agent-group-instance", AgentInstance)
|
25
35
|
end
|
26
36
|
|
27
37
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#--
|
2
1
|
# vFabric Administration Server Ruby API
|
3
2
|
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
4
3
|
#
|
@@ -13,14 +12,15 @@
|
|
13
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
13
|
# See the License for the specific language governing permissions and
|
15
14
|
# limitations under the License.
|
16
|
-
|
15
|
+
|
17
16
|
|
18
17
|
module Gemfire
|
19
18
|
|
20
19
|
# Used to enumerate an agent node instance's logs
|
21
20
|
class AgentLogs < Shared::Logs
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, AgentLog)
|
25
25
|
end
|
26
26
|
|
@@ -29,7 +29,8 @@ module Gemfire
|
|
29
29
|
# A log file in an agent node instance
|
30
30
|
class AgentLog < Shared::Log
|
31
31
|
|
32
|
-
|
32
|
+
# @private
|
33
|
+
def initialize(location, client)
|
33
34
|
super(location, client, 'agent-node-instance', AgentNodeInstance)
|
34
35
|
end
|
35
36
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#--
|
2
1
|
# vFabric Administration Server Ruby API
|
3
2
|
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
4
3
|
#
|
@@ -13,14 +12,15 @@
|
|
13
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
13
|
# See the License for the specific language governing permissions and
|
15
14
|
# limitations under the License.
|
16
|
-
|
15
|
+
|
17
16
|
|
18
17
|
module Gemfire
|
19
18
|
|
20
19
|
# Used to enumerate agent instances on an individual node
|
21
20
|
class AgentNodeInstances < Shared::NodeInstances
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, "agent-node-instances", AgentNodeInstance)
|
25
25
|
end
|
26
26
|
|
@@ -29,7 +29,8 @@ module Gemfire
|
|
29
29
|
# An agent node instance
|
30
30
|
class AgentNodeInstance < Shared::NodeInstance
|
31
31
|
|
32
|
-
|
32
|
+
# @private
|
33
|
+
def initialize(location, client)
|
33
34
|
super(location, client, Node, AgentLogs, AgentInstance, 'agent-group-instance')
|
34
35
|
end
|
35
36
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#--
|
2
1
|
# vFabric Administration Server Ruby API
|
3
2
|
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
4
3
|
#
|
@@ -13,14 +12,15 @@
|
|
13
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
13
|
# See the License for the specific language governing permissions and
|
15
14
|
# limitations under the License.
|
16
|
-
|
15
|
+
|
17
16
|
|
18
17
|
module Gemfire
|
19
18
|
|
20
19
|
# Used to enumerate an agent instance's pending configuration
|
21
20
|
class AgentPendingConfigurations < Shared::PendingConfigurations
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, 'pending-configurations', AgentPendingConfiguration)
|
25
25
|
end
|
26
26
|
|
@@ -29,7 +29,8 @@ module Gemfire
|
|
29
29
|
# A configuration file that is pending
|
30
30
|
class AgentPendingConfiguration < Shared::PendingConfiguration
|
31
31
|
|
32
|
-
|
32
|
+
# @private
|
33
|
+
def initialize(location, client)
|
33
34
|
super(location, client, 'agent-group-instance', AgentInstance)
|
34
35
|
end
|
35
36
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#--
|
2
1
|
# vFabric Administration Server Ruby API
|
3
2
|
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
4
3
|
#
|
@@ -13,25 +12,26 @@
|
|
13
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
13
|
# See the License for the specific language governing permissions and
|
15
14
|
# limitations under the License.
|
16
|
-
|
15
|
+
|
17
16
|
|
18
17
|
module Gemfire
|
19
18
|
|
20
19
|
# Application code in a cache server instance
|
21
20
|
class ApplicationCode < Shared::Resource
|
22
21
|
|
23
|
-
#
|
22
|
+
# @return [String] the name of the application code
|
24
23
|
attr_reader :name
|
25
24
|
|
26
|
-
#
|
25
|
+
# @return [String] the version of the application code
|
27
26
|
attr_reader :version
|
28
27
|
|
29
|
-
#
|
28
|
+
# @return [ApplicationCodeImage] the image that was used to create the application code
|
30
29
|
attr_reader :application_code_image
|
31
30
|
|
32
|
-
#
|
31
|
+
# @return [CacheServerInstance] the cache server instance that contains the application code
|
33
32
|
attr_reader :instance
|
34
33
|
|
34
|
+
# @private
|
35
35
|
def initialize(location, client)
|
36
36
|
super(location, client)
|
37
37
|
|
@@ -45,6 +45,7 @@ module Gemfire
|
|
45
45
|
Util::LinkUtils.get_link_href(details, 'cache-server-group-instance'), client)
|
46
46
|
end
|
47
47
|
|
48
|
+
# @return [String] a string representation of the application code
|
48
49
|
def to_s #:nodoc:
|
49
50
|
"#<#{self.class} name='#@name' version=#@version>"
|
50
51
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#--
|
2
1
|
# vFabric Administration Server Ruby API
|
3
2
|
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
4
3
|
#
|
@@ -13,18 +12,25 @@
|
|
13
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
13
|
# See the License for the specific language governing permissions and
|
15
14
|
# limitations under the License.
|
16
|
-
|
15
|
+
|
17
16
|
|
18
17
|
module Gemfire
|
19
18
|
|
20
19
|
# Used to enumerate, create, and delete GemFire application code images.
|
21
20
|
class ApplicationCodeImages < Shared::MutableCollection
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, "application-code-images", ApplicationCodeImage)
|
25
25
|
end
|
26
26
|
|
27
|
-
# Creates
|
27
|
+
# Creates a new application code image by uploading a file and assigning it a name and version
|
28
|
+
#
|
29
|
+
# @param path [String] the path of the file to upload
|
30
|
+
# @param name [String] the name of the application code
|
31
|
+
# @param version [String] the version of the application code
|
32
|
+
#
|
33
|
+
# @return [ApplicationCodeImage] the new application code image
|
28
34
|
def create(path, name, version)
|
29
35
|
ApplicationCodeImage.new(client.post_image(location, path, { :name => name, :version => version }), client)
|
30
36
|
end
|
@@ -34,16 +40,17 @@ module Gemfire
|
|
34
40
|
# An application code image
|
35
41
|
class ApplicationCodeImage < Shared::Resource
|
36
42
|
|
37
|
-
#
|
43
|
+
# @return [String] the application code image's name
|
38
44
|
attr_reader :name
|
39
45
|
|
40
|
-
#
|
46
|
+
# @return [String] the application code image's version
|
41
47
|
attr_reader :version
|
42
48
|
|
43
|
-
#
|
49
|
+
# @return [String] the application code image's size
|
44
50
|
attr_reader :size
|
45
51
|
|
46
|
-
|
52
|
+
# @private
|
53
|
+
def initialize(location, client)
|
47
54
|
super(location, client)
|
48
55
|
|
49
56
|
@name = details['name']
|
@@ -51,7 +58,7 @@ module Gemfire
|
|
51
58
|
@size = details['size']
|
52
59
|
end
|
53
60
|
|
54
|
-
#
|
61
|
+
# @return [ApplicationCode[]] the live application code that has been created from this application code image
|
55
62
|
def live_application_code
|
56
63
|
application_codes = []
|
57
64
|
Util::LinkUtils.get_link_hrefs(client.get(location), "live-application-code").each {
|
@@ -59,7 +66,7 @@ module Gemfire
|
|
59
66
|
application_codes
|
60
67
|
end
|
61
68
|
|
62
|
-
#
|
69
|
+
# @return [ApplicationCode[]] the pending application code that has been created from this application code image
|
63
70
|
def pending_application_code
|
64
71
|
application_codes = []
|
65
72
|
Util::LinkUtils.get_link_hrefs(client.get(location), "pending-application-code").each {
|
@@ -67,7 +74,8 @@ module Gemfire
|
|
67
74
|
application_codes
|
68
75
|
end
|
69
76
|
|
70
|
-
|
77
|
+
# @return [String] a string representation of the application code image
|
78
|
+
def to_s
|
71
79
|
"#<#{self.class} name='#@name' version='#@version'>"
|
72
80
|
end
|
73
81
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#--
|
2
1
|
# vFabric Administration Server Ruby API
|
3
2
|
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
4
3
|
#
|
@@ -13,18 +12,24 @@
|
|
13
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
13
|
# See the License for the specific language governing permissions and
|
15
14
|
# limitations under the License.
|
16
|
-
|
15
|
+
|
17
16
|
|
18
17
|
module Gemfire
|
19
18
|
|
20
19
|
# Used to enumerate, create, and delete cache server instances.
|
21
20
|
class CacheServerInstances < Shared::MutableCollection
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, "cache-server-group-instances", CacheServerInstance)
|
25
25
|
end
|
26
26
|
|
27
|
-
# Creates a new
|
27
|
+
# Creates a new cache server instance
|
28
|
+
#
|
29
|
+
# @param installation [Installation] the installation to be used by the instance
|
30
|
+
# @param name [String] the name of the instance
|
31
|
+
#
|
32
|
+
# @return [CacheServerInstance] the new cache server instance
|
28
33
|
def create(installation, name)
|
29
34
|
payload = { :installation => installation.location, :name => name }
|
30
35
|
CacheServerInstance.new(client.post(location, payload, "cache-server-group-instance"), client)
|
@@ -35,19 +40,24 @@ module Gemfire
|
|
35
40
|
# A cache server instance
|
36
41
|
class CacheServerInstance < Shared::Instance
|
37
42
|
|
38
|
-
#
|
43
|
+
# @return [LiveApplicationCodes] the instance's live application code
|
39
44
|
attr_reader :live_application_code
|
40
45
|
|
41
|
-
#
|
46
|
+
# @return [PendingApplicationCodes] the instance's pending application code
|
42
47
|
attr_reader :pending_application_code
|
43
48
|
|
44
|
-
|
49
|
+
# @private
|
50
|
+
def initialize(location, client)
|
45
51
|
super(location, client, Group, Installation, CacheServerLiveConfigurations, CacheServerPendingConfigurations, CacheServerNodeInstance, 'cache-server-node-instance')
|
46
52
|
@live_application_code = LiveApplicationCodes.new(Util::LinkUtils.get_link_href(details, 'live-application-code'), client)
|
47
53
|
@pending_application_code = PendingApplicationCodes.new(Util::LinkUtils.get_link_href(details, 'pending-application-code'), client)
|
48
54
|
end
|
49
55
|
|
50
|
-
# Updates the instance to use
|
56
|
+
# Updates the instance to use a different installation
|
57
|
+
#
|
58
|
+
# @param installation [Installation] the installation that the instance should use
|
59
|
+
#
|
60
|
+
# @return [void]
|
51
61
|
def update(installation)
|
52
62
|
client.post(location, { :installation => installation.location });
|
53
63
|
end
|