vas 0.3.0 → 0.4.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/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/lib/vas/tc_server/groups.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,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 TcServer
|
19
18
|
|
20
|
-
# Used to enumerate, create, and delete tc Server groups
|
19
|
+
# Used to enumerate, create, and delete tc Server groups
|
21
20
|
class Groups < Shared::Groups
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, Group)
|
25
25
|
end
|
26
26
|
|
@@ -31,8 +31,9 @@ module TcServer
|
|
31
31
|
|
32
32
|
# The group's instances
|
33
33
|
attr_reader :instances
|
34
|
-
|
35
|
-
|
34
|
+
|
35
|
+
# @private
|
36
|
+
def initialize(location, client)
|
36
37
|
super(location, client, Node, Installations)
|
37
38
|
@instances = Instances.new(Util::LinkUtils.get_link_href(details, "group-instances"), client)
|
38
39
|
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 TcServer
|
19
18
|
|
20
19
|
# Used to enumerate, create, and delete tc Server installation images.
|
21
20
|
class InstallationImages < Shared::InstallationImages
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, InstallationImage)
|
25
25
|
end
|
26
26
|
|
@@ -29,7 +29,8 @@ module TcServer
|
|
29
29
|
# A tc Server installation image
|
30
30
|
class InstallationImage < Shared::InstallationImage
|
31
31
|
|
32
|
-
|
32
|
+
# @private
|
33
|
+
def initialize(location, client)
|
33
34
|
super(location, client, Installation)
|
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 TcServer
|
19
18
|
|
20
19
|
# Used to enumerate, create, and delete tc Server installations.
|
21
20
|
class Installations < Shared::Installations
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, Installation)
|
25
25
|
end
|
26
26
|
|
@@ -29,22 +29,21 @@ module TcServer
|
|
29
29
|
# A tc Server installation
|
30
30
|
class Installation < Shared::Installation
|
31
31
|
|
32
|
-
#
|
32
|
+
# @return [String[]] the versions of the tc Server runtime that are supported by the installation
|
33
33
|
attr_reader :runtime_versions
|
34
|
+
|
35
|
+
# @return [Templates] the installation's templates
|
36
|
+
attr_reader :templates
|
34
37
|
|
35
|
-
|
38
|
+
# @private
|
39
|
+
def initialize(location, client)
|
36
40
|
super(location, client, InstallationImage, Group)
|
37
41
|
|
38
42
|
@runtime_versions = details["runtime-versions"]
|
39
|
-
@
|
40
|
-
end
|
41
|
-
|
42
|
-
# The installation's templates
|
43
|
-
def templates
|
44
|
-
Templates.new(@templates_location, client)
|
43
|
+
@templates = Templates.new(Util::LinkUtils.get_link_href(details, "templates"), client)
|
45
44
|
end
|
46
45
|
|
47
|
-
#
|
46
|
+
# @return [Instance[]] the instances that are using the installation
|
48
47
|
def instances
|
49
48
|
retrieve_instances("group-instance", Instance);
|
50
49
|
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,30 +12,33 @@
|
|
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 TcServer
|
19
18
|
|
20
19
|
# Used to enumerate, create, and delete tc Server instances.
|
21
20
|
class Instances < Shared::MutableCollection
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, "group-instances", Instance)
|
25
25
|
end
|
26
26
|
|
27
|
-
# Creates a new instance
|
28
|
-
#
|
27
|
+
# Creates a new instance
|
28
|
+
#
|
29
|
+
# @param installation [Installation] the installation to be used by the instance
|
30
|
+
# @param name [String] the name of the instance
|
31
|
+
# @param options [Hash] optional configuration
|
29
32
|
#
|
30
|
-
#
|
33
|
+
# @option options :properties [Hash] configuration properties that customise the instance
|
34
|
+
# @option options :runtime_version [String] the version of the runtime to be used by the
|
35
|
+
# instance. Must be one of the +runtime_versions+ available in the +installation+.
|
36
|
+
# Defaults to the latest version that is available in the installation
|
37
|
+
# @option options :templates [Template[]] the templates to use when creating the instance
|
38
|
+
# @option options :layout [String] the layout to use when creating the instance. Valid
|
39
|
+
# values are +COMBINED+ and +SEPARATE+. Defaults to +SEPARATE+
|
31
40
|
#
|
32
|
-
#
|
33
|
-
# runtime_version:: The version of the runtime to be used by the instance.
|
34
|
-
# Must be one of the runtime_versions available in the Installation.
|
35
|
-
# Defaults to the latest available version.
|
36
|
-
# templates:: An array of templates to use when creating the instance. Each Template
|
37
|
-
# must be present in the Installation.
|
38
|
-
# layout:: The layout to use when creating the instance. Valid values are +COMBINED+
|
39
|
-
# and +SEPARATE+. Defaults to +SEPARATE+.
|
41
|
+
# @return [Instance] the new instance
|
40
42
|
def create(installation, name, options = {})
|
41
43
|
payload = { :installation => installation.location, :name => name }
|
42
44
|
|
@@ -66,19 +68,20 @@ module TcServer
|
|
66
68
|
# A tc Server instance
|
67
69
|
class Instance < Shared::Instance
|
68
70
|
|
69
|
-
#
|
71
|
+
# @return [String] the instance's layout
|
70
72
|
attr_reader :layout
|
71
73
|
|
72
|
-
#
|
74
|
+
# @return [String] the version of runtime used by the instance
|
73
75
|
attr_reader :runtime_version
|
74
76
|
|
75
|
-
#
|
77
|
+
# @return [Hash] the instance's services
|
76
78
|
attr_reader :services
|
77
79
|
|
78
|
-
#
|
80
|
+
# @return [Applications] the instance's applications
|
79
81
|
attr_reader :applications
|
80
82
|
|
81
|
-
|
83
|
+
# @private
|
84
|
+
def initialize(location, client)
|
82
85
|
super(location, client, Group, Installation, LiveConfigurations, PendingConfigurations, NodeInstance, 'node-instance')
|
83
86
|
|
84
87
|
@layout = details["layout"]
|
@@ -88,7 +91,12 @@ module TcServer
|
|
88
91
|
|
89
92
|
end
|
90
93
|
|
91
|
-
# Updates the
|
94
|
+
# Updates the installation and, optionally, the runtime_version used by the instance
|
95
|
+
#
|
96
|
+
# @param installation [Installation] the installation to be used by the instance
|
97
|
+
# @param runtime_version [String] the version of the runtime to be used by the instance
|
98
|
+
#
|
99
|
+
# @return [void]
|
92
100
|
def update(installation, runtime_version = nil)
|
93
101
|
payload = { :installation => installation.location }
|
94
102
|
if (!runtime_version.nil?)
|
@@ -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 TcServer
|
19
18
|
|
20
19
|
# Used to enumerate an instance's live configuration
|
21
20
|
class LiveConfigurations < Shared::Collection
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, "live-configurations", Configuration)
|
25
25
|
end
|
26
26
|
|
data/lib/vas/tc_server/logs.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
|
module TcServer
|
19
18
|
|
@@ -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,41 +12,46 @@
|
|
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 TcServer
|
19
18
|
|
20
|
-
# Used to enumerate a
|
19
|
+
# Used to enumerate a node instance's applications
|
21
20
|
class NodeApplications < Shared::Collection
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, "applications", NodeApplication)
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
28
28
|
|
29
|
-
#
|
29
|
+
# An application on a node instance
|
30
30
|
class NodeApplication < Shared::Resource
|
31
31
|
|
32
|
-
#
|
32
|
+
# @return [String] the application's context path
|
33
33
|
attr_reader :context_path
|
34
34
|
|
35
|
-
#
|
35
|
+
# @return [String] the application's name
|
36
36
|
attr_reader :name
|
37
37
|
|
38
|
-
#
|
38
|
+
# @return [String] the service the application will deploy its revisions to
|
39
39
|
attr_reader :service
|
40
40
|
|
41
|
-
#
|
41
|
+
# @return [String] the host the application will deploy its revisions to
|
42
42
|
attr_reader :host
|
43
43
|
|
44
|
-
#
|
44
|
+
# @return [NodeRevisions] the application's revisions
|
45
45
|
attr_reader :revisions
|
46
46
|
|
47
|
-
#
|
47
|
+
# @return [Application] the application that this node application is a member of
|
48
48
|
attr_reader :group_application
|
49
|
+
|
50
|
+
# @return [NodeInstance] the node instance that contains the application
|
51
|
+
attr_reader :instance
|
49
52
|
|
50
|
-
|
53
|
+
# @private
|
54
|
+
def initialize(location, client)
|
51
55
|
super(location, client)
|
52
56
|
|
53
57
|
@revisions = NodeRevisions.new(Util::LinkUtils.get_link_href(details, "node-revisions"), client)
|
@@ -57,17 +61,13 @@ module TcServer
|
|
57
61
|
@service = details["service"]
|
58
62
|
@host = details["host"]
|
59
63
|
|
60
|
-
@
|
64
|
+
@instance = NodeInstance.new(Util::LinkUtils.get_link_href(details, "node-instance"), client)
|
61
65
|
|
62
66
|
@group_application = Application.new(Util::LinkUtils.get_link_href(details, "group-application"), client)
|
63
67
|
end
|
64
68
|
|
65
|
-
#
|
66
|
-
def
|
67
|
-
NodeInstance.new(@instance_location, client)
|
68
|
-
end
|
69
|
-
|
70
|
-
def to_s #:nodoc:
|
69
|
+
# @return [String] a string representation of the node application
|
70
|
+
def to_s
|
71
71
|
"#<#{self.class} name='#@name' context_path='#@context_path' service='#@service' host='#@host'>"
|
72
72
|
end
|
73
73
|
|
@@ -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 TcServer
|
19
18
|
|
20
19
|
# Used to enumerate tc Server instances on an individual node
|
21
20
|
class NodeInstances < Shared::NodeInstances
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, "node-instances", NodeInstance)
|
25
25
|
end
|
26
26
|
|
@@ -29,19 +29,20 @@ module TcServer
|
|
29
29
|
# A tc Server node instance
|
30
30
|
class NodeInstance < Shared::NodeInstance
|
31
31
|
|
32
|
-
#
|
32
|
+
# @return [String] the instance's layout
|
33
33
|
attr_reader :layout
|
34
34
|
|
35
|
-
#
|
35
|
+
# @return [String] the version of runtime used by the instance
|
36
36
|
attr_reader :runtime_version
|
37
37
|
|
38
|
-
#
|
38
|
+
# @return [Hash] the instance's services
|
39
39
|
attr_reader :services
|
40
40
|
|
41
|
-
#
|
41
|
+
# @return [NodeApplications] the instance's applications
|
42
42
|
attr_reader :applications
|
43
43
|
|
44
|
-
|
44
|
+
# @private
|
45
|
+
def initialize(location, client)
|
45
46
|
super(location, client, Node, Logs, Instance, 'group-instance')
|
46
47
|
|
47
48
|
@layout = details["layout"]
|
@@ -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,32 +12,34 @@
|
|
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 TcServer
|
19
18
|
|
20
|
-
# Used to enumerate
|
19
|
+
# Used to enumerate revisions of a node application
|
21
20
|
class NodeRevisions < Shared::Collection
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, 'revisions', NodeRevision)
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
28
28
|
|
29
|
-
# A revision of a
|
29
|
+
# A revision of a node application
|
30
30
|
class NodeRevision < Shared::StateResource
|
31
31
|
|
32
|
-
#
|
32
|
+
# @return [String] the revision's version
|
33
33
|
attr_reader :version
|
34
34
|
|
35
|
-
#
|
35
|
+
# @return [NodeApplication] the revision's application
|
36
36
|
attr_reader :application
|
37
37
|
|
38
|
-
#
|
38
|
+
# @return [Revision] the group revision that this node revision is a member of
|
39
39
|
attr_reader :group_revision
|
40
40
|
|
41
|
-
|
41
|
+
# @private
|
42
|
+
def initialize(location, client)
|
42
43
|
super(location, client)
|
43
44
|
|
44
45
|
@version = details['version']
|
@@ -46,7 +47,8 @@ module TcServer
|
|
46
47
|
@group_revision = Revision.new(Util::LinkUtils.get_link_href(details, 'group-revision'), client)
|
47
48
|
end
|
48
49
|
|
49
|
-
|
50
|
+
# @return [String] a string representation of the ndoe revision
|
51
|
+
def to_s
|
50
52
|
"#<#{self.class} version='#@version'>"
|
51
53
|
end
|
52
54
|
|
data/lib/vas/tc_server/nodes.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,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 TcServer
|
19
18
|
|
20
19
|
# Used to enumerate tc Server nodes
|
21
20
|
class Nodes < Shared::Collection
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client)
|
24
24
|
super(location, client, "nodes", Node)
|
25
25
|
end
|
26
26
|
|
@@ -29,19 +29,21 @@ module TcServer
|
|
29
29
|
# A tc Server node
|
30
30
|
class Node < Shared::GroupableNode
|
31
31
|
|
32
|
-
#
|
32
|
+
# @return [String] the node's Java home
|
33
33
|
attr_reader :java_home
|
34
|
+
|
35
|
+
# @return [NodeInstances] the node's instances
|
36
|
+
attr_reader :instances
|
34
37
|
|
35
|
-
|
38
|
+
# @private
|
39
|
+
def initialize(location, client)
|
36
40
|
super(location, client, Group)
|
37
41
|
@java_home = details["java-home"]
|
38
|
-
end
|
39
|
-
|
40
|
-
def instances
|
41
42
|
@instances = NodeInstances.new(Util::LinkUtils.get_link_href(details, "node-instances"), client)
|
42
43
|
end
|
43
44
|
|
44
|
-
|
45
|
+
# @return [String] a string representation of the node
|
46
|
+
def to_s
|
45
47
|
"#<#{self.class} host_names='#{host_names}' ip_addresses='#{ip_addresses}' operating_system='#{operating_system}' architecture='#{architecture}' agent_home='#{agent_home}' java_home='#{java_home}' metadata='#{metadata}'>"
|
46
48
|
end
|
47
49
|
|