Reverse-Directory service

Configuration

See Rdir Service.

API

DELETE /v1/rdir/delete?vol=<volume ip>%3A<volume port>

Unreference a chunk from the volume.

DELETE /v1/rdir/delete?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 135
Content-Type: application/x-www-form-urlencoded
{
  "container_id":"<container id>",
  "content_id":"<object content id>",
  "chunk_id":"chunk id"
}

Standard response:

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

POST /v1/rdir/push?vol=<volume ip>%3A<volume port>

Push the target volume.

POST /v1/rdir/push?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 150
Content-Type: application/x-www-form-urlencoded
{
  "container_id":"<container id>",
  "content_id":"<object content id>",
  "chunk_id":"chunk id"
}

Standard response:

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

POST /v1/rdir/fetch?vol=<volume ip>%3A<volume port>

Fetch the target volume.

POST /v1/rdir/fetch?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*

Standard response:

HTTP/1.1 200 OK
Connection: Close
Content-Length: 2

POST /v1/rdir/create?vol=<volume ip>%3A<volume port>

Create the target volume.

POST /v1/rdir/create?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*

Standard response:

HTTP/1.1 201 Created
Connection: Close
Content-Length: 0

POST /v1/rdir/status?vol=<volume ip>%3A<volume port>

Show the target volume status

POST /v1/rdir/status?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*

Standard response:

HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 36

{"chunk":{"total":0},"container":{}}

POST /v1/rdir/admin/show?vol=<volume ip>%3A<volume port>

Show the target service.

POST /v1/rdir/admin/show?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*

Standard response:

HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 2

POST /v1/rdir/admin/unlock?vol=<volume ip>%3A<volume port>

Unlock the target service.

POST /v1/rdir/admin/unlock?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*

Standard response:

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

POST /v1/rdir/admin/lock?vol=<volume ip>%3A<volume port>

Lock the target service with given key.

POST /v1/rdir/admin/lock?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 34
Content-Type: application/x-www-form-urlencoded
{
  "who": "<volume address>"
  "key": 0
}

Standard response:

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

POST /v1/rdir/admin/clear?vol=<volume ip>%3A<volume port>

Clear the target service.

POST /v1/rdir/admin/clear?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*

Standard response:

HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 13

{"removed":0}

GET /v1/rdir/admin/incident?vol=<volume ip>%3A<volume port>

Return target service incident.

GET /v1/rdir/admin/incident?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*

Standard response:

HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 11

{"date":1533039131}

POST /v1/rdir/admin/incident?vol=<volume ip>%3A<volume port>

Set target service incident.

POST /v1/rdir/admin/incident?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 11
Content-Type: application/x-www-form-urlencoded
{
  "date": 123456789
}

Standard response:

HTTP/1.1 204 OK
Connection: Close
Content-Type: application/json
Content-Length: 0

POST /v1/rdir/meta2/fetch?vol=<volume ip>%3A<volume port>

Fetch specific meta2 records, or a range of records.

The record are ordered by container_url, so we can seek a specific prefix and start iterating from there.

For example, if we want to iterate through the containers that belong to account A, we’ll seek NS/A and start iterating.

If a prefix is provided, only records whose keys contain this prefix will be returned.

We can also seek a specific marker and start iterating from the record following the marker.

The marker is never included in the results.

A limit for the number of records to be returned can be specified.

If no limit is specified, the default limit be 4096.

The maximum allowed number of records to be returned is 4096.

If no more records are available for the requested subset, ‘truncated’ will be true, otherwise it will be false.

POST /v1/rdir/meta2/fetch?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*
{
  "prefix":"<container url prefix>",
  "marker":"<last entry of the previous response>",
  "limit":"<number of entries to return>"
}

Standard response:

HTTP/1.1 200 OK
Connection: Close
Content-Length: 2

POST /v1/rdir/meta2/create?vol=<volume ip>%3A<volume port>

Create a new meta2 rdir database. There is no IP re-use, so the IP addresses of the meta2 servers are used to reference them.

POST /v1/rdir/meta2/create?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*

Standard response:

HTTP/1.1 201 Created
Connection: Close
Content-Length: 0

POST /v1/rdir/meta2/push?vol=<volume ip>%3A<volume port>

Add a newly created container to the list of containers handled by the meta2 server in question.

POST /v1/rdir/meta2/push?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 150
Content-Type: application/x-www-form-urlencoded
{
  "container_id":"<container id>",
  "container_url":"<container url>",
  "mtime":"<last modification timestamp>"
}

Standard response:

HTTP/1.1 200 OK
Connection: Close
Content-Length: 0

DELETE /v1/rdir/meta2/delete?vol=<volume ip>%3A<volume port>

Remove a meta2 record from the database.

DELETE /v1/rdir/meta2/delete?vol=127.0.0.1%3A6020 HTTP/1.1
Host: 127.0.0.1:15
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 135
Content-Type: application/x-www-form-urlencoded
{
  "container_id":"<container id>",
  "container_url":"<container url>",
}

Standard response:

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

GET /status

Return a brief summary of the usage on the target service.

GET /status HTTP/1.1
Host: 127.0.0.1:6022
User-Agent: curl/7.55.1
Accept: */*
HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 21

{"opened_db_count":6}

GET /config

Return the live configuration of the target RDIR service.

GET /config HTTP/1.1
Host: 127.0.0.1:6022
User-Agent: curl/7.55.1
Accept: */*
HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 2015
{"core.http.user_agent":"", ...}