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
@@ -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,25 +12,32 @@
|
|
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
|
+
# Shared code to be extended by component-specific APIs
|
18
17
|
module Shared
|
19
18
|
|
19
|
+
# @abstract A dynamic collection of items
|
20
20
|
class Collection < Shared::Resource
|
21
21
|
|
22
22
|
private
|
23
|
+
|
23
24
|
attr_reader :entry_class
|
25
|
+
|
26
|
+
public
|
24
27
|
|
25
|
-
|
28
|
+
# @private
|
29
|
+
def initialize(location, client, type, entry_class)
|
26
30
|
super(location, client)
|
27
31
|
@type = type
|
28
32
|
@entry_class = entry_class
|
29
33
|
end
|
30
34
|
|
31
|
-
public
|
32
|
-
|
33
35
|
# Gets the items in the collection from the server. Calls the block once for each item.
|
34
|
-
|
36
|
+
#
|
37
|
+
# @yieldparam item an item in the collection
|
38
|
+
#
|
39
|
+
# @return [void]
|
40
|
+
def each
|
35
41
|
items = client.get(location)[@type]
|
36
42
|
|
37
43
|
if (!items.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,22 +12,27 @@
|
|
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 Shared
|
19
18
|
|
19
|
+
# @abstract A configuration file in an instance
|
20
20
|
class Configuration < Shared::Resource
|
21
21
|
|
22
|
-
#
|
22
|
+
# @return [String] the configuration's path
|
23
23
|
attr_reader :path
|
24
24
|
|
25
|
-
#
|
25
|
+
# @return [Integer] the configuration's size
|
26
26
|
attr_reader :size
|
27
27
|
|
28
28
|
private
|
29
|
+
|
29
30
|
attr_reader :content_location
|
31
|
+
|
32
|
+
public
|
30
33
|
|
31
|
-
|
34
|
+
# @private
|
35
|
+
def initialize(location, client, instance_type, instance_class)
|
32
36
|
super(location, client)
|
33
37
|
|
34
38
|
@path = details["path"]
|
@@ -40,18 +44,22 @@ module Shared
|
|
40
44
|
@instance_class = instance_class
|
41
45
|
end
|
42
46
|
|
43
|
-
public
|
44
47
|
# Retrieves the configuration's content and passes it to the block
|
48
|
+
#
|
49
|
+
# @yield [chunk] a chunk of the configuration's content
|
50
|
+
#
|
51
|
+
# @return [void]
|
45
52
|
def content(&block)
|
46
53
|
client.get_stream(@content_location, &block)
|
47
54
|
end
|
48
55
|
|
49
|
-
#
|
56
|
+
# @return [Instance] the instance that owns the configuration
|
50
57
|
def instance
|
51
58
|
@instance_class.new(@instance_location, client)
|
52
59
|
end
|
53
60
|
|
54
|
-
|
61
|
+
# @return [String] a string representation of the configuration
|
62
|
+
def to_s
|
55
63
|
"#<#{self.class} name='#@path' size=#@size>"
|
56
64
|
end
|
57
65
|
|
data/lib/vas/shared/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,17 +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 Shared
|
19
18
|
|
19
|
+
# @abstract A collection of groups
|
20
20
|
class Groups < MutableCollection
|
21
21
|
|
22
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client, group_class)
|
23
24
|
super(location, client, "groups", group_class)
|
24
25
|
end
|
25
26
|
|
26
|
-
|
27
|
+
public
|
28
|
+
|
29
|
+
# Creates a new group
|
30
|
+
#
|
31
|
+
# @param name [String] the group's name
|
32
|
+
# @param nodes [GroupableNode[]] the group's nodes
|
33
|
+
#
|
34
|
+
# @return [Group] the new group
|
27
35
|
def create(name, nodes)
|
28
36
|
node_locations = []
|
29
37
|
nodes.each { |node| node_locations << node.location }
|
@@ -32,37 +40,47 @@ module Shared
|
|
32
40
|
|
33
41
|
end
|
34
42
|
|
43
|
+
# @abstract A collection of one or more nodes
|
35
44
|
class Group < Shared::Resource
|
36
45
|
|
37
|
-
#
|
46
|
+
# @return [Installations] the group's installations
|
38
47
|
attr_reader :installations
|
39
48
|
|
40
|
-
#
|
49
|
+
# @return [String] the group's name
|
41
50
|
attr_reader :name
|
42
51
|
|
43
|
-
|
52
|
+
# @private
|
53
|
+
def initialize(location, client, nodes_class, installations_class)
|
44
54
|
super(location, client)
|
45
55
|
@name = details["name"]
|
46
56
|
@installations = installations_class.new(Util::LinkUtils.get_link_href(details, "installations"), client)
|
47
57
|
@nodes_class = nodes_class
|
48
58
|
end
|
59
|
+
|
60
|
+
public
|
49
61
|
|
50
|
-
#
|
62
|
+
# @return [GroupableNode[]] the group's nodes
|
51
63
|
def nodes
|
52
64
|
nodes = []
|
53
65
|
Util::LinkUtils.get_link_hrefs(client.get(location), "node").each { |node_location| nodes << @nodes_class.new(node_location, client)}
|
54
66
|
nodes
|
55
67
|
end
|
56
68
|
|
57
|
-
|
69
|
+
# @return [String] a string representation of the group
|
70
|
+
def to_s
|
58
71
|
"#<#{self.class} name='#@name'>"
|
59
72
|
end
|
60
73
|
|
61
74
|
end
|
62
75
|
|
76
|
+
# @abstract A group that supports changes to it membership
|
63
77
|
class MutableGroup < Group
|
64
78
|
|
65
|
-
# Updates the group to contain the given
|
79
|
+
# Updates the group to contain the given nodes
|
80
|
+
#
|
81
|
+
# @param nodes [GroupableNode[]] the group's nodes
|
82
|
+
#
|
83
|
+
# @return [void]
|
66
84
|
def update(nodes)
|
67
85
|
node_locations = []
|
68
86
|
nodes.each { |node| node_locations << node.location }
|
@@ -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,31 +12,42 @@
|
|
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 Shared
|
19
18
|
|
19
|
+
# @abstract A collection of installation images
|
20
20
|
class InstallationImages < MutableCollection
|
21
|
-
|
22
|
-
|
21
|
+
|
22
|
+
# @private
|
23
|
+
def initialize(location, client, installation_image_class)
|
23
24
|
super(location, client, "installation-images", installation_image_class)
|
24
25
|
end
|
25
26
|
|
26
|
-
# Creates an installation image
|
27
|
+
# Creates an installation image by uploading a file to the server and assigning it a version
|
28
|
+
#
|
29
|
+
# @param path the path of the file to upload
|
30
|
+
# @param version [String] the installation image's version
|
31
|
+
#
|
32
|
+
# @return [InstallationImage] the new installation image
|
27
33
|
def create(path, version)
|
28
34
|
entry_class.new(client.post_image(location, path, { :version => version }), client)
|
29
35
|
end
|
30
36
|
|
31
37
|
end
|
32
38
|
|
39
|
+
# @abstract A product binary, typically are .zip or .tar.gz file, that has been uploaded to the
|
40
|
+
# server. Once created, an installation image can then be used to create an installation on a
|
41
|
+
# group.
|
33
42
|
class InstallationImage < Resource
|
34
43
|
|
35
|
-
#
|
44
|
+
# @return [String] the installation image's version
|
36
45
|
attr_reader :version
|
37
46
|
|
38
|
-
#
|
47
|
+
# @return [Integer] the installation image's size
|
39
48
|
attr_reader :size
|
40
49
|
|
50
|
+
# @private
|
41
51
|
def initialize(location, client, installation_class) #:nodoc:
|
42
52
|
super(location, client)
|
43
53
|
@version = details["version"]
|
@@ -45,6 +55,7 @@ module Shared
|
|
45
55
|
@installation_class = installation_class
|
46
56
|
end
|
47
57
|
|
58
|
+
# @return [Installation[]] the installations that have been created from the installation image
|
48
59
|
def installations
|
49
60
|
installations = []
|
50
61
|
Util::LinkUtils.get_link_hrefs(client.get(location), "installation").each { |installation_location|
|
@@ -53,7 +64,8 @@ module Shared
|
|
53
64
|
installations
|
54
65
|
end
|
55
66
|
|
56
|
-
|
67
|
+
# @return [String] a string representation of the installation image
|
68
|
+
def to_s
|
57
69
|
"#<#{self.class} version='#@version'>"
|
58
70
|
end
|
59
71
|
|
@@ -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,34 +12,44 @@
|
|
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 Shared
|
19
18
|
|
19
|
+
# @abstract A collection of installations
|
20
20
|
class Installations < Shared::MutableCollection
|
21
|
-
|
22
|
-
|
21
|
+
|
22
|
+
# @private
|
23
|
+
def initialize(location, client, installation_class)
|
23
24
|
super(location, client, "installations", installation_class)
|
24
25
|
end
|
25
|
-
|
26
|
-
# Creates
|
26
|
+
|
27
|
+
# Creates a new installation
|
28
|
+
#
|
29
|
+
# @param installation_image [InstallationImage] the installation image to use to create the installation
|
30
|
+
#
|
31
|
+
# @return [Installation] the new installation
|
27
32
|
def create(installation_image)
|
28
33
|
entry_class.new(client.post(location, { :image => installation_image.location }, "installation"), client)
|
29
34
|
end
|
30
35
|
|
31
36
|
end
|
32
37
|
|
38
|
+
# @abstract An installation of a middleware component. Created from an installation image. Once created, an
|
39
|
+
# installation is used when creating a new instance and provides the binaries that the instance uses at
|
40
|
+
# runtime
|
33
41
|
class Installation < Shared::Resource
|
34
42
|
|
35
|
-
#
|
43
|
+
# @return [String] the installation's version
|
36
44
|
attr_reader :version
|
37
45
|
|
38
|
-
#
|
46
|
+
# @return [InstallationImage] the installation image that was used to create the installation
|
39
47
|
attr_reader :installation_image
|
40
48
|
|
41
|
-
#
|
49
|
+
# @return [Group] the group that contains the installation
|
42
50
|
attr_reader :group
|
43
|
-
|
51
|
+
|
52
|
+
# @private
|
44
53
|
def initialize(location, client, installation_image_class, group_class) #:nodoc:
|
45
54
|
super(location, client)
|
46
55
|
|
@@ -48,12 +57,14 @@ module Shared
|
|
48
57
|
@installation_image = installation_image_class.new(Util::LinkUtils.get_link_href(details, "installation-image"), client)
|
49
58
|
@group = group_class.new(Util::LinkUtils.get_link_href(details, "group"), client)
|
50
59
|
end
|
51
|
-
|
60
|
+
|
61
|
+
# @return [String] a string representation of the installation
|
52
62
|
def to_s #:nodoc:
|
53
63
|
"#<#{self.class} version='#@version'>"
|
54
64
|
end
|
55
|
-
|
65
|
+
|
56
66
|
private
|
67
|
+
|
57
68
|
def retrieve_instances(instance_rel, instance_class)
|
58
69
|
instances = []
|
59
70
|
Util::LinkUtils.get_link_hrefs(client.get(location), instance_rel).each { |instance_location|
|
@@ -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,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 Shared
|
19
18
|
|
19
|
+
# @abstract A collection of instances
|
20
20
|
class Instance < Shared::StateResource
|
21
21
|
|
22
|
-
#
|
22
|
+
# @return [String] the instance's name
|
23
23
|
attr_reader :name
|
24
24
|
|
25
|
-
#
|
25
|
+
# @return the instance's live configurations
|
26
26
|
attr_reader :live_configurations
|
27
27
|
|
28
|
-
#
|
28
|
+
# @return the instance's pending configurations
|
29
29
|
attr_reader :pending_configurations
|
30
30
|
|
31
|
-
#
|
31
|
+
# @return [Group] the group that contains this instance
|
32
32
|
attr_reader :group
|
33
33
|
|
34
|
-
#
|
35
|
-
attr_reader :node_instances
|
36
|
-
|
34
|
+
# @private
|
37
35
|
def initialize(location, client,
|
38
36
|
group_class,
|
39
37
|
installation_class,
|
@@ -52,12 +50,12 @@ module Shared
|
|
52
50
|
@node_instance_type = node_instance_type
|
53
51
|
end
|
54
52
|
|
55
|
-
#
|
53
|
+
# @return [Installation] the installation that this instance is using
|
56
54
|
def installation
|
57
55
|
@installation_class.new(Util::LinkUtils.get_link_href(client.get(location), 'installation'), client)
|
58
56
|
end
|
59
57
|
|
60
|
-
#
|
58
|
+
# @return [NodeInstance[]] the instance's individual node instances
|
61
59
|
def node_instances
|
62
60
|
node_instances = []
|
63
61
|
Util::LinkUtils.get_link_hrefs(client.get(location), @node_instance_type).each {
|
@@ -65,7 +63,8 @@ module Shared
|
|
65
63
|
node_instances
|
66
64
|
end
|
67
65
|
|
68
|
-
|
66
|
+
# @return [String] a string representation of the instance
|
67
|
+
def to_s
|
69
68
|
"#<#{self.class} name='#@name'>"
|
70
69
|
end
|
71
70
|
|
data/lib/vas/shared/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,29 +12,31 @@
|
|
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 Shared
|
19
18
|
|
20
|
-
#
|
19
|
+
# @abstract A node instance's logs
|
21
20
|
class Logs < Shared::MutableCollection
|
22
21
|
|
23
|
-
|
22
|
+
# @private
|
23
|
+
def initialize(location, client, log_class)
|
24
24
|
super(location, client, 'logs', log_class)
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
28
28
|
|
29
|
-
# A log file in a node instance
|
29
|
+
# abstract A log file in a node instance
|
30
30
|
class Log < Shared::Resource
|
31
31
|
|
32
|
-
#
|
32
|
+
# @return [String] the name of the log
|
33
33
|
attr_reader :name
|
34
34
|
|
35
|
-
#
|
35
|
+
# @return [NodeInstance] the node instance that the log belongs to
|
36
36
|
attr_reader :instance
|
37
|
-
|
38
|
-
|
37
|
+
|
38
|
+
# @private
|
39
|
+
def initialize(location, client, instance_type, instance_class)
|
39
40
|
super(location, client)
|
40
41
|
|
41
42
|
@name = details['name']
|
@@ -43,16 +44,23 @@ module Shared
|
|
43
44
|
@instance = instance_class.new(Util::LinkUtils.get_link_href(details, instance_type), client)
|
44
45
|
end
|
45
46
|
|
46
|
-
#
|
47
|
+
# Retrieve the content of the log
|
48
|
+
#
|
49
|
+
# @param [Hash] options the options that control the content that is returned
|
50
|
+
#
|
51
|
+
# @option options [Integer] :start_line the start point, in lines, of the content to pass to
|
52
|
+
# the block. Omitting the parameter will result in content from the start of the file being
|
53
|
+
# passed. If the provided value is greater than the number of lines in the file, no content
|
54
|
+
# will be passed.
|
55
|
+
#
|
56
|
+
# @option options [Integer] :end_line the end point, in lines, of the content to pass to the
|
57
|
+
# block. Omitting the parameter will result in content up to the end of the file being
|
58
|
+
# passed. If the provided value is greater than the number of lines in the file, content up
|
59
|
+
# to and including the last line in the file will be passed.
|
47
60
|
#
|
48
|
-
#
|
61
|
+
# @yield [chunk] a chunk of the log's content
|
49
62
|
#
|
50
|
-
#
|
51
|
-
# in content from the start of the file being passed. If the provided value is greater than the
|
52
|
-
# number of lines in the file, no content will be passed.
|
53
|
-
# end_line:: The end point, in lines, of the content to pass to the block. Omitting the parameter will result in
|
54
|
-
# content up to the end of the file being passed. If the provided value is greater than the number of
|
55
|
-
# lines in the file, content up to and including the last line in the file will be passed.
|
63
|
+
# @return [void]
|
56
64
|
def content(options = {}, &block)
|
57
65
|
query=""
|
58
66
|
if (!options[:start_line].nil?)
|
@@ -72,18 +80,19 @@ module Shared
|
|
72
80
|
end
|
73
81
|
end
|
74
82
|
|
75
|
-
#
|
83
|
+
# @return [Integer] the size of the log
|
76
84
|
def size
|
77
85
|
client.get(location)['size']
|
78
86
|
end
|
79
87
|
|
80
|
-
#
|
88
|
+
# @return [Integer] the last modified stamp of the log
|
81
89
|
def last_modified
|
82
90
|
client.get(location)['last-modified']
|
83
91
|
end
|
84
92
|
|
85
|
-
|
86
|
-
|
93
|
+
# @return [String] a string representation of the log
|
94
|
+
def to_s
|
95
|
+
"#<#{self.class} name='#@name'>"
|
87
96
|
end
|
88
97
|
end
|
89
98
|
end
|