vas 0.4.0 → 1.0.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 +1 -1
- data/lib/vas.rb +44 -1
- data/lib/vas/gemfire/agent_instances.rb +4 -3
- data/lib/vas/gemfire/agent_live_configurations.rb +3 -3
- data/lib/vas/gemfire/agent_node_instances.rb +2 -2
- data/lib/vas/gemfire/agent_node_live_configurations.rb +39 -0
- data/lib/vas/gemfire/application_code.rb +13 -12
- data/lib/vas/gemfire/application_code_images.rb +13 -11
- data/lib/vas/gemfire/cache_server_instances.rb +20 -12
- data/lib/vas/gemfire/cache_server_live_configurations.rb +3 -3
- data/lib/vas/gemfire/cache_server_node_instances.rb +16 -9
- data/lib/vas/gemfire/cache_server_node_live_configurations.rb +39 -0
- data/lib/vas/gemfire/disk_stores.rb +19 -11
- data/lib/vas/gemfire/gemfire.rb +4 -4
- data/lib/vas/gemfire/groups.rb +17 -10
- data/lib/vas/gemfire/installations.rb +12 -3
- data/lib/vas/gemfire/live_application_codes.rb +2 -2
- data/lib/vas/gemfire/locator_instances.rb +23 -13
- data/lib/vas/gemfire/locator_live_configurations.rb +3 -3
- data/lib/vas/gemfire/locator_node_instances.rb +22 -14
- data/lib/vas/gemfire/locator_node_live_configurations.rb +39 -0
- data/lib/vas/gemfire/nodes.rb +27 -6
- data/lib/vas/gemfire/pending_application_codes.rb +7 -2
- data/lib/vas/gemfire/statistics.rb +18 -11
- data/lib/vas/rabbitmq/groups.rb +6 -4
- data/lib/vas/rabbitmq/installations.rb +14 -6
- data/lib/vas/rabbitmq/instances.rb +9 -6
- data/lib/vas/rabbitmq/live_configurations.rb +3 -3
- data/lib/vas/rabbitmq/node_instances.rb +2 -2
- data/lib/vas/rabbitmq/node_live_configurations.rb +39 -0
- data/lib/vas/rabbitmq/nodes.rb +11 -8
- data/lib/vas/rabbitmq/plugin_images.rb +14 -7
- data/lib/vas/rabbitmq/plugins.rb +29 -20
- data/lib/vas/rabbitmq/rabbitmq.rb +4 -4
- data/lib/vas/shared/collection.rb +34 -11
- data/lib/vas/shared/configuration.rb +16 -9
- data/lib/vas/shared/deletable.rb +34 -0
- data/lib/vas/shared/groups.rb +26 -15
- data/lib/vas/shared/installation_images.rb +18 -10
- data/lib/vas/shared/installations.rb +22 -22
- data/lib/vas/shared/instance.rb +40 -19
- data/lib/vas/shared/live_configuration.rb +42 -0
- data/lib/vas/shared/logs.rb +27 -14
- data/lib/vas/shared/mutable_collection.rb +13 -5
- data/lib/vas/shared/node_configuration.rb +74 -0
- data/lib/vas/shared/node_instances.rb +32 -14
- data/lib/vas/shared/nodes.rb +37 -14
- data/lib/vas/shared/{pending_configuration.rb → pending_configurations.rb} +4 -2
- data/lib/vas/shared/resource.rb +12 -2
- data/lib/vas/shared/security.rb +11 -4
- data/lib/vas/shared/state_resource.rb +1 -1
- data/lib/vas/sqlfire/agent_instances.rb +98 -0
- data/lib/vas/sqlfire/agent_live_configurations.rb +39 -0
- data/lib/vas/sqlfire/agent_logs.rb +39 -0
- data/lib/vas/sqlfire/agent_node_instances.rb +54 -0
- data/lib/vas/sqlfire/agent_node_live_configurations.rb +39 -0
- data/lib/vas/sqlfire/agent_pending_configurations.rb +39 -0
- data/lib/vas/sqlfire/groups.rb +58 -0
- data/lib/vas/sqlfire/installation_images.rb +39 -0
- data/lib/vas/sqlfire/installations.rb +61 -0
- data/lib/vas/sqlfire/locator_instances.rb +210 -0
- data/lib/vas/sqlfire/locator_live_configurations.rb +39 -0
- data/lib/vas/sqlfire/locator_logs.rb +39 -0
- data/lib/vas/sqlfire/locator_node_instances.rb +91 -0
- data/lib/vas/sqlfire/locator_node_live_configurations.rb +39 -0
- data/lib/vas/sqlfire/locator_pending_configurations.rb +39 -0
- data/lib/vas/sqlfire/nodes.rb +73 -0
- data/lib/vas/sqlfire/server_instances.rb +192 -0
- data/lib/vas/sqlfire/server_live_configurations.rb +39 -0
- data/lib/vas/sqlfire/server_logs.rb +39 -0
- data/lib/vas/sqlfire/server_node_instances.rb +86 -0
- data/lib/vas/sqlfire/server_node_live_configurations.rb +39 -0
- data/lib/vas/sqlfire/server_pending_configurations.rb +39 -0
- data/lib/vas/sqlfire/sqlfire.rb +44 -0
- data/lib/vas/tc_server/applications.rb +32 -21
- data/lib/vas/tc_server/configuration.rb +1 -1
- data/lib/vas/tc_server/groups.rb +7 -4
- data/lib/vas/tc_server/installations.rb +16 -6
- data/lib/vas/tc_server/instances.rb +25 -13
- data/lib/vas/tc_server/live_configurations.rb +11 -1
- data/lib/vas/tc_server/logs.rb +4 -2
- data/lib/vas/tc_server/node_applications.rb +21 -17
- data/lib/vas/tc_server/node_instances.rb +23 -9
- data/lib/vas/tc_server/node_live_configurations.rb +39 -0
- data/lib/vas/tc_server/node_revisions.rb +15 -10
- data/lib/vas/tc_server/nodes.rb +15 -8
- data/lib/vas/tc_server/revision_images.rb +16 -10
- data/lib/vas/tc_server/revisions.rb +20 -16
- data/lib/vas/tc_server/tc_server.rb +5 -5
- data/lib/vas/tc_server/template_images.rb +13 -7
- data/lib/vas/tc_server/templates.rb +21 -13
- data/lib/vas/util/client.rb +15 -6
- data/lib/vas/vfabric/agent_image.rb +1 -1
- data/lib/vas/vfabric/nodes.rb +4 -11
- data/lib/vas/vfabric/v_fabric.rb +2 -2
- data/lib/vas/vfabric_administration_server.rb +37 -6
- data/lib/vas/web_server/configuration.rb +29 -0
- data/lib/vas/web_server/groups.rb +44 -0
- data/lib/vas/web_server/installation_images.rb +54 -0
- data/lib/vas/web_server/installations.rb +52 -0
- data/lib/vas/web_server/instances.rb +65 -0
- data/lib/vas/web_server/live_configurations.rb +39 -0
- data/lib/vas/web_server/logs.rb +37 -0
- data/lib/vas/web_server/node_instances.rb +39 -0
- data/lib/vas/web_server/node_live_configurations.rb +39 -0
- data/lib/vas/web_server/nodes.rb +53 -0
- data/lib/vas/web_server/pending_configurations.rb +39 -0
- data/lib/vas/web_server/web_server.rb +43 -0
- metadata +137 -76
|
@@ -47,7 +47,7 @@ module TcServer
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
if options.has_key?(:runtime_version)
|
|
50
|
-
payload[
|
|
50
|
+
payload['runtime-version'] = options[:runtime_version]
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
if options.has_key?(:templates)
|
|
@@ -59,8 +59,8 @@ module TcServer
|
|
|
59
59
|
if options.has_key?(:layout)
|
|
60
60
|
payload[:layout] = options[:layout]
|
|
61
61
|
end
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
|
|
63
|
+
super(payload, 'group-instance')
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
end
|
|
@@ -77,21 +77,27 @@ module TcServer
|
|
|
77
77
|
# @return [Hash] the instance's services
|
|
78
78
|
attr_reader :services
|
|
79
79
|
|
|
80
|
-
# @return [Applications] the instance's applications
|
|
81
|
-
attr_reader :applications
|
|
82
|
-
|
|
83
80
|
# @private
|
|
84
81
|
def initialize(location, client)
|
|
85
82
|
super(location, client, Group, Installation, LiveConfigurations, PendingConfigurations, NodeInstance, 'node-instance')
|
|
86
83
|
|
|
87
|
-
@layout = details[
|
|
88
|
-
|
|
89
|
-
@services = details["services"]
|
|
90
|
-
@applications = Applications.new(Util::LinkUtils.get_link_href(details, "group-applications"), client)
|
|
84
|
+
@layout = details['layout']
|
|
85
|
+
end
|
|
91
86
|
|
|
87
|
+
# Reloads the instance's details from the server
|
|
88
|
+
# @return [void]
|
|
89
|
+
def reload
|
|
90
|
+
super
|
|
91
|
+
@runtime_version = details['runtime-version']
|
|
92
|
+
@services = details['services']
|
|
92
93
|
end
|
|
93
94
|
|
|
94
|
-
#
|
|
95
|
+
# @return [Applications] the instance's applications
|
|
96
|
+
def applications
|
|
97
|
+
@applications ||= Applications.new(Util::LinkUtils.get_link_href(details, 'group-applications'), client)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Updates the installation and, optionally, the +runtime_version+ used by the instance
|
|
95
101
|
#
|
|
96
102
|
# @param installation [Installation] the installation to be used by the instance
|
|
97
103
|
# @param runtime_version [String] the version of the runtime to be used by the instance
|
|
@@ -99,10 +105,16 @@ module TcServer
|
|
|
99
105
|
# @return [void]
|
|
100
106
|
def update(installation, runtime_version = nil)
|
|
101
107
|
payload = { :installation => installation.location }
|
|
102
|
-
if
|
|
108
|
+
if runtime_version
|
|
103
109
|
payload['runtime-version'] = runtime_version
|
|
104
110
|
end
|
|
105
|
-
client.post(location, payload)
|
|
111
|
+
client.post(location, payload)
|
|
112
|
+
reload
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# @return [String] a string representation of the instance
|
|
116
|
+
def to_s
|
|
117
|
+
"#<#{self.class} name='#{name}' layout='#@layout' runtime_version='#@runtime_version' services='#@services'>"
|
|
106
118
|
end
|
|
107
119
|
|
|
108
120
|
end
|
|
@@ -21,7 +21,17 @@ module TcServer
|
|
|
21
21
|
|
|
22
22
|
# @private
|
|
23
23
|
def initialize(location, client)
|
|
24
|
-
super(location, client,
|
|
24
|
+
super(location, client, 'live-configurations', LiveConfiguration)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# A live configuration file in a tc Server instance
|
|
30
|
+
class LiveConfiguration < Shared::LiveConfiguration
|
|
31
|
+
|
|
32
|
+
# @private
|
|
33
|
+
def initialize(location, client)
|
|
34
|
+
super(location, client, 'group-instance', Instance, NodeLiveConfiguration)
|
|
25
35
|
end
|
|
26
36
|
|
|
27
37
|
end
|
data/lib/vas/tc_server/logs.rb
CHANGED
|
@@ -19,7 +19,8 @@ module TcServer
|
|
|
19
19
|
# Used to enumerate a tc Server node instance's logs
|
|
20
20
|
class Logs < Shared::Logs
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
# @private
|
|
23
|
+
def initialize(location, client)
|
|
23
24
|
super(location, client, Log)
|
|
24
25
|
end
|
|
25
26
|
|
|
@@ -28,7 +29,8 @@ module TcServer
|
|
|
28
29
|
# A log file in a tc Server node instance
|
|
29
30
|
class Log < Shared::Log
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
# @private
|
|
33
|
+
def initialize(location, client)
|
|
32
34
|
super(location, client, 'node-instance', NodeInstance)
|
|
33
35
|
end
|
|
34
36
|
|
|
@@ -21,7 +21,7 @@ module TcServer
|
|
|
21
21
|
|
|
22
22
|
# @private
|
|
23
23
|
def initialize(location, client)
|
|
24
|
-
super(location, client,
|
|
24
|
+
super(location, client, 'applications', NodeApplication)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
end
|
|
@@ -41,29 +41,33 @@ module TcServer
|
|
|
41
41
|
# @return [String] the host the application will deploy its revisions to
|
|
42
42
|
attr_reader :host
|
|
43
43
|
|
|
44
|
-
# @return [NodeRevisions] the application's revisions
|
|
45
|
-
attr_reader :revisions
|
|
46
|
-
|
|
47
|
-
# @return [Application] the application that this node application is a member of
|
|
48
|
-
attr_reader :group_application
|
|
49
|
-
|
|
50
|
-
# @return [NodeInstance] the node instance that contains the application
|
|
51
|
-
attr_reader :instance
|
|
52
|
-
|
|
53
44
|
# @private
|
|
54
45
|
def initialize(location, client)
|
|
55
46
|
super(location, client)
|
|
56
47
|
|
|
57
|
-
@
|
|
48
|
+
@group_application_location = Util::LinkUtils.get_link_href(details, 'group-application')
|
|
49
|
+
@instance_location = Util::LinkUtils.get_link_href(details, 'node-instance')
|
|
50
|
+
@revisions_location = Util::LinkUtils.get_link_href(details, 'node-revisions')
|
|
51
|
+
|
|
52
|
+
@context_path = details['context-path']
|
|
53
|
+
@name = details['name']
|
|
54
|
+
@service = details['service']
|
|
55
|
+
@host = details['host']
|
|
56
|
+
end
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@
|
|
62
|
-
|
|
58
|
+
# @return [NodeInstance] the node instance that contains the application
|
|
59
|
+
def instance
|
|
60
|
+
@instance ||= NodeInstance.new(@instance_location, client)
|
|
61
|
+
end
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
# @return [Application] the application that this node application is a member of
|
|
64
|
+
def group_application
|
|
65
|
+
@group_application ||= Application.new(@group_application_location, client)
|
|
66
|
+
end
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
# @return [NodeRevisions] the application's revisions
|
|
69
|
+
def revisions
|
|
70
|
+
@revisions ||= NodeRevisions.new(@revisions_location, client)
|
|
67
71
|
end
|
|
68
72
|
|
|
69
73
|
# @return [String] a string representation of the node application
|
|
@@ -21,7 +21,7 @@ module TcServer
|
|
|
21
21
|
|
|
22
22
|
# @private
|
|
23
23
|
def initialize(location, client)
|
|
24
|
-
super(location, client,
|
|
24
|
+
super(location, client, 'node-instances', NodeInstance)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
end
|
|
@@ -38,17 +38,31 @@ module TcServer
|
|
|
38
38
|
# @return [Hash] the instance's services
|
|
39
39
|
attr_reader :services
|
|
40
40
|
|
|
41
|
-
# @return [NodeApplications] the instance's applications
|
|
42
|
-
attr_reader :applications
|
|
43
|
-
|
|
44
41
|
# @private
|
|
45
42
|
def initialize(location, client)
|
|
46
|
-
super(location, client, Node, Logs, Instance, 'group-instance')
|
|
43
|
+
super(location, client, Node, Logs, Instance, 'group-instance', NodeLiveConfigurations)
|
|
44
|
+
|
|
45
|
+
@layout = details['layout']
|
|
46
|
+
|
|
47
|
+
@applications_location = Util::LinkUtils.get_link_href(details, 'node-applications')
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Reloads the instance's details from the server
|
|
51
|
+
# @return [void]
|
|
52
|
+
def reload
|
|
53
|
+
super
|
|
54
|
+
@runtime_version = details['runtime-version']
|
|
55
|
+
@services = details['services']
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# @return [NodeApplications] the instance's applications
|
|
59
|
+
def applications
|
|
60
|
+
@applications ||= NodeApplications.new(@applications_location, client)
|
|
61
|
+
end
|
|
47
62
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
@applications = NodeApplications.new(Util::LinkUtils.get_link_href(details, "node-applications"), client)
|
|
63
|
+
# @return [String] a string representation of the instance
|
|
64
|
+
def to_s
|
|
65
|
+
"#<#{self.class} name='#{name}' layout='#@layout' runtime_version='#@runtime_version' services='#@services'>"
|
|
52
66
|
end
|
|
53
67
|
|
|
54
68
|
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# vFabric Administration Server Ruby API
|
|
2
|
+
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
module TcServer
|
|
18
|
+
|
|
19
|
+
# Used to enumerate a node instance's live configuration
|
|
20
|
+
class NodeLiveConfigurations < Shared::Collection
|
|
21
|
+
|
|
22
|
+
# @private
|
|
23
|
+
def initialize(location, client)
|
|
24
|
+
super(location, client, 'node-live-configurations', NodeLiveConfiguration)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# A live configuration file in a node instance
|
|
30
|
+
class NodeLiveConfiguration < Shared::NodeConfiguration
|
|
31
|
+
|
|
32
|
+
# @private
|
|
33
|
+
def initialize(location, client)
|
|
34
|
+
super(location, client, 'node-instance', NodeInstance, LiveConfiguration)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
@@ -32,22 +32,27 @@ module TcServer
|
|
|
32
32
|
# @return [String] the revision's version
|
|
33
33
|
attr_reader :version
|
|
34
34
|
|
|
35
|
-
# @return [NodeApplication] the revision's application
|
|
36
|
-
attr_reader :application
|
|
37
|
-
|
|
38
|
-
# @return [Revision] the group revision that this node revision is a member of
|
|
39
|
-
attr_reader :group_revision
|
|
40
|
-
|
|
41
35
|
# @private
|
|
42
36
|
def initialize(location, client)
|
|
43
37
|
super(location, client)
|
|
44
|
-
|
|
38
|
+
|
|
39
|
+
@application_location = Util::LinkUtils.get_link_href(details, 'node-application')
|
|
40
|
+
@group_revision_location = Util::LinkUtils.get_link_href(details, 'group-revision')
|
|
41
|
+
|
|
45
42
|
@version = details['version']
|
|
46
|
-
@application = NodeApplication.new(Util::LinkUtils.get_link_href(details, 'node-application'), client)
|
|
47
|
-
@group_revision = Revision.new(Util::LinkUtils.get_link_href(details, 'group-revision'), client)
|
|
48
43
|
end
|
|
49
44
|
|
|
50
|
-
# @return [
|
|
45
|
+
# @return [NodeApplication] the revision's application
|
|
46
|
+
def application
|
|
47
|
+
@application ||= NodeApplication.new(@application_location, client)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# @return [Revision] the group revision that this node revision is a member of
|
|
51
|
+
def group_revision
|
|
52
|
+
@group_revision ||= Revision.new(@group_revision_location, client)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# @return [String] a string representation of the node revision
|
|
51
56
|
def to_s
|
|
52
57
|
"#<#{self.class} version='#@version'>"
|
|
53
58
|
end
|
data/lib/vas/tc_server/nodes.rb
CHANGED
|
@@ -21,7 +21,7 @@ module TcServer
|
|
|
21
21
|
|
|
22
22
|
# @private
|
|
23
23
|
def initialize(location, client)
|
|
24
|
-
super(location, client,
|
|
24
|
+
super(location, client, 'nodes', Node)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
end
|
|
@@ -31,20 +31,27 @@ module TcServer
|
|
|
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
|
|
37
34
|
|
|
38
35
|
# @private
|
|
39
36
|
def initialize(location, client)
|
|
40
37
|
super(location, client, Group)
|
|
41
|
-
@
|
|
42
|
-
|
|
38
|
+
@instance_location = Util::LinkUtils.get_link_href(details, 'node-instances')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Reloads the node's details from the server
|
|
42
|
+
def reload
|
|
43
|
+
super
|
|
44
|
+
@java_home = details['java-home']
|
|
43
45
|
end
|
|
44
|
-
|
|
46
|
+
|
|
47
|
+
# @return [NodeInstances] the node's instances
|
|
48
|
+
def instances
|
|
49
|
+
@instances ||= NodeInstances.new(@instance_location, client)
|
|
50
|
+
end
|
|
51
|
+
|
|
45
52
|
# @return [String] a string representation of the node
|
|
46
53
|
def to_s
|
|
47
|
-
"#<#{self.class} host_names='#{host_names}' ip_addresses='#{ip_addresses}' operating_system='#{operating_system}' architecture='#{architecture}' agent_home='#{agent_home}' java_home='
|
|
54
|
+
"#<#{self.class} host_names='#{host_names}' ip_addresses='#{ip_addresses}' ipv4_addresses='#{ipv4_addresses}' ipv6_addresses='#{ipv6_addresses}' operating_system='#{operating_system}' architecture='#{architecture}' agent_home='#{agent_home}' java_home='#@java_home' metadata='#{metadata}'>"
|
|
48
55
|
end
|
|
49
56
|
|
|
50
57
|
end
|
|
@@ -21,9 +21,9 @@ module TcServer
|
|
|
21
21
|
|
|
22
22
|
# @private
|
|
23
23
|
def initialize(location, client)
|
|
24
|
-
super(location, client,
|
|
24
|
+
super(location, client, 'revision-images', RevisionImage)
|
|
25
25
|
end
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
# Creates a new revision image by uploading a war file to the server
|
|
28
28
|
#
|
|
29
29
|
# @param path [String] the path of the WAR file
|
|
@@ -32,14 +32,16 @@ module TcServer
|
|
|
32
32
|
#
|
|
33
33
|
# @return [RevisionImage] the new revision image
|
|
34
34
|
def create(path, name, version)
|
|
35
|
-
|
|
35
|
+
create_image(path, {:name => name, :version => version})
|
|
36
36
|
end
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
end
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
# A revision image, i.e. a WAR file
|
|
41
41
|
class RevisionImage < Shared::Resource
|
|
42
42
|
|
|
43
|
+
include Shared::Deletable
|
|
44
|
+
|
|
43
45
|
# @return [String] the revision image's name
|
|
44
46
|
attr_reader :name
|
|
45
47
|
|
|
@@ -53,16 +55,20 @@ module TcServer
|
|
|
53
55
|
def initialize(location, client)
|
|
54
56
|
super(location, client)
|
|
55
57
|
|
|
56
|
-
@name = details[
|
|
57
|
-
@version = details[
|
|
58
|
+
@name = details['name']
|
|
59
|
+
@version = details['version']
|
|
58
60
|
@size = details['size']
|
|
59
61
|
end
|
|
60
62
|
|
|
63
|
+
# Reloads the revision image's details from the server
|
|
64
|
+
def reload
|
|
65
|
+
super
|
|
66
|
+
@revisions = nil
|
|
67
|
+
end
|
|
68
|
+
|
|
61
69
|
# @return [Revision[]] the revisions that have been created from this revision image
|
|
62
70
|
def revisions
|
|
63
|
-
revisions
|
|
64
|
-
Util::LinkUtils.get_link_hrefs(client.get(location), "group-revision").each { |revision_location| revisions << Revision.new(revision_location, client)}
|
|
65
|
-
revisions
|
|
71
|
+
@revisions ||= create_resources_from_links('group-revision', Revision)
|
|
66
72
|
end
|
|
67
73
|
|
|
68
74
|
# @return [String] a string representation of the revision image
|
|
@@ -30,7 +30,7 @@ module TcServer
|
|
|
30
30
|
#
|
|
31
31
|
# @return [Revision] the new revision
|
|
32
32
|
def create(revision_image)
|
|
33
|
-
|
|
33
|
+
super({ :image => revision_image.location}, 'group-revision')
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
end
|
|
@@ -38,32 +38,36 @@ module TcServer
|
|
|
38
38
|
# A revision of an application
|
|
39
39
|
class Revision < Shared::StateResource
|
|
40
40
|
|
|
41
|
+
include Shared::Deletable
|
|
42
|
+
|
|
41
43
|
# @return [String] the revision's version
|
|
42
44
|
attr_reader :version
|
|
43
45
|
|
|
44
|
-
# @return [Application] the revision's application
|
|
45
|
-
attr_reader :application
|
|
46
|
-
|
|
47
|
-
# @return [RevisionImage] the revision image, if any, that was used to create the revision
|
|
48
|
-
attr_reader :revision_image
|
|
49
|
-
|
|
50
46
|
# @private
|
|
51
47
|
def initialize(location, client)
|
|
52
48
|
super(location, client)
|
|
53
|
-
|
|
49
|
+
|
|
54
50
|
@version = details['version']
|
|
55
|
-
@
|
|
56
|
-
|
|
57
|
-
revision_image_location = Util::LinkUtils.get_link_href(details, 'revision-image')
|
|
58
|
-
@revision_image = RevisionImage.new(revision_image_location, client) unless revision_image_location.nil?
|
|
51
|
+
@application_location = Util::LinkUtils.get_link_href(details, 'group-application')
|
|
52
|
+
@revision_image_location = Util::LinkUtils.get_link_href(details, 'revision-image')
|
|
59
53
|
end
|
|
60
54
|
|
|
61
55
|
# @return [NodeRevision[]] the revision's node revisions
|
|
62
56
|
def node_revisions
|
|
63
|
-
node_revisions
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
@node_revisions ||= create_resources_from_links('node-revision', NodeRevision)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# @return [Application] the revision's application
|
|
61
|
+
def application
|
|
62
|
+
@application ||= Application.new(@application_location, client)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# @return [RevisionImage] the revision image, if any, that was used to create the revision
|
|
66
|
+
def revision_image
|
|
67
|
+
if @revision_image.nil?
|
|
68
|
+
@revision_image = RevisionImage.new(@revision_image_location, client) unless @revision_image_location.nil?
|
|
69
|
+
end
|
|
70
|
+
@revision_image
|
|
67
71
|
end
|
|
68
72
|
|
|
69
73
|
# @return [String] a string representation of the revision
|