logworm_client 0.6.1 → 0.6.2
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/CHANGELOG +3 -0
- data/Rakefile +1 -1
- data/lib/logworm_client.rb +19 -2
- data/logworm_client.gemspec +2 -2
- metadata +3 -3
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/lib/logworm_client.rb
CHANGED
@@ -31,15 +31,32 @@ end
|
|
31
31
|
# results_url ==> URL to GET the results for the query
|
32
32
|
# created ==> First creation of the query
|
33
33
|
# updated ==> most recent update of the query and/or its results
|
34
|
+
# expires ==> until that datime, the query won't be rerun against the database
|
34
35
|
# execution_time ==> time in ms to run the query
|
35
36
|
# results ==> array of hashmaps. Each element corresponds to a log entry, with its fields
|
36
37
|
#
|
37
38
|
# raises Logworm::DatabaseException, Logworm::ForbiddenAccessException, Logworm::InvalidQueryException
|
38
39
|
# or just a regular Exception if it cannot find the URL to the logging database
|
39
40
|
###
|
40
|
-
def lw_query(
|
41
|
+
def lw_query(logname, query = {})
|
41
42
|
db = Logworm::DB.from_config_or_die # Establish connection to DB
|
42
43
|
query = Logworm::QueryBuilder.new(query).to_json if query.is_a? Hash # Turn query into proper JSON string
|
43
|
-
query_data = db.query(
|
44
|
+
query_data = db.query(logname, query) # POST to create query
|
44
45
|
db.results(query_data["results_uri"]) # GET from query's results uri
|
45
46
|
end
|
47
|
+
|
48
|
+
###
|
49
|
+
# Returns an array with information about the logging tables in the database
|
50
|
+
# Each element in the array has;
|
51
|
+
# :tablename => The name of the logging table
|
52
|
+
# :url => The URL for POSTing new log entries
|
53
|
+
# :last_write => Datetime of last entry
|
54
|
+
# :rows => Count of entries
|
55
|
+
#
|
56
|
+
# raises Logworm::DatabaseException, Logworm::ForbiddenAccessException, Logworm::InvalidQueryException
|
57
|
+
# or just a regular Exception if it cannot find the URL to the logging database
|
58
|
+
###
|
59
|
+
def lw_list_logs
|
60
|
+
db = Logworm::DB.from_config_or_die # Establish connection to DB
|
61
|
+
db.tables # Call tables command
|
62
|
+
end
|
data/logworm_client.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{logworm_client}
|
5
|
-
s.version = "0.6.
|
5
|
+
s.version = "0.6.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Pomelo, LLC"]
|
9
|
-
s.date = %q{2010-04-
|
9
|
+
s.date = %q{2010-04-23}
|
10
10
|
s.description = %q{logworm client utilities}
|
11
11
|
s.email = %q{schapira@pomelollc.com}
|
12
12
|
s.executables = ["lw-compute", "lw-tail"]
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 0.6.
|
8
|
+
- 2
|
9
|
+
version: 0.6.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Pomelo, LLC
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-23 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|