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.
Files changed (84) hide show
  1. data/README.md +25 -5
  2. data/lib/vas.rb +2 -7
  3. data/lib/vas/gemfire/agent_instances.rb +16 -6
  4. data/lib/vas/gemfire/agent_live_configurations.rb +14 -4
  5. data/lib/vas/gemfire/agent_logs.rb +5 -4
  6. data/lib/vas/gemfire/agent_node_instances.rb +5 -4
  7. data/lib/vas/gemfire/agent_pending_configurations.rb +5 -4
  8. data/lib/vas/gemfire/application_code.rb +7 -6
  9. data/lib/vas/gemfire/application_code_images.rb +19 -11
  10. data/lib/vas/gemfire/cache_server_instances.rb +18 -8
  11. data/lib/vas/gemfire/cache_server_live_configurations.rb +14 -4
  12. data/lib/vas/gemfire/cache_server_logs.rb +5 -4
  13. data/lib/vas/gemfire/cache_server_node_instances.rb +7 -6
  14. data/lib/vas/gemfire/cache_server_pending_configurations.rb +6 -5
  15. data/lib/vas/gemfire/disk_stores.rb +23 -13
  16. data/lib/vas/gemfire/gemfire.rb +8 -7
  17. data/lib/vas/gemfire/groups.rb +9 -8
  18. data/lib/vas/gemfire/installation_images.rb +5 -4
  19. data/lib/vas/gemfire/installations.rb +11 -10
  20. data/lib/vas/gemfire/live_application_codes.rb +3 -3
  21. data/lib/vas/gemfire/locator_instances.rb +25 -20
  22. data/lib/vas/gemfire/locator_live_configurations.rb +14 -4
  23. data/lib/vas/gemfire/locator_logs.rb +5 -4
  24. data/lib/vas/gemfire/locator_node_instances.rb +7 -6
  25. data/lib/vas/gemfire/locator_pending_configurations.rb +6 -5
  26. data/lib/vas/gemfire/nodes.rb +20 -21
  27. data/lib/vas/gemfire/pending_application_codes.rb +8 -4
  28. data/lib/vas/gemfire/statistics.rb +21 -13
  29. data/lib/vas/rabbitmq/groups.rb +8 -7
  30. data/lib/vas/rabbitmq/installation_images.rb +7 -6
  31. data/lib/vas/rabbitmq/installations.rb +8 -7
  32. data/lib/vas/rabbitmq/instances.rb +20 -10
  33. data/lib/vas/rabbitmq/live_configurations.rb +15 -5
  34. data/lib/vas/rabbitmq/logs.rb +7 -6
  35. data/lib/vas/rabbitmq/node_instances.rb +7 -6
  36. data/lib/vas/rabbitmq/nodes.rb +13 -15
  37. data/lib/vas/rabbitmq/pending_configurations.rb +7 -6
  38. data/lib/vas/rabbitmq/plugin_images.rb +14 -8
  39. data/lib/vas/rabbitmq/plugins.rb +24 -23
  40. data/lib/vas/rabbitmq/rabbitmq.rb +10 -7
  41. data/lib/vas/shared/collection.rb +12 -6
  42. data/lib/vas/shared/configuration.rb +16 -8
  43. data/lib/vas/shared/groups.rb +28 -10
  44. data/lib/vas/shared/installation_images.rb +20 -8
  45. data/lib/vas/shared/installations.rb +23 -12
  46. data/lib/vas/shared/{instances.rb → instance.rb} +11 -12
  47. data/lib/vas/shared/logs.rb +30 -21
  48. data/lib/vas/shared/mutable_collection.rb +5 -3
  49. data/lib/vas/shared/node_instances.rb +12 -7
  50. data/lib/vas/shared/nodes.rb +14 -12
  51. data/lib/vas/shared/pending_configuration.rb +12 -5
  52. data/lib/vas/shared/resource.rb +10 -6
  53. data/lib/vas/shared/security.rb +15 -11
  54. data/lib/vas/shared/state_resource.rb +12 -6
  55. data/lib/vas/tc_server/applications.rb +24 -21
  56. data/lib/vas/tc_server/configuration.rb +3 -3
  57. data/lib/vas/tc_server/groups.rb +7 -6
  58. data/lib/vas/tc_server/installation_images.rb +5 -4
  59. data/lib/vas/tc_server/installations.rb +11 -12
  60. data/lib/vas/tc_server/instances.rb +28 -20
  61. data/lib/vas/tc_server/live_configurations.rb +3 -3
  62. data/lib/vas/tc_server/logs.rb +1 -2
  63. data/lib/vas/tc_server/node_applications.rb +19 -19
  64. data/lib/vas/tc_server/node_instances.rb +9 -8
  65. data/lib/vas/tc_server/node_revisions.rb +12 -10
  66. data/lib/vas/tc_server/nodes.rb +11 -9
  67. data/lib/vas/tc_server/pending_configurations.rb +5 -4
  68. data/lib/vas/tc_server/revision_images.rb +19 -11
  69. data/lib/vas/tc_server/revisions.rb +22 -18
  70. data/lib/vas/tc_server/tc_server.rb +9 -8
  71. data/lib/vas/tc_server/template_images.rb +19 -11
  72. data/lib/vas/tc_server/templates.rb +19 -17
  73. data/lib/vas/util/client.rb +4 -3
  74. data/lib/vas/util/link_utils.rb +4 -3
  75. data/lib/vas/vas_exception.rb +6 -6
  76. data/lib/vas/vfabric/agent_image.rb +14 -3
  77. data/lib/vas/vfabric/nodes.rb +16 -10
  78. data/lib/vas/vfabric/v_fabric.rb +6 -3
  79. data/lib/vas/vfabric_administration_server.rb +11 -11
  80. metadata +13 -17
  81. data/lib/vas/gemfire/agent_configuration.rb +0 -28
  82. data/lib/vas/gemfire/cache_server_configuration.rb +0 -28
  83. data/lib/vas/gemfire/locator_configuration.rb +0 -28
  84. data/lib/vas/rabbitmq/configuration.rb +0 -28
@@ -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
- def initialize(location, client) #:nodoc:#
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
- def initialize(location, client) #:nodoc:#
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
- def initialize(location, client) #:nodoc:
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
- def initialize(location, client) #:nodoc:
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
- def initialize(location, client) #:nodoc:
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
- # The versions of the tc Server runtime that are supported by the installation
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
- def initialize(location, client) #:nodoc:
38
+ # @private
39
+ def initialize(location, client)
36
40
  super(location, client, InstallationImage, Group)
37
41
 
38
42
  @runtime_versions = details["runtime-versions"]
39
- @templates_location = Util::LinkUtils.get_link_href(details, "templates")
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
- # An array of the instances that are using the installation
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
- def initialize(location, client) #:nodoc:
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 named +name+, using the Installation +installation+.
28
- # Creation can be customized using +options+.
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
- # Recognized options are:
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
- # properties:: A hash of properties
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
- # The instance's layout
71
+ # @return [String] the instance's layout
70
72
  attr_reader :layout
71
73
 
72
- # The version of runtime used by the instance
74
+ # @return [String] the version of runtime used by the instance
73
75
  attr_reader :runtime_version
74
76
 
75
- # The instance's services
77
+ # @return [Hash] the instance's services
76
78
  attr_reader :services
77
79
 
78
- # The instance's Applications
80
+ # @return [Applications] the instance's applications
79
81
  attr_reader :applications
80
82
 
81
- def initialize(location, client) #:nodoc:
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 instance to use the given +installation+ and, optionally, to use the given +runtime_version+
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
- def initialize(location, client) #:nodoc:
22
+ # @private
23
+ def initialize(location, client)
24
24
  super(location, client, "live-configurations", Configuration)
25
25
  end
26
26
 
@@ -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 NodeInstance's NodeApplication s
19
+ # Used to enumerate a node instance's applications
21
20
  class NodeApplications < Shared::Collection
22
21
 
23
- def initialize(location, client) #:nodoc:
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
- # A node application
29
+ # An application on a node instance
30
30
  class NodeApplication < Shared::Resource
31
31
 
32
- # The application's context path
32
+ # @return [String] the application's context path
33
33
  attr_reader :context_path
34
34
 
35
- # The application's name
35
+ # @return [String] the application's name
36
36
  attr_reader :name
37
37
 
38
- # The service the application will deploy its revisions to
38
+ # @return [String] the service the application will deploy its revisions to
39
39
  attr_reader :service
40
40
 
41
- # The host the application will deploy its revisions to
41
+ # @return [String] the host the application will deploy its revisions to
42
42
  attr_reader :host
43
43
 
44
- # The application's NodeRevisions
44
+ # @return [NodeRevisions] the application's revisions
45
45
  attr_reader :revisions
46
46
 
47
- # The Application that this node application is a member of
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
- def initialize(location, client) #:nodoc:
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
- @instance_location = Util::LinkUtils.get_link_href(details, "node-instance")
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
- # The node instance that contains the application
66
- def instance
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
- def initialize(location, client) #:nodoc:
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
- # The instance's layout
32
+ # @return [String] the instance's layout
33
33
  attr_reader :layout
34
34
 
35
- # The version of runtime used by the instance
35
+ # @return [String] the version of runtime used by the instance
36
36
  attr_reader :runtime_version
37
37
 
38
- # The instance's services
38
+ # @return [Hash] the instance's services
39
39
  attr_reader :services
40
40
 
41
- # The instance's NodeApplications
41
+ # @return [NodeApplications] the instance's applications
42
42
  attr_reader :applications
43
43
 
44
- def initialize(location, client) #:nodoc:
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 Node Revision s
19
+ # Used to enumerate revisions of a node application
21
20
  class NodeRevisions < Shared::Collection
22
21
 
23
- def initialize(location, client) #:nodoc:
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 NodeApplication
29
+ # A revision of a node application
30
30
  class NodeRevision < Shared::StateResource
31
31
 
32
- # The Revision's version
32
+ # @return [String] the revision's version
33
33
  attr_reader :version
34
34
 
35
- # The Revision's application
35
+ # @return [NodeApplication] the revision's application
36
36
  attr_reader :application
37
37
 
38
- # The revision's group revision
38
+ # @return [Revision] the group revision that this node revision is a member of
39
39
  attr_reader :group_revision
40
40
 
41
- def initialize(location, client) #:nodoc:
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
- def to_s #:nodoc:
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
 
@@ -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
- def initialize(location, client) #:nodoc:
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
- # The Node's Java home
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
- def initialize(location, client) #:nodoc:
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
- def to_s #:nodoc:
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