sumologic 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92212eafe916379768f0265df90b6999adb2ea5b
4
- data.tar.gz: 62a4e2331c09cd0c46bc40fd25e9adb771241057
3
+ metadata.gz: 89824830264cfc582da4b12ecb4ae688a900d4f9
4
+ data.tar.gz: 3a78e2068ab11032c75978eba13f852a6dac904d
5
5
  SHA512:
6
- metadata.gz: 91d18df5f138d52177cb2ff5170cc3cbfa96700e6cebda30b20feb9dda373f67f47a947f0ac1a4313adf9e1f7da6d5dd8eb03ecaff20bf9b32f116e9fa91d8e1
7
- data.tar.gz: 6dd094607a5e5c5954f029a7824c4e28a0db2c8bf6d2ef75cc9afb661252973fd89e77939e6daec90885f835d84cb2878ebdba79cb060f6db82c52e21a0a1696
6
+ metadata.gz: fb00229fdb5b102dce45befff491272756127f143cc9314db45a578be3295896a0915266c10028b9c29cad921683b5798cfdf6ce4d8ad9bc253bd906050749f9
7
+ data.tar.gz: ba80931227bc17d7aa8642337ff5d69b1139a0893516d33a1e6ef050fd33be864905006c192ea489c33438f275b3ee106d618d940ac26a3eda8b4fa429f24c59
@@ -1,4 +1,6 @@
1
1
  CHANGELOG
2
2
  ---------
3
+ - **2015-07-11**: 0.0.2
4
+ - Add search() method
3
5
  - **2015-06-09**: 0.0.1
4
6
  - Initial commit
data/README.md CHANGED
@@ -1,22 +1,45 @@
1
1
  Sumo Logic Ruby SDK
2
2
  ===================
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/sumologic.svg)](http://badge.fury.io/rb/sumologic)
4
5
  [![Build Status](https://img.shields.io/travis/grokify/sumologic-sdk-ruby/master.svg)](https://travis-ci.org/grokify/sumologic-sdk-ruby)
5
6
  [![Code Climate](https://codeclimate.com/github/grokify/sumologic-sdk-ruby/badges/gpa.svg)](https://codeclimate.com/github/grokify/sumologic-sdk-ruby)
7
+ [![Docs](https://img.shields.io/badge/docs-rubydoc-blue.svg)](http://www.rubydoc.info/gems/sumologic/)
6
8
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](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 but follows the structure in the
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
- Exampe scripts are located in the `scripts` director of the GitHub repo.
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
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -9,12 +9,12 @@ module SumoLogic
9
9
 
10
10
  class Client
11
11
 
12
- def initialize(accessId=nil, accessKey=nil, endpoint=SumoLogic::URL)
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(accessId, accessKey)
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 search_job(query, fromTime=nil, toTime=nil, timeZone='UTC')
26
- params = {:query => query, :from => fromTime, :to => toTime, :timeZone => timeZone}
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.1
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-06-09 00:00:00.000000000 Z
11
+ date: 2015-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday