consulkit 0.1.2 → 0.2.0
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/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/consulkit/client/health.rb +33 -0
- data/lib/consulkit/client.rb +2 -0
- data/lib/consulkit/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c80bfdf51247c4c1f191f47baf5d09fdaa3cc02ae6c4af32017865de5e3121eb
|
4
|
+
data.tar.gz: b0b97535969aef815011c79cb95497611694fd90936408868b02a25325c6793e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f40b315746f28bcc42831ae09fc871ee0ea200acf8dd687bcc452acf207bfcf387ea92907c7c1057a54453f2462155c76ae437af4651e4b3bc07230bb838f611
|
7
|
+
data.tar.gz: 379e1a1fcfb0a3c2d17f581c1b13e8ceb3665e1038f4089e102104690614735de0b302315f9f5fc785d75b670d3d628869df40288bc025f7cf242dfa5531975e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.2.0](https://github.com/etsy/consulkit/compare/v0.1.2...v0.2.0) (2024-06-06)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* add "List Service Instances for Service" call ([#8](https://github.com/etsy/consulkit/issues/8)) ([d115001](https://github.com/etsy/consulkit/commit/d1150019c98de693e9815c68b1ea0426c850ffad))
|
9
|
+
|
3
10
|
## [0.1.2](https://github.com/etsy/consulkit/compare/v0.1.1...v0.1.2) (2023-07-07)
|
4
11
|
|
5
12
|
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Consulkit
|
4
|
+
class Client
|
5
|
+
# Methods for querying health checks registered with Consul.
|
6
|
+
module Health
|
7
|
+
|
8
|
+
# Returns the list of service instances providing the given service, including health check
|
9
|
+
# information.
|
10
|
+
#
|
11
|
+
# @see https://developer.hashicorp.com/consul/api-docs/health#list-service-instances-for-service
|
12
|
+
#
|
13
|
+
# @param key [String] the key to read.
|
14
|
+
# @option query_params [Hash] optional query parameters.
|
15
|
+
# @option query_params [Boolean] :passing
|
16
|
+
# @option query_params [String] :filter
|
17
|
+
#
|
18
|
+
# @yield [Faraday::Response] The response from the underlying Faraday library.
|
19
|
+
#
|
20
|
+
# @return [Array<Hash>]
|
21
|
+
def health_list_service_instances(service, query_params = {})
|
22
|
+
response = get("/v1/health/service/#{service}", query_params)
|
23
|
+
|
24
|
+
if block_given?
|
25
|
+
yield response
|
26
|
+
else
|
27
|
+
response.body
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/consulkit/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'consulkit/configurable'
|
4
|
+
require 'consulkit/client/health'
|
4
5
|
require 'consulkit/client/kv'
|
5
6
|
require 'consulkit/client/session'
|
6
7
|
|
@@ -9,6 +10,7 @@ module Consulkit
|
|
9
10
|
class Client
|
10
11
|
|
11
12
|
include Consulkit::Configurable
|
13
|
+
include Consulkit::Client::Health
|
12
14
|
include Consulkit::Client::KV
|
13
15
|
include Consulkit::Client::Session
|
14
16
|
|
data/lib/consulkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: consulkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Norris
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- Rakefile
|
56
56
|
- lib/consulkit.rb
|
57
57
|
- lib/consulkit/client.rb
|
58
|
+
- lib/consulkit/client/health.rb
|
58
59
|
- lib/consulkit/client/kv.rb
|
59
60
|
- lib/consulkit/client/session.rb
|
60
61
|
- lib/consulkit/configurable.rb
|
@@ -85,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
86
|
- !ruby/object:Gem::Version
|
86
87
|
version: '0'
|
87
88
|
requirements: []
|
88
|
-
rubygems_version: 3.4.
|
89
|
+
rubygems_version: 3.4.19
|
89
90
|
signing_key:
|
90
91
|
specification_version: 4
|
91
92
|
summary: Ruby toolkit for the Consul API
|