Account service

GET /status

Return a summary of the target account service. The body of the reply will present a count of the objects in the databse, formatted as a JSON object.

Sample request:

GET /status HTTP/1.1
Host: 127.0.0.1:6021
User-Agent: curl/7.55.1
Accept: */*

Sample response:

HTTP/1.1 200 OK
Server: gunicorn/19.7.1
Date: Wed, 22 Nov 2017 09:45:03 GMT
Connection: keep-alive
Content-Type: text/json; charset=utf-8
Content-Length: 20

{"account_count": 0}

PUT /v1.0/account/create?id=<account_name>

Create a new account with the specified name.

Sample request:

PUT /v1.0/account/create?id=myaccount HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*

Sample response:

HTTP/1.1 201 CREATED
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/plain; charset=utf-8
Content-Length: 9

myaccount

GET /v1.0/account/list

Get the list of existing accounts.

Sample request:

GET /v1.0/account/list HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*

Sample response:

HTTP/1.1 200 OK
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/json; charset=utf-8
Content-Length: 13

["myaccount"]

POST /v1.0/account/delete?id=<account_name>

Delete the specified account.

Sample request:

POST /v1.0/account/delete?id=myaccount HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*

Sample response:

HTTP/1.1 204 No Content
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/plain; charset=utf-8

POST /v1.0/account/update?id=<account_name>

Update metadata of the specified account.

Sample request:

PUT /v1.0/account/update?id=myaccount HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 41
Content-Type: application/x-www-for-urlencoded
{
  "metadata": {"key":"value"},
  "to_delete": ["key"]
}

Sample response:

HTTP/1.1 204 NO CONTENT
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/plain; charset=utf-8

GET /v1.0/account/show?id=<account_name>

Get information about the specified account.

Sample request:

GET /v1.0/account/show?id=myaccount HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*

Sample response:

HTTP/1.1 200 OK
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/plain; charset=utf-8
Content-Length: 107
{
  "ctime": "1533127401.08165",
  "bytes": 0,
  "objects": 0,
  "id": "myaccount",
  "containers": 0,
  "metadata": {}
 }

GET /v1.0/account/containers?id=<account_name>

Get information about the containers belonging to the specified account.

Sample request:

GET /v1.0/account/containers?id=myaccount HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*

Sample response:

HTTP/1.1 200 OK
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/plain; charset=utf-8
Content-Length: 122
{
  "ctime": "1533127401.08165",
  "bytes": 0,
  "objects": 0,
  "listing": [],
  "id": "account",
  "containers": 0,
  "metadata": {}
 }

PUT /v1.0/account/container/update?id=<account_name>

{
  "mtime": "123456789",
  "dtime": "1223456789",
  "name": "container name",
  "objects": 0,
  "bytes": 0
}

Update account with container-related metadata.

PUT /v1.0/account/container/update?id=myaccount HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 84
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 200 OK
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/plain; charset=utf-8
Content-Length: 117

PUT /v1.0/account/container/reset?id=<account_name>

Reset statistics of the specified container. Usually followed by a “container touch” operation.

Request example:

PUT /v1.0/account/container/reset?id=myaccount HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 45
Content-Type: application/x-www-form-urlencoded
{
  "name": "container name",
  "mtime": 1234567891011
}

Response example:

HTTP/1.1 204 NO CONTENT
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/plain; charset=utf-8

POST /v1.0/account/refresh?id=<account_name>

Refresh counter of an account named account_name

POST /v1.0/account/refresh?id=myaccount HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*
HTTP/1.1 204 NO CONTENT
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/plain; charset=utf-8

POST /v1.0/account/flush?id=<account_name>

Flush all container of an account named account_name

POST /v1.0/account/flush?id=myaccount HTTP/1.1
Host: 127.0.0.1:6013
User-Agent: curl/7.47.0
Accept: */*
HTTP/1.1 204 NO CONTENT
Server: gunicorn/19.9.0
Date: Wed, 01 Aug 2018 12:17:25 GMT
Connection: keep-alive
Content-Type: text/plain; charset=utf-8