influxdb-api 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: f0e2208d19896cd4f3845daad7257e5532ca4cfd
4
- data.tar.gz: 7d22c8d5097873862de14b516777add3d7492da8
3
+ metadata.gz: b75a2d9451bb4769cdeb997320a0f13ab86e2720
4
+ data.tar.gz: 64a82894fa549ac9e121efa329fd2cf46e102660
5
5
  SHA512:
6
- metadata.gz: c34a6269df801cff5bf9b337584b4f7f70a83f6547e468f233679da6a84e479a854be9eb4eec06579ab822ce1501b2c6c52933e4ab4de2cf4539f04f0a0f0ec8
7
- data.tar.gz: b488bff8326ac3902939e39826a45c4f4e469ec121769b937966ddf5811266068d379a7fd66d2d687f763ef301ca27be70e5e332ed7bf87d4e1daed485e156df
6
+ metadata.gz: b941d094565812ef1300f2220fcf3bf4984ab223b3c5f09dc06623d35711afa4d25cf93b3cdd4bc321d43d05b7749180430760dbbd2b8c2baed06bd66042d4eb
7
+ data.tar.gz: 15e64056ba5e997146f3f31d0a3689ab9cc5b039c9d70298a4e904f1cf3bd32532c82b5d36f00e225ffe5915cc17f6093573e028ec9767bece7013dfc61cc515
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby client for InfluxDB
2
2
 
3
- [![Build Status](https://travis-ci.org/undr/influxdb-api.svg?branch=master)](https://travis-ci.org/undr/influxdb-api) [![Code Climate](https://codeclimate.com/github/undr/influxdb-api/badges/gpa.svg)](https://codeclimate.com/github/undr/influxdb-api)
3
+ [![Build Status](https://travis-ci.org/undr/influxdb-api.svg?branch=master)](https://travis-ci.org/undr/influxdb-api) [![Code Climate](https://codeclimate.com/github/undr/influxdb-api/badges/gpa.svg)](https://codeclimate.com/github/undr/influxdb-api) [![Gem Version](https://badge.fury.io/rb/influxdb-api.svg)](http://badge.fury.io/rb/influxdb-api)
4
4
 
5
5
  ## Installation
6
6
 
@@ -141,8 +141,9 @@ database.continuous_queries.create('select MEAN(user) as user_mean from cpu grou
141
141
  database.continuous_queries.delete(1)
142
142
  # => true
143
143
 
144
- # I haven't tested these methods yet. They aren't implemented on my influxdb server.
145
144
  database.shard_spaces.all
145
+ # => [{"name"=>"default", "database"=>"influxdb_api", "regex"=>"/.*/", "retentionPolicy"=>"inf", "shardDuration"=>"7d", "replicationFactor"=>1, "split"=>1},
146
+ # {"name"=>"default", "database"=>"influxdb_ruby", "regex"=>"/.*/", "retentionPolicy"=>"inf", "shardDuration"=>"7d", "replicationFactor"=>1, "split"=>1}]
146
147
  database.shard_spaces.create(attrs)
147
148
  database.shard_spaces.update('spacename', attrs)
148
149
  database.shard_spaces.delete('spacename')
@@ -157,7 +158,16 @@ client.cluster_admins.delete('username')
157
158
  # => true
158
159
 
159
160
  client.servers.all
160
- # => [{"id"=>1, "protobufConnectString"=>"undr.local:8099"}]
161
+ # => [{"id"=>1,
162
+ # "isLeader"=>true,
163
+ # "isUp"=>false,
164
+ # "leaderRaftConnectString"=>"http://undr.local:8090",
165
+ # "leaderRaftName"=>"97f5a3f53052a5a7",
166
+ # "protobufConnectString"=>"undr.local:8099",
167
+ # "raftConnectionString"=>"http://undr.local:8090",
168
+ # "raftName"=>"97f5a3f53052a5a7",
169
+ # "state"=>4,
170
+ # "stateName"=>"Potential"}]
161
171
  client.servers.delete(1)
162
172
  # => true
163
173
 
@@ -172,19 +182,19 @@ client.shards.delete(1)
172
182
  # => true
173
183
 
174
184
  v = client.version
175
- # => "InfluxDB v0.7.3 (git: 216a3eb) (leveldb: 1.15)"
176
- v > '0.7.6'
185
+ # => "InfluxDB v0.8.3 (git: fbf9a474055051c64e947f2a071388ee009a08d5) (leveldb: 1.15)"
186
+ v > '0.8.6'
177
187
  # => false
178
- v > '0.7'
188
+ v > '0.8'
179
189
  # => true
180
190
  v.major
181
191
  # => 0
182
192
  v.minor
183
- # => 7
193
+ # => 8
184
194
  v.patch
185
195
  # => 3
186
196
  v.git
187
- # => "216a3eb"
197
+ # => "fbf9a474055051c64e947f2a071388ee009a08d5"
188
198
  v.engine
189
199
  # "leveldb: 1.15.0"
190
200
  v.engine.major
@@ -7,7 +7,9 @@ module Influxdb
7
7
  undef_method(:create) if method_defined?(:create)
8
8
 
9
9
  def all
10
- raw_execute('list series').map{|s| s['name']}
10
+ raw_execute('SELECT * FROM /.*/ LIMIT 1').map{|s| s['name']}
11
+ rescue Client::Errors::BadRequest => e
12
+ []
11
13
  end
12
14
 
13
15
  def write(*series)
@@ -1,5 +1,5 @@
1
1
  module Influxdb
2
2
  module Api
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
@@ -14,7 +14,7 @@ describe Influxdb::Api::Namespaces::Series do
14
14
  }]) }
15
15
 
16
16
  before do
17
- stub_request(:get, 'http://root:root@localhost:8086/db/dbname/series?q=list%20series').
17
+ stub_request(:get, 'http://root:root@localhost:8086/db/dbname/series?q=SELECT%20*%20FROM%20/.*/%20LIMIT%201').
18
18
  to_return(status: 200, body: response, headers: { 'Content-Type' => 'application/json' })
19
19
  end
20
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxdb-api
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
  - undr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-01 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday