Module: EventStore::HTTP::Controls::Gossip::Response::JSON

Defined in:
lib/event_store/http/controls/gossip/response/json.rb

Class Method Summary collapse

Class Method Details

.text(unavailable: nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/event_store/http/controls/gossip/response/json.rb', line 7

def self.text(unavailable: nil)
  "{\n  \"members\": [\n    {\n      \"instanceId\": \"00000101-0000-4000-8000-000000000000\",\n      \"timeStamp\": \"2000-01-01T00:00:00.000000Z\",\n      \"state\": \"\#{unavailable ? 'Unknown' : 'Master'}\",\n      \"isAlive\": true,\n      \"internalTcpIp\": \"127.0.111.1\",\n      \"internalTcpPort\": 1112,\n      \"internalSecureTcpPort\": 0,\n      \"externalTcpIp\": \"127.0.111.1\",\n      \"externalTcpPort\": 1113,\n      \"externalSecureTcpPort\": 0,\n      \"internalHttpIp\": \"127.0.111.1\",\n      \"internalHttpPort\": 2112,\n      \"externalHttpIp\": \"127.0.111.1\",\n      \"externalHttpPort\": 2113,\n      \"lastCommitPosition\": 1111,\n      \"writerCheckpoint\": 111,\n      \"chaserCheckpoint\": 11,\n      \"epochPosition\": 222,\n      \"epochNumber\": 22,\n      \"epochId\": \"00000001-0000-4000-8000-000000000000\",\n      \"nodePriority\": 0\n    },\n    {\n      \"instanceId\": \"00000102-0000-4000-8000-000000000000\",\n      \"timeStamp\": \"2000-01-01T00:00:00.000000Z\",\n      \"state\": \"Slave\",\n      \"isAlive\": true,\n      \"internalTcpIp\": \"127.0.111.2\",\n      \"internalTcpPort\": 1112,\n      \"internalSecureTcpPort\": 0,\n      \"externalTcpIp\": \"127.0.111.2\",\n      \"externalTcpPort\": 1113,\n      \"externalSecureTcpPort\": 0,\n      \"internalHttpIp\": \"127.0.111.2\",\n      \"internalHttpPort\": 2112,\n      \"externalHttpIp\": \"127.0.111.2\",\n      \"externalHttpPort\": 2113,\n      \"lastCommitPosition\": 1111,\n      \"writerCheckpoint\": 111,\n      \"chaserCheckpoint\": 11,\n      \"epochPosition\": 222,\n      \"epochNumber\": 22,\n      \"epochId\": \"00000001-0000-4000-8000-000000000000\",\n      \"nodePriority\": 0\n    },\n    {\n      \"instanceId\": \"00000103-0000-4000-8000-000000000000\",\n      \"timeStamp\": \"2000-01-01T00:00:00.000000Z\",\n      \"state\": \"Slave\",\n      \"isAlive\": false,\n      \"internalTcpIp\": \"127.0.111.3\",\n      \"internalTcpPort\": 1112,\n      \"internalSecureTcpPort\": 0,\n      \"externalTcpIp\": \"127.0.111.3\",\n      \"externalTcpPort\": 1113,\n      \"externalSecureTcpPort\": 0,\n      \"internalHttpIp\": \"127.0.111.3\",\n      \"internalHttpPort\": 2112,\n      \"externalHttpIp\": \"127.0.111.3\",\n      \"externalHttpPort\": 2113,\n      \"lastCommitPosition\": 1111,\n      \"writerCheckpoint\": 111,\n      \"chaserCheckpoint\": 11,\n      \"epochPosition\": 222,\n      \"epochNumber\": 22,\n      \"epochId\": \"00000001-0000-4000-8000-000000000000\",\n      \"nodePriority\": 0\n    }\n  ],\n  \"serverIp\": \"127.0.111.1\",\n  \"serverPort\": 2112\n}\n  JSON\nend\n"