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,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 a locator instance's live configuration
21
20
  class LocatorLiveConfigurations < Shared::Collection
22
21
 
23
- def initialize(location, client) #:nodoc:
24
- super(location, client, "live-configurations", LocatorConfiguration)
22
+ # @private
23
+ def initialize(location, client)
24
+ super(location, client, "live-configurations", LocatorLiveConfiguration)
25
+ end
26
+
27
+ end
28
+
29
+ # A live configuration file in a locator instance
30
+ class LocatorLiveConfiguration < Shared::Configuration
31
+
32
+ # @private
33
+ def initialize(location, client)
34
+ super(location, client, "locator-group-instance", LocatorInstance)
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 a locator node instance's logs
21
20
  class LocatorLogs < Shared::Logs
22
21
 
23
- def initialize(location, client) #:nodoc:
22
+ # @private
23
+ def initialize(location, client)
24
24
  super(location, client, LocatorLog)
25
25
  end
26
26
 
@@ -29,7 +29,8 @@ module Gemfire
29
29
  # A log file in a locator node instance
30
30
  class LocatorLog < Shared::Log
31
31
 
32
- def initialize(location, client) #:nodoc:
32
+ # @private
33
+ def initialize(location, client)
33
34
  super(location, client, 'locator-node-instance', LocatorNodeInstance)
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 locator instances on an individual node
21
20
  class LocatorNodeInstances < Shared::NodeInstances
22
21
 
23
- def initialize(location, client) #:nodoc:
22
+ # @private
23
+ def initialize(location, client)
24
24
  super(location, client, "locator-node-instances", LocatorNodeInstance)
25
25
  end
26
26
 
@@ -29,21 +29,22 @@ module Gemfire
29
29
  # A locator node instance
30
30
  class LocatorNodeInstance < Shared::NodeInstance
31
31
 
32
+ # @private
32
33
  def initialize(location, client) #:nodoc:
33
34
  super(location, client, Node, LocatorLogs, LocatorInstance, 'locator-group-instance')
34
35
  end
35
36
 
36
- # The port that the locator will listen on
37
+ # @return [Integer] the port that the locator will listen on
37
38
  def port
38
39
  client.get(location)['port']
39
40
  end
40
41
 
41
- # +true+ if the locator will act as a peer, +false+ if it will not
42
+ # @return [Boolean] +true+ if the locator will act as a peer, +false+ if it will not
42
43
  def peer
43
44
  client.get(location)['peer']
44
45
  end
45
46
 
46
- # +true+ if the locator will act as a server, +false+ if it will not
47
+ # @return [Boolean] +true+ if the locator will act as a server, +false+ if it will not
47
48
  def server
48
49
  client.get(location)['server']
49
50
  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,23 +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 a locator instance's pending configuration
21
20
  class LocatorPendingConfigurations < Shared::PendingConfigurations
22
21
 
23
- def initialize(location, client) #:nodoc:
22
+ # @private
23
+ def initialize(location, client)
24
24
  super(location, client, 'pending-configurations', LocatorPendingConfiguration)
25
25
  end
26
26
 
27
27
  end
28
28
 
29
- # A configuration file that is pending
29
+ # A locator configuration file that is pending
30
30
  class LocatorPendingConfiguration < Shared::PendingConfiguration
31
31
 
32
- def initialize(location, client) #:nodoc:
32
+ # @private
33
+ def initialize(location, client)
33
34
  super(location, client, 'locator-group-instance', LocatorInstance)
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 GemFire 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,30 +29,29 @@ module Gemfire
29
29
  # A GemFire 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 [AgentNodeInstances] the node's agent instances
36
+ attr_reader :agent_instances
37
+
38
+ # @return [CacheServerInstances] the node's cache server instances
39
+ attr_reader :cache_server_instances
40
+
41
+ # @return [LocatorNodeInstances] the node's locator instances
42
+ attr_reader :locator_instances
34
43
 
35
- def initialize(location, client) #:nodoc:
44
+ # @private
45
+ def initialize(location, client)
36
46
  super(location, client, Group)
37
47
  @java_home = details["java-home"]
48
+ @agent_instances = AgentNodeInstances.new(Util::LinkUtils.get_link_href(details, "agent-node-instances"), client)
49
+ @cache_server_instances = CacheServerNodeInstances.new(Util::LinkUtils.get_link_href(details, "cache-server-node-instances"), client)
50
+ @locator_instances = LocatorNodeInstances.new(Util::LinkUtils.get_link_href(details, "locator-node-instances"), client)
38
51
  end
39
52
 
40
- # The node's agent instances
41
- def agent_instances
42
- @instances = AgentNodeInstances.new(Util::LinkUtils.get_link_href(details, "agent-node-instances"), client)
43
- end
44
-
45
- # The node's cache server instances
46
- def cache_server_instances
47
- @instances = CacheServerNodeInstances.new(Util::LinkUtils.get_link_href(details, "cache-server-node-instances"), client)
48
- end
49
-
50
- # The node's locator instances
51
- def locator_instances
52
- @instances = LocatorNodeInstances.new(Util::LinkUtils.get_link_href(details, "locator-node-instances"), client)
53
- end
54
-
55
- def to_s #:nodoc:
53
+ # @return [String] a string representation of the node
54
+ def to_s
56
55
  "#<#{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}'>"
57
56
  end
58
57
 
@@ -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,23 @@
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 a cache server's pending application code.
21
20
  class PendingApplicationCodes < Shared::MutableCollection
22
21
 
23
- def initialize(location, client) #:nodoc:
22
+ # @private
23
+ def initialize(location, client)
24
24
  super(location, client, "pending-application-code", ApplicationCode)
25
25
  end
26
26
 
27
- # Creates pending application code from the +image+
27
+ # Creates a new pending application code
28
+ #
29
+ # @param image [ApplicationCodeImage] the image to create the application code from
30
+ #
31
+ # @return [ApplicationCode] the new application code
28
32
  def create(image)
29
33
  ApplicationCode.new(client.post(location, { :image => image.location}), client)
30
34
  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,13 +12,14 @@
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 and delete a cache server's statistics.
21
20
  class Statistics < Shared::MutableCollection
22
21
 
22
+ # @private
23
23
  def initialize(location, client)
24
24
  super(location, client, 'statistics', Statistic)
25
25
  end
@@ -29,34 +29,42 @@ module Gemfire
29
29
  # A statistic of a cache server
30
30
  class Statistic < Shared::Resource
31
31
 
32
- # The last modified time of the disk store
33
- attr_reader :last_modified
34
-
35
- # The path of statistic
32
+ # @return [String] the path of statistic
36
33
  attr_reader :path
37
34
 
38
- # The size of the statistic
39
- attr_reader :size
40
-
41
- # The statistic's cache server node instance
35
+ # @return [CacheServerNodeInstance] The statistic's cache server node instance
42
36
  attr_reader :instance
43
37
 
38
+ # @private
44
39
  def initialize(location, client)
45
40
  super(location, client)
46
41
 
47
- @last_modified = details['last-modified']
48
42
  @path = details['path']
49
- @size = details['size']
50
43
 
51
44
  @instance = CacheServerNodeInstance.new(Util::LinkUtils.get_link_href(details, 'cache-server-node-instance'), client)
52
45
  @content_location = Util::LinkUtils.get_link_href(details, 'content')
53
46
  end
47
+
48
+ # @return [Integer] the size of the statistic
49
+ def size
50
+ client.get(location)['size']
51
+ end
52
+
53
+ # @return [Integer] the last modified stamp of the statistic
54
+ def last_modified
55
+ client.get(location)['last-modified']
56
+ end
54
57
 
55
- # Retrieves the statistic's content and passes it to the +block+
58
+ # Retrieves the statistic's content
59
+ #
60
+ # @yield [chunk] a chunk of the statistic's content
61
+ #
62
+ # @return [void]
56
63
  def content(&block)
57
64
  client.get_stream(@content_location, &block)
58
65
  end
59
66
 
67
+ # @return [String] a string representation of the statistic
60
68
  def to_s
61
69
  "#<#{self.class} path='#@path'>"
62
70
  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,26 +12,28 @@
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 RabbitMq
19
18
 
20
- # Used to enumerate, create, and delete Rabbit groups.
19
+ # Used to enumerate, create, and delete RabbitMQ 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
 
27
27
  end
28
28
 
29
- # A Rabbit group
29
+ # A RabbitMQ group
30
30
  class Group < Shared::Group
31
31
 
32
- # The group's instances
32
+ # @return [Instances] the group's instances
33
33
  attr_reader :instances
34
34
 
35
- def initialize(location, client) #:nodoc:#
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,23 +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 RabbitMq
19
18
 
20
- # Used to enumerate, create, and delete Rabbit installation images.
19
+ # Used to enumerate, create, and delete RabbitMQ 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
 
27
27
  end
28
28
 
29
- # A Rabbit installation image
29
+ # A RabbitMQ 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,27 +12,29 @@
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 RabbitMq
19
18
 
20
- # Used to enumerate, create, and delete Rabbit installations.
19
+ # Used to enumerate, create, and delete RabbitMQ 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
 
27
27
  end
28
28
 
29
- # A Rabbit installation
29
+ # A RabbitMQ installation
30
30
  class Installation < Shared::Installation
31
31
 
32
- def initialize(location, client) #:nodoc:
32
+ # @private
33
+ def initialize(location, client)
33
34
  super(location, client, InstallationImage, Group)
34
35
  end
35
36
 
36
- # An array of the instances that are using the installation
37
+ # @return [Instance[]] the instances that are using the installation
37
38
  def instances
38
39
  retrieve_instances("group-instance", Instance);
39
40
  end