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/buckets?id=<account_name>

Get information about the buckets belonging to the specified account.

Sample request:

GET /v1.0/account/buckets?id=AUTH_demo 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
{
  "buckets": 3,
  "bytes": 132573,
  "ctime": "1582628089.30237",
  "objects": 3,
  "listing": [
    {
        "bytes": 132573,
        "mtime": 1582641887.75408,
        "name": "bucket0",
        "objects": 3
    },
    {
        "bytes": 0,
        "mtime": 1582641712.44969,
        "name": "bucket1",
        "objects": 0
    },
    {
        "bytes": 0,
        "mtime": 1582641715.19412,
        "name": "bucket2",
        "objects": 0
    }
  ],
  "id": "AUTH_demo",
  "containers": 5,
  "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>

Update account with container-related metadata.

Request example:

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
{
  "mtime": "123456789",
  "dtime": "1223456789",
  "name": "user1bucket%2Ffiles",
  "objects": 0,
  "bytes": 0,
  "bucket": "user1bucket"
}

Response example:

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

GET /v1.0/bucket/show?id=<bucket_name>

Get information about the specified bucket.

Sample request:

GET /v1.0/bucket/show?id=mybucket 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: 128
{
  "account": "myaccount",
  "bytes": 11300,
  "damaged_objects": 0,
  "missing_objects": 0,
  "mtime": "1533127401.08165",
  "objects": 100,
  "replication_enabled": false
}

POST /v1.0/bucket/update?id=<bucket_name>

Update metadata of the specified bucket.

Sample request:

PUT /v1.0/bucket/update?id=mybucket 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": ["oldkey"]
}

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
{
  "account": "myaccount",
  "bytes": 11300,
  "damaged_objects": 0,
  "missing_objects": 0,
  "mtime": "1533127401.08165",
  "objects": 100,
  "replication_enabled": false
}

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

Get information about the specified container.

Sample request:

GET /v1.0/account/show-container?id=AUTH_demo&container=buck0 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: 128
{
  "bucket": "buck0",
  "bytes": 2052,
  "damaged_objects": 0,
  "dtime": "0",
  "missing_chunks": 0,
  "mtime": "1583772880.48631",
  "name": "buck0",
  "objects": 2,
  "replication_enabled": false
}