vas 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
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,21 +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 VFabric
19
18
 
19
+ # Provides access to the installation image for the vFabric Administration Agent
20
20
  class AgentImage < Shared::Resource
21
21
 
22
- def initialize(location, client) #:nodoc:
22
+ # @private
23
+ def initialize(location, client)
23
24
  super(location, client)
24
25
  @content_location = Util::LinkUtils.get_link_href(details, "content")
25
26
  end
26
27
 
28
+ # Retrieves the content of the agent installation image (a zip file) from the server
29
+ #
30
+ # @yield [chunk] a chunk of the agent image's content
31
+ #
32
+ # @return [void]
27
33
  def content(&block)
28
34
  client.get_stream(@content_location, &block)
29
35
  end
30
36
 
37
+ # Downloads and extracts the agent installation image
38
+ #
39
+ # @param location [String] the location to extract the agent to
40
+ #
41
+ # @return [void]
31
42
  def extract_to(location = '.')
32
43
  agent_image = Tempfile.open('agent-image.zip') { |temp_file|
33
44
  content { |chunk| temp_file << chunk }
@@ -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,39 @@
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 VFabric
19
18
 
20
- # Used to enumerate VFabric nodes. Support for enumeration is provided by the superclass, Shared::Nodes.
21
- class Nodes < Shared::Collection
19
+ # Used to enumerate VFabric nodes
20
+ class Nodes < Shared::MutableCollection
22
21
 
22
+ # @private
23
23
  def initialize(location, client)
24
24
  super(location, client, 'nodes', Node)
25
25
  end
26
26
 
27
27
  end
28
28
 
29
- # Deletes the Node
30
- def delete(entry)
31
- client.delete(entry.location)
29
+ # Deletes the node
30
+ #
31
+ # @param node [Node] the node to delete
32
+ #
33
+ # @return [void]
34
+ def delete(node)
35
+ client.delete(node.location)
32
36
  end
33
37
 
34
38
  # A VFabric node
35
39
  class Node < Shared::Node
36
-
37
- def initialize(location, client) #:nodoc:
40
+
41
+ # @private
42
+ def initialize(location, client)
38
43
  super(location, client)
39
44
  end
40
45
 
41
- def to_s #:nodoc:
46
+ # @return [String] a string representation of the node
47
+ def to_s
42
48
  "#<#{self.class} host_names='#{host_names}' ip_addresses='#{ip_addresses}' operating_system='#{operating_system}' architecture='#{architecture}' agent_home='#{agent_home}' metadata='#{metadata}'>"
43
49
  end
44
50
 
@@ -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,17 +12,21 @@
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
- #++
17
15
 
16
+ # API for general purpose vFabric administration
18
17
  module VFabric
19
18
 
19
+ # The entry point of the vFabric API
20
20
  class VFabric < Shared::Resource
21
21
 
22
+ # @return [Nodes] the nodes that are known to the server
22
23
  attr_reader :nodes
23
24
 
25
+ # @return [AgentImage] the installation image for the vFabric Administration agent
24
26
  attr_reader :agent_image
25
27
 
26
- def initialize(location, client) #:nodoc:
28
+ # @private
29
+ def initialize(location, client)
27
30
  json = client.get(location)
28
31
  @nodes = Nodes.new(Util::LinkUtils.get_link_href(json, "nodes"), client)
29
32
  @agent_image = AgentImage.new(Util::LinkUtils.get_link_href(json, "agent-image"), client)
@@ -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,28 +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
  # The main entry point to the vFabric Administration Server API.
19
18
  class VFabricAdministrationServer
20
19
 
21
- # The GemFire API
20
+ # @return [Gemfire::Gemfire] the GemFire API
22
21
  attr_reader :gemfire
23
22
 
24
- # The Rabbit API
23
+ # @return [RabbitMq::RabbitMq] the RabbitMQ API
25
24
  attr_reader :rabbitmq
26
25
 
27
- # The tc Server API
26
+ # @return [TcServer::TcServer] the tc Server API
28
27
  attr_reader :tc_server
29
28
 
30
- # The vFabric API
29
+ # @return [VFabric::VFabric] the vFabric API
31
30
  attr_reader :vfabric
32
31
 
33
- # Creates an entry point that will connect to a vFabric Administration Server. Supported configuration options are:
34
- # host:: The host of the Administration Server. Defaults to localhost.
35
- # port:: The HTTPS port of the Administration Server. Defaults to 8443.
36
- # username:: The username used to authenticate. Defaults to admin
37
- # password:: The password used to authenticate. Defaults to vmware
32
+ # Creates an entry point that will connect to a vFabric Administration Server.
33
+ # @param [Hash] configuration the connection configuration
34
+ # @option configuration [String] :username ('admin') The username to use to authenticate with the server
35
+ # @option configuration [String] :password ('vmware') The password to use to authenticate with the server
36
+ # @option configuration [String] :host ('localhost') The host of the server
37
+ # @option configuration [Integer] :port (8443) The HTTPS port of the server
38
38
  def initialize(configuration = {})
39
39
  @client = Util::Client.new(configuration[:username] || "admin", configuration[:password] || "vmware")
40
40
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-23 00:00:00.000000000 Z
12
+ date: 2012-09-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
21
  version: 1.7.3
22
22
  type: :runtime
@@ -24,7 +24,7 @@ dependencies:
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.7.3
30
30
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
37
  version: 1.1.5
38
38
  type: :runtime
@@ -40,7 +40,7 @@ dependencies:
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
45
  version: 1.1.5
46
46
  - !ruby/object:Gem::Dependency
@@ -48,7 +48,7 @@ dependencies:
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ! '>='
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
53
  version: 0.9.9
54
54
  type: :runtime
@@ -56,7 +56,7 @@ dependencies:
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ! '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.9.9
62
62
  - !ruby/object:Gem::Dependency
@@ -64,7 +64,7 @@ dependencies:
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ! '>='
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
69
  version: 0.6.4
70
70
  type: :development
@@ -72,7 +72,7 @@ dependencies:
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ! '>='
75
+ - - ~>
76
76
  - !ruby/object:Gem::Version
77
77
  version: 0.6.4
78
78
  - !ruby/object:Gem::Dependency
@@ -80,7 +80,7 @@ dependencies:
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
- - - ! '>='
83
+ - - ~>
84
84
  - !ruby/object:Gem::Version
85
85
  version: 1.3.0
86
86
  type: :development
@@ -88,7 +88,7 @@ dependencies:
88
88
  version_requirements: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
- - - ! '>='
91
+ - - ~>
92
92
  - !ruby/object:Gem::Version
93
93
  version: 1.3.0
94
94
  description: A Ruby API for VMware vFabric Administration Server
@@ -104,7 +104,6 @@ files:
104
104
  - NOTICE
105
105
  - README.md
106
106
  - Rakefile
107
- - lib/vas/gemfire/agent_configuration.rb
108
107
  - lib/vas/gemfire/agent_instances.rb
109
108
  - lib/vas/gemfire/agent_live_configurations.rb
110
109
  - lib/vas/gemfire/agent_logs.rb
@@ -112,7 +111,6 @@ files:
112
111
  - lib/vas/gemfire/agent_pending_configurations.rb
113
112
  - lib/vas/gemfire/application_code.rb
114
113
  - lib/vas/gemfire/application_code_images.rb
115
- - lib/vas/gemfire/cache_server_configuration.rb
116
114
  - lib/vas/gemfire/cache_server_instances.rb
117
115
  - lib/vas/gemfire/cache_server_live_configurations.rb
118
116
  - lib/vas/gemfire/cache_server_logs.rb
@@ -124,7 +122,6 @@ files:
124
122
  - lib/vas/gemfire/installation_images.rb
125
123
  - lib/vas/gemfire/installations.rb
126
124
  - lib/vas/gemfire/live_application_codes.rb
127
- - lib/vas/gemfire/locator_configuration.rb
128
125
  - lib/vas/gemfire/locator_instances.rb
129
126
  - lib/vas/gemfire/locator_live_configurations.rb
130
127
  - lib/vas/gemfire/locator_logs.rb
@@ -133,7 +130,6 @@ files:
133
130
  - lib/vas/gemfire/nodes.rb
134
131
  - lib/vas/gemfire/pending_application_codes.rb
135
132
  - lib/vas/gemfire/statistics.rb
136
- - lib/vas/rabbitmq/configuration.rb
137
133
  - lib/vas/rabbitmq/groups.rb
138
134
  - lib/vas/rabbitmq/installation_images.rb
139
135
  - lib/vas/rabbitmq/installations.rb
@@ -151,7 +147,7 @@ files:
151
147
  - lib/vas/shared/groups.rb
152
148
  - lib/vas/shared/installation_images.rb
153
149
  - lib/vas/shared/installations.rb
154
- - lib/vas/shared/instances.rb
150
+ - lib/vas/shared/instance.rb
155
151
  - lib/vas/shared/logs.rb
156
152
  - lib/vas/shared/mutable_collection.rb
157
153
  - lib/vas/shared/node_instances.rb
@@ -1,28 +0,0 @@
1
- #--
2
- # vFabric Administration Server Ruby API
3
- # Copyright (c) 2012 VMware, Inc. All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
- #++
17
-
18
- module Gemfire
19
-
20
- # A configuration file in an agent instance
21
- class AgentConfiguration < Shared::Configuration
22
-
23
- def initialize(location, client) #:nodoc:
24
- super(location, client, "agent-group-instance", AgentInstance)
25
- end
26
-
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- #--
2
- # vFabric Administration Server Ruby API
3
- # Copyright (c) 2012 VMware, Inc. All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
- #++
17
-
18
- module Gemfire
19
-
20
- # A configuration file in a cache server instance
21
- class CacheServerConfiguration < Shared::Configuration
22
-
23
- def initialize(location, client) #:nodoc:
24
- super(location, client, "cache-server-group-instance", CacheServerInstance)
25
- end
26
-
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- #--
2
- # vFabric Administration Server Ruby API
3
- # Copyright (c) 2012 VMware, Inc. All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
- #++
17
-
18
- module Gemfire
19
-
20
- # A configuration file in a locator instance
21
- class LocatorConfiguration < Shared::Configuration
22
-
23
- def initialize(location, client) #:nodoc:
24
- super(location, client, "locator-group-instance", LocatorInstance)
25
- end
26
-
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- #--
2
- # vFabric Administration Server Ruby API
3
- # Copyright (c) 2012 VMware, Inc. All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
- #++
17
-
18
- module RabbitMq
19
-
20
- # A configuration file in a Rabbit instance
21
- class Configuration < Shared::Configuration
22
-
23
- def initialize(location, client) #:nodoc:
24
- super(location, client, "group-instance", Instance)
25
- end
26
-
27
- end
28
- end