influxdb 0.0.2 → 0.0.3
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/.gitignore +1 -0
- data/lib/influxdb/client.rb +7 -1
- data/lib/influxdb/version.rb +1 -1
- data/spec/influxdb/client_spec.rb +10 -0
- metadata +2 -3
- data/Gemfile.lock +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8b59b9b818ffdb252513445a60eacdeae93fa49
|
4
|
+
data.tar.gz: 779f22ee66d5017709f38496e9e408e83c2efb05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca55be4627b2396175944f5f14d471a216fa2febb1b3f4db746ff0a2ca42c1b32a78e08be2980e5377f1bea37f35db9f8678c3728abd00fb01f106b2f84a4ae9
|
7
|
+
data.tar.gz: e03e5c64acf71ccdeda8a89b4c82879a55341727086d5d5824ad5f88550a7a21d4808010669ee55d83bed9192ad18e6a528d1405d80648c01f3dd68de277622c
|
data/.gitignore
CHANGED
data/lib/influxdb/client.rb
CHANGED
@@ -2,7 +2,7 @@ require "net/http"
|
|
2
2
|
|
3
3
|
module InfluxDB
|
4
4
|
class Client
|
5
|
-
def initialize(host, port, username, password, database)
|
5
|
+
def initialize(host, port, username, password, database = nil)
|
6
6
|
@host = host
|
7
7
|
@port = port
|
8
8
|
@username = username
|
@@ -23,6 +23,12 @@ module InfluxDB
|
|
23
23
|
response = http.request(Net::HTTP::Delete.new(url))
|
24
24
|
end
|
25
25
|
|
26
|
+
def get_database_list
|
27
|
+
http = Net::HTTP.new(@host, @port)
|
28
|
+
url = "/dbs?u=#{@username}&p=#{@password}"
|
29
|
+
response = http.request(Net::HTTP::Get.new(url))
|
30
|
+
end
|
31
|
+
|
26
32
|
def create_database_user(database, username, password)
|
27
33
|
http = Net::HTTP.new(@host, @port)
|
28
34
|
url = "/db/#{database}/users?u=#{@username}&p=#{@password}"
|
data/lib/influxdb/version.rb
CHANGED
@@ -35,6 +35,16 @@ describe InfluxDB::Client do
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
describe "#get_database_list" do
|
39
|
+
it "should GET a list of databases" do
|
40
|
+
stub_request(:get, "http://influxdb.test:9999/dbs").with(
|
41
|
+
:query => {:u => "username", :p => "password"}
|
42
|
+
)
|
43
|
+
|
44
|
+
@influxdb.get_database_list.should be_a(Net::HTTPOK)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
38
48
|
describe "#create_database_user" do
|
39
49
|
it "should POST to create a new database user" do
|
40
50
|
stub_request(:post, "http://influxdb.test:9999/db/foo/users").with(
|
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.3
|
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
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -90,7 +90,6 @@ files:
|
|
90
90
|
- .gitignore
|
91
91
|
- .travis.yml
|
92
92
|
- Gemfile
|
93
|
-
- Gemfile.lock
|
94
93
|
- LICENSE.txt
|
95
94
|
- README.md
|
96
95
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
influxdb (0.0.1)
|
5
|
-
json
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
addressable (2.3.5)
|
11
|
-
crack (0.4.1)
|
12
|
-
safe_yaml (~> 0.9.0)
|
13
|
-
diff-lcs (1.2.4)
|
14
|
-
json (1.8.1)
|
15
|
-
rake (10.1.0)
|
16
|
-
rspec (2.14.1)
|
17
|
-
rspec-core (~> 2.14.0)
|
18
|
-
rspec-expectations (~> 2.14.0)
|
19
|
-
rspec-mocks (~> 2.14.0)
|
20
|
-
rspec-core (2.14.6)
|
21
|
-
rspec-expectations (2.14.3)
|
22
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
23
|
-
rspec-mocks (2.14.4)
|
24
|
-
safe_yaml (0.9.7)
|
25
|
-
webmock (1.15.0)
|
26
|
-
addressable (>= 2.2.7)
|
27
|
-
crack (>= 0.3.2)
|
28
|
-
|
29
|
-
PLATFORMS
|
30
|
-
ruby
|
31
|
-
|
32
|
-
DEPENDENCIES
|
33
|
-
bundler (~> 1.3)
|
34
|
-
influxdb!
|
35
|
-
rake
|
36
|
-
rspec
|
37
|
-
webmock
|