influxdb 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/influxdb/client.rb +4 -0
- data/lib/influxdb/version.rb +1 -1
- data/spec/influxdb/client_spec.rb +3 -2
- 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: 5317b3f282142902370f70efe284c0b3bc26fd33
|
4
|
+
data.tar.gz: 7c8d66553e69ca83a7c7bd195c15b720ce566db4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aa6353445b0e3741e9618389f96db0494c0bca4d9287275db4eb09abbc092adea05fd294800f7a3b06fd80402fdf58fdebbc9174a493c0abb379841b7a7c307
|
7
|
+
data.tar.gz: 6d04fd6f05351872f029af105b2c7a183d136ab76be4580339e97bb9d58c5ff37d48c1a81e54e1ece16a4ad58a13ff660a064d275305aa70520fccbf61bd6fcf
|
data/lib/influxdb/client.rb
CHANGED
@@ -38,19 +38,23 @@ module InfluxDB
|
|
38
38
|
http = Net::HTTP.new(@host, @port)
|
39
39
|
url = "/db?u=#{@username}&p=#{@password}"
|
40
40
|
data = JSON.generate({:name => name})
|
41
|
+
|
41
42
|
response = http.request(Net::HTTP::Post.new(url), data)
|
42
43
|
end
|
43
44
|
|
44
45
|
def delete_database(name)
|
45
46
|
http = Net::HTTP.new(@host, @port)
|
46
47
|
url = "/db/#{name}?u=#{@username}&p=#{@password}"
|
48
|
+
|
47
49
|
response = http.request(Net::HTTP::Delete.new(url))
|
48
50
|
end
|
49
51
|
|
50
52
|
def get_database_list
|
51
53
|
http = Net::HTTP.new(@host, @port)
|
52
54
|
url = "/dbs?u=#{@username}&p=#{@password}"
|
55
|
+
|
53
56
|
response = http.request(Net::HTTP::Get.new(url))
|
57
|
+
JSON.parse(response.body)
|
54
58
|
end
|
55
59
|
|
56
60
|
def create_database_user(database, username, password)
|
data/lib/influxdb/version.rb
CHANGED
@@ -53,11 +53,12 @@ describe InfluxDB::Client do
|
|
53
53
|
|
54
54
|
describe "#get_database_list" do
|
55
55
|
it "should GET a list of databases" do
|
56
|
+
database_list = [{"name" => "foobar"}]
|
56
57
|
stub_request(:get, "http://influxdb.test:9999/dbs").with(
|
57
58
|
:query => {:u => "username", :p => "password"}
|
58
|
-
)
|
59
|
+
).to_return(:body => JSON.generate(database_list, :status => 200))
|
59
60
|
|
60
|
-
@influxdb.get_database_list.should
|
61
|
+
@influxdb.get_database_list.should == database_list
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: influxdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Persen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|