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=<services_type>
Deregister all services with 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 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 29
{"status":200,"message":"OK"}
POST /v3.0/{NS}/conscience/deregister?type=<services type>
Deregister service with given type, same as flush
POST /v3.0/OPENIO/conscience/deregister?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: 29
{"status":200,"message":"OK"}
POST /v3.0/{NS}/conscience/register
Register one service:
{
"addr": "127.0.0.1:6010",
"tags": { "stat.cpu": 100, "stat.idle": 100, "stat.io": 100 },
"type": "rawx"
}
Register 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": "127.0.0.1:6011"}
]
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
HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0
POST /v3.0/{NS}/conscience/lock
Lock one service:
{
"addr": "127.0.0.1:6010",
"type": "rawx"
}
Lock several services at once:
[
{ "addr": "127.0.0.1:6010",
"type": "rawx" },
{ "addr": "127.0.0.1:6011",
"type": "127.0.0.1:6011"}
]
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
HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0
POST /v3.0/{NS}/conscience/unlock
Unlock one service:
{
"addr": "127.0.0.1:6010",
"type": "rawx"
}
Unlock several services at once:
[
{ "addr": "127.0.0.1:6010",
"type": "rawx" },
{ "addr": "127.0.0.1:6011",
"type": "127.0.0.1:6011"}
]
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
HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0