Conscience service

GET /v3.0/{NS}/conscience/info?what=<>

Get information about conscience. You can select information using “what”.

GET /v3.0/OPENIO/conscience/info?what=types HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 79
["account","echo","meta0","meta1","meta2","oiofs","rawx","rdir","redis","sqlx"]

GET /v3.0/{NS}/conscience/list?type=<services type>

Get list of services registered

GET /v3.0/OPENIO/conscience/list?type=rawx HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 509
[{"addr":"127.0.0.1:6010","score":81,...}]

GET /v3.0/{NS}/conscience/resolve?type=<service type>&service_id=<service id>

Get service address from ID

GET /v3.0/OPENIO/conscience/resolve?type=rawx&service_id=363794e0-a2fc-47d9-94d8-90615dc0fdb8 HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 27
{ "addr": "127.0.0.1:6010"}

POST /v3.0/{NS}/conscience/flush?type=<service_type>

Deregister all services with the given type.

POST /v3.0/OPENIO/conscience/flush?type=rawx HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0

POST /v3.0/{NS}/conscience/deregister?type=<services type>

POST /v3.0/OPENIO/conscience/deregister HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 189
Content-Type: application/x-www-form-urlencoded

Body when deregistering one service:

{
  "addr": "127.0.0.1:6010",
  "type": "rawx"
}

Body when deregistering several services at once:

[
  { "addr": "127.0.0.1:6010",
    "type": "rawx" },
  { "addr": "127.0.0.1:6011",
    "type": "rawx"}
]

Standard response:

HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0

POST /v3.0/{NS}/conscience/register

POST /v3.0/OPENIO/conscience/register HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 189
Content-Type: application/x-www-form-urlencoded

Body when registering one service:

{
  "addr": "127.0.0.1:6010",
  "tags": { "stat.cpu": 100, "stat.idle": 100, "stat.io": 100 },
  "type": "rawx"
}

Body when registering several services at once:

[
  { "addr": "127.0.0.1:6010",
    "tags": { "stat.cpu": 100, "stat.idle": 100, "stat.io": 100 },
    "type": "rawx" },
  { "addr": "127.0.0.1:6011",
    "tags": { "stat.cpu": 100, "stat.idle": 100, "stat.io": 100 },
    "type": "rawx"}
]

Standard response:

HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0

POST /v3.0/{NS}/conscience/lock

POST /v3.0/OPENIO/conscience/lock HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 39
Content-Type: application/x-www-form-urlencoded

Body when locking one service:

{
  "addr": "127.0.0.1:6010",
  "type": "rawx"
}

Body when locking several services at once:

[
  { "addr": "127.0.0.1:6010",
    "type": "rawx" },
  { "addr": "127.0.0.1:6011",
    "type": "rawx"}
]

Standard response:

HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0

POST /v3.0/{NS}/conscience/unlock

POST /v3.0/OPENIO/conscience/unlock HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 39
Content-Type: application/x-www-form-urlencoded

Body when unlocking one service:

{
  "addr": "127.0.0.1:6010",
  "type": "rawx"
}

Body when unlocking several services at once:

[
  { "addr": "127.0.0.1:6010",
    "type": "rawx" },
  { "addr": "127.0.0.1:6011",
    "type": "rawx"}
]

Standard response:

HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0