weaviate-ruby 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +11 -0
- data/lib/weaviate/client.rb +15 -0
- data/lib/weaviate/health.rb +17 -0
- data/lib/weaviate/nodes.rb +12 -0
- data/lib/weaviate/objects.rb +3 -0
- data/lib/weaviate/version.rb +1 -1
- data/lib/weaviate.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9f87a5670b340fe00f3634f0cf7d22b3c699b0737d3cb326d4ec7d55085cea2
|
4
|
+
data.tar.gz: 0b7fbe6084e04d5d1a006871deab4972aa965a65bd5bf8080a58f045787841fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dee8739ad9cd3bb53ae226bd4be6b041fc9af449d47ff6347088514b2db2bfc2adef35e9fc2ff2c6c431ee5f2d311e49c5f78569ff473e36b8da366a01dd9d48
|
7
|
+
data.tar.gz: 5dd898fd6c88899b119721369d0f606114cf1be480be31218adbe506954cba1b110f9eead1f135b5619e067d7328aeefd405762159912f93996f9f098b2ff62e
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -187,6 +187,17 @@ client.query.aggs(
|
|
187
187
|
)
|
188
188
|
```
|
189
189
|
|
190
|
+
#### Nodes
|
191
|
+
```ruby
|
192
|
+
client.nodes
|
193
|
+
```
|
194
|
+
|
195
|
+
#### Health
|
196
|
+
```ruby
|
197
|
+
client.live?
|
198
|
+
client.ready?
|
199
|
+
```
|
200
|
+
|
190
201
|
## Development
|
191
202
|
|
192
203
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/weaviate/client.rb
CHANGED
@@ -44,6 +44,21 @@ module Weaviate
|
|
44
44
|
@meta.get
|
45
45
|
end
|
46
46
|
|
47
|
+
def nodes
|
48
|
+
@nodes ||= Weaviate::Nodes.new(client: self)
|
49
|
+
@nodes.list
|
50
|
+
end
|
51
|
+
|
52
|
+
def live?
|
53
|
+
@health ||= Weaviate::Health.new(client: self)
|
54
|
+
@health.live?
|
55
|
+
end
|
56
|
+
|
57
|
+
def ready?
|
58
|
+
@health ||= Weaviate::Health.new(client: self)
|
59
|
+
@health.ready?
|
60
|
+
end
|
61
|
+
|
47
62
|
def objects
|
48
63
|
@objects ||= Weaviate::Objects.new(client: self)
|
49
64
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Weaviate
|
4
|
+
class Health < Base
|
5
|
+
PATH = ".well-known"
|
6
|
+
|
7
|
+
def live?
|
8
|
+
response = client.connection.get("#{PATH}/live")
|
9
|
+
response.status == 200
|
10
|
+
end
|
11
|
+
|
12
|
+
def ready?
|
13
|
+
response = client.connection.get("#{PATH}/ready")
|
14
|
+
response.status == 200
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/weaviate/objects.rb
CHANGED
data/lib/weaviate/version.rb
CHANGED
data/lib/weaviate.rb
CHANGED
@@ -11,6 +11,8 @@ module Weaviate
|
|
11
11
|
autoload :Objects, "weaviate/objects"
|
12
12
|
autoload :OIDC, "weaviate/oidc"
|
13
13
|
autoload :Query, "weaviate/query"
|
14
|
+
autoload :Nodes, "weaviate/nodes"
|
15
|
+
autoload :Health, "weaviate/health"
|
14
16
|
|
15
17
|
module Response
|
16
18
|
autoload :Base, "weaviate/response/base"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weaviate-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrei Bondarev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -71,7 +71,9 @@ files:
|
|
71
71
|
- lib/weaviate/base.rb
|
72
72
|
- lib/weaviate/client.rb
|
73
73
|
- lib/weaviate/error.rb
|
74
|
+
- lib/weaviate/health.rb
|
74
75
|
- lib/weaviate/meta.rb
|
76
|
+
- lib/weaviate/nodes.rb
|
75
77
|
- lib/weaviate/objects.rb
|
76
78
|
- lib/weaviate/oidc.rb
|
77
79
|
- lib/weaviate/query.rb
|