sumologic 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +28 -5
- data/VERSION.txt +1 -1
- data/lib/sumologic.rb +12 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89824830264cfc582da4b12ecb4ae688a900d4f9
|
4
|
+
data.tar.gz: 3a78e2068ab11032c75978eba13f852a6dac904d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb00229fdb5b102dce45befff491272756127f143cc9314db45a578be3295896a0915266c10028b9c29cad921683b5798cfdf6ce4d8ad9bc253bd906050749f9
|
7
|
+
data.tar.gz: ba80931227bc17d7aa8642337ff5d69b1139a0893516d33a1e6ef050fd33be864905006c192ea489c33438f275b3ee106d618d940ac26a3eda8b4fa429f24c59
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,22 +1,45 @@
|
|
1
1
|
Sumo Logic Ruby SDK
|
2
2
|
===================
|
3
3
|
|
4
|
+
[](http://badge.fury.io/rb/sumologic)
|
4
5
|
[](https://travis-ci.org/grokify/sumologic-sdk-ruby)
|
5
6
|
[](https://codeclimate.com/github/grokify/sumologic-sdk-ruby)
|
7
|
+
[](http://www.rubydoc.info/gems/sumologic/)
|
6
8
|
[](https://raw.githubusercontent.com/grokify/sumologic-sdk-ruby/master/LICENSE.txt)
|
7
9
|
|
8
10
|
Ruby interface to the Sumo Logic REST API.
|
9
11
|
|
10
|
-
Please add your scripts and programs to the `scripts` folder.
|
11
|
-
|
12
12
|
## Usage
|
13
13
|
|
14
|
-
The interface for this SDK is still being built out
|
14
|
+
The interface for this SDK is still being built out to follow the structure in the
|
15
15
|
[Sumo Logic Python SDK](https://github.com/SumoLogic/sumologic-python-sdk).
|
16
16
|
|
17
|
-
|
17
|
+
The following methods are currently implemented:
|
18
|
+
|
19
|
+
* `search(query [, from, to, time_zone])`
|
20
|
+
* `search_job(query [, from, to, time_zone])`
|
21
|
+
* `search_job_records({'id' => search_job_id}, limit, offset)`
|
22
|
+
* `search_job_status( {'id' => search_job_id})`
|
23
|
+
|
24
|
+
Note, for the search methods, the query parameter can be exactly the same query that is entered into the Sumo Logic web console.
|
25
|
+
|
26
|
+
Example scripts are located in the `scripts` directory of the [GitHub repo](https://github.com/grokify/sumologic-sdk-ruby).
|
18
27
|
|
19
28
|
## More Info
|
20
29
|
|
21
30
|
1. [Sumo Logic API Documentation](https://github.com/SumoLogic/sumo-api-doc/wiki)
|
22
|
-
2. [Sumo Logic Python SDK](https://github.com/SumoLogic/sumologic-python-sdk)
|
31
|
+
2. [Sumo Logic Python SDK](https://github.com/SumoLogic/sumologic-python-sdk)
|
32
|
+
|
33
|
+
## Contributions
|
34
|
+
|
35
|
+
Please add your scripts and programs to the `scripts` folder.
|
36
|
+
|
37
|
+
Any reports of problems, comments or suggestions are most welcome.
|
38
|
+
|
39
|
+
Please report these on [Github](https://github.com/grokify/sumologic-sdk-ruby)
|
40
|
+
|
41
|
+
## License
|
42
|
+
|
43
|
+
RingCentral SDK is available under an MIT-style license. See {file:LICENSE.txt} for details.
|
44
|
+
|
45
|
+
RingCentral SDK © 2015 by John Wang
|
data/VERSION.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/sumologic.rb
CHANGED
@@ -9,12 +9,12 @@ module SumoLogic
|
|
9
9
|
|
10
10
|
class Client
|
11
11
|
|
12
|
-
def initialize(
|
12
|
+
def initialize(access_id=nil, access_key=nil, endpoint=SumoLogic::URL)
|
13
13
|
@endpoint = endpoint
|
14
14
|
@session = Faraday
|
15
15
|
headers = {'Content-Type' => 'application/json', 'Accept' => 'application/json'}
|
16
16
|
@session = Faraday.new(:url => @endpoint, :headers => headers) do |conn|
|
17
|
-
conn.basic_auth(
|
17
|
+
conn.basic_auth(access_id, access_key)
|
18
18
|
conn.use :cookie_jar
|
19
19
|
conn.request :json
|
20
20
|
conn.response :json, :content_type => 'application/json'
|
@@ -22,8 +22,16 @@ module SumoLogic
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
params = {:
|
25
|
+
def search(query, from_time=nil, to_time=nil, time_zone='UTC')
|
26
|
+
params = {:q => query, :from => from_time, :to => to_time, :tz => time_zone}
|
27
|
+
r = @session.get do |req|
|
28
|
+
req.url 'logs/search'
|
29
|
+
req.params = params
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def search_job(query, from_time=nil, to_time=nil, time_zone='UTC')
|
34
|
+
params = {:query => query, :from => from_time, :to => to_time, :timeZone => time_zone}
|
27
35
|
r = @session.post do |req|
|
28
36
|
req.url 'search/jobs'
|
29
37
|
req.body = MultiJson.encode(params)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sumologic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|