Content service

POST /v3.0/{NS}/content/create?acct=<account_name>&ref=<container_name>&path=<file_path>

[
  {
    "url":"http://127.0.0.1:6012/D3F2...",
    "pos":"0",
    "size":1048576,
    "hash":"00000000000000000000000000000000"
  }
]

You must specify content length and ID on header

"x-oio-content-meta-id: 2996752DFD7205006B73F17AD315AA2B"
"x-oio-content-meta-length: 64"

Create a new object. This method does not upload any data, it just registers object metadata in the database.

POST /v3.0/OPENIO/content/create?acct=my_account&ref=mycontainer&path=mycontent HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
x-oio-content-meta-length: 64
x-oio-content-meta-id: 2996752DFD7205006B73F17AD315AA2B
Content-Length: 165
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0

POST /v3.0/{NS}/content/update?acct=<account_name>&ref=<container_name>&path=<file_path>

[
  {
    "url":"http://127.0.0.1:6012/D3F2...",
    "pos":"0",
    "size":1048576,
    "hash":"00000000000000000000000000000000"
  }
]

You must specify content length and ID on header

"x-oio-content-meta-id: 2996752DFD7205006B73F17AD315AA2B"
"x-oio-content-meta-length: 64"

Update existing object. This method does not upload any data, it just registers updated object metadata in the database.

POST /v3.0/OPENIO/content/update?acct=my_account&ref=mycontainer&path=mycontent HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
x-oio-content-meta-length: 64
x-oio-content-meta-id: 2996752DFD7205006B73F17AD315AA2B
Content-Length: 165
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0

POST /v3.0/{NS}/content/truncate?acct={account}&ref={container}&path={file path}&size={int}

Truncate object at specified size.

POST /v3.0/OPENIO/content/truncate?acct=my_account&ref=mycontainer&path=mycontent&size=180 HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
HTTP/1.1 204 No Content
Connetion: Close
Content-Length: 0

POST /v3.0/{NS}/content/prepare?acct={account}&ref={container}&path={file path}

{
  "size": 42,
  "policy": "SINGLE"
}

Prepare an upload: get URLs of chunks on available rawx.

POST /v3.0/OPENIO/content/prepare?acct=my_account&ref=mycontainer&path=mycontent HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 31
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 276
x-oio-ns-chunk-size: 1048576
x-oio-content-meta-chunk-method: plain/nb_copy=1
x-oio-content-meta-ctime: 1533215985
x-oio-content-meta-deleted: False
x-oio-content-meta-hash-method: md5
x-oio-content-meta-id: B03A29AA737205002C4D414D4C12FDC5
x-oio-content-meta-length: 180
x-oio-content-meta-mime-type: application/octet-stream
x-oio-content-meta-name: mycontent
x-oio-content-meta-policy: SINGLE
x-oio-content-meta-version: 1533215985187506

GET /v3.0/{NS}/content/show?acct={account}&ref={container}&path={file path}

Get a description of the content along with its user properties.

POST /v3.0/OPENIO/content/show?acct=my_account&ref=mycontainer&path=mycontent 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: 272
x-oio-content-meta-chunk-method: plain/nb_copy=1
x-oio-content-meta-ctime: 1533546157
x-oio-content-meta-deleted: False
x-oio-content-meta-hash: 26CBCBBF52F37322FAC57B8AC0E4E130
x-oio-content-meta-hash-method: md5
x-oio-content-meta-id: FB35FC89C072050065F28C69311740F6
x-oio-content-meta-length: 180
x-oio-content-meta-mime-type: application/octet-stream
x-oio-content-meta-name: mycontent
x-oio-content-meta-policy: SINGLE
x-oio-content-meta-version: 1533546157848061
[{"url":"http://127.0.0.1:6012/BADD4...", ...}]

POST /v3.0/{NS}/content/delete?acct={account}&ref={container}&path={file path}

Unreference object from container

POST /v3.0/OPENIO/content/delete?acct=my_account&ref=mycontainer&path=mycontent 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}/content/delete_many?acct={account}&ref={container}

{
  "contents":[{"name":"content0"}, {"name":"content1"}]
}

Unreference many object from container

POST /v3.0/OPENIO/content/delete_many?acct=my_account&ref=mycontainer HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 55
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 146
{
  "contents":[{"name":"content0","status":204,"message":"ok"},{"name":"content1","status":204,"message":"ok"}]
}

POST /v3.0/{NS}/content/touch?acct={account}&ref={container}&path={file path}

Send an event to update object and object size on container.

POST /v3.0/OPENIO/content/touch?acct=my_account&ref=mycontainer&path=mycontent 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}/content/spare?acct={account_name}&ref={container_name}&path={file_path}

{"notin": <list of actual chunk>, "broken": <list of broken chunk>}

Get other chunks if chunks are broken. Don’t work with single storage policy

POST /v3.0/OPENIO/content/spare?acct=my_account&ref=mycontainer&path=mycontent HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
x-oio-content-meta-length: 64
x-oio-content-meta-id: 2996752DFD7205006B73F17AD315AA2B
Content-Length: 182
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json
Content-Length: 292
{
  "aliases":[],
  "headers":[],
  "chunks":[{"id":"http:\/\/127.0.0.1:6011\/FFD794D6527AC176..."}]
}

POST /v3.0/{NS}/content/get_properties?acct={account}&ref={container}&path={file path}

Get object properties.

POST /v3.0/OPENIO/content/get_properties?acct=my_account&ref=mycontainer&path=mycontent 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: 17
x-oio-content-meta-chunk-method: plain/nb_copy=1
x-oio-content-meta-ctime: 1533215985
x-oio-content-meta-deleted: False
x-oio-content-meta-hash: 26CBCBBF52F37322FAC57B8AC0E4E130
x-oio-content-meta-hash-method: md5
x-oio-content-meta-id: B03A29AA737205002C4D414D4C12FDC5
x-oio-content-meta-length: 180
x-oio-content-meta-mime-type: application/octet-stream
x-oio-content-meta-name: mycontent
x-oio-content-meta-policy: SINGLE
x-oio-content-meta-version: 1533215985187506

{"properties":{}}

POST /v3.0/{NS}/content/set_properties?acct={account}&ref={container}?&path={file path}

{
  "properties":{"test":"1"}
}

Set object properties.

POST /v3.0/OPENIO/content/set_properties?acct=my_account&ref=mycontainer&path=mycontent HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 27
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0

POST /v3.0/{NS}/content/del_properties?acct={account}&ref={container}?&path={file path}

["test"]

Delete object properties.

POST /v3.0/OPENIO/content/del_properties?acct=my_account&ref=mycontainer&path=mycontent HTTP/1.1
Host: 127.0.0.1:6000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 8
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 204 No Content
Connection: Close
Content-Length: 0

POST /v3.0/{NS}/content/drain?acct={account}&ref={container}&path={file path}

Remove all the chunks of a content but keep the properties. We can replace the data or the properties of the content but no action needing the removed chunks are accepted

POST /v3.0/OPENIO/content/drain?acct=my_account&ref=mycontainer&path=mycontent 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}/content/purge?acct={account}&ref={container}&path={file path}

Purge object content.

POST /v3.0/OPENIO/content/purge?acct=my_account&ref=mycontainer&path=mycontent 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