diplomatic_bag 2.3.3 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/diplomatic_bag/datacenters.rb +2 -0
- data/lib/diplomatic_bag/nodes.rb +3 -0
- data/lib/diplomatic_bag/services.rb +6 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62d48a22830eb9a6fd2957e043579f2132facb8f044e3f7c79c783cbdba6f581
|
4
|
+
data.tar.gz: 54b2a5a144f887998f02c71e36ab0b214c65cf86fd40e35a443fa953e65ceb53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e68d07b7bc090877e96dd0bd7cbd83b2618957e36cc2a7fa96c4562e145eda3779bcd43074175313ea1086f5e57e43481e28e9fe699531af970dc09bf51c8b3c
|
7
|
+
data.tar.gz: 6868593c59dc2f81f85e5e3cc142182a0752941e0bd4929e8d801b89c37695863c101c09c9681d014041d3d74ff273333edaf6707ddc971f9098f5888e8eb217
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
# Usefull usage of Diplomat lib: Datacenter functions
|
4
4
|
module DiplomaticBag
|
5
|
+
# Return the list of datacenters matching given regexp
|
6
|
+
# @return [Array[string]] an array of DC matching given regexp
|
5
7
|
def self.get_datacenters_list(dc, options = {})
|
6
8
|
dcs = []
|
7
9
|
datacenters = Diplomat::Datacenter.get(nil, options)
|
data/lib/diplomatic_bag/nodes.rb
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
# Usefull usage of Diplomat lib: Nodes functions
|
4
4
|
module DiplomaticBag
|
5
|
+
# Get the list of nodes having duplicate node ids
|
6
|
+
# @param options options to query with
|
7
|
+
# @return [Array[Object]] an array of objects with {name: node_name, status: status}
|
5
8
|
def self.get_duplicate_node_id(options = {})
|
6
9
|
status = {
|
7
10
|
1 => 'Alive',
|
@@ -2,12 +2,18 @@
|
|
2
2
|
|
3
3
|
# Usefull usage of Diplomat lib: Services functions
|
4
4
|
module DiplomaticBag
|
5
|
+
# Get sevice name or empty string
|
6
|
+
# @param s service information
|
7
|
+
# @return [string] the name of service
|
5
8
|
def self.compute_service_name(s)
|
6
9
|
return '/node::health/' if s.nil? || s == ''
|
7
10
|
|
8
11
|
s
|
9
12
|
end
|
10
13
|
|
14
|
+
# Get the full list of services with their status
|
15
|
+
# @param options to query list
|
16
|
+
# @return #[Hash[string]] A hash of statuses (passing|warning|critical) per service
|
11
17
|
def self.get_all_services_status(options = {})
|
12
18
|
result = {}
|
13
19
|
services = Diplomat::Health.state('any', options)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diplomatic_bag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Benoit
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-05-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diplomat
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 2.
|
20
|
+
version: 2.4.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 2.
|
27
|
+
version: 2.4.0
|
28
28
|
description: Toolbox for Consul
|
29
29
|
email:
|
30
30
|
- n.benoit@criteo.com
|