파일

Get details about a file

GET//localhost:9090/api/file/{id}
Path parameters
id*integer

File ID

Response

OK

Body
attachmentIdinteger

Associations

cidstring

CID is the CID of the file.

directoryIdinteger
fileRangesarray of model.FileRange (object)
hashstring

Hash is the hash of the file.

idinteger
lastModifiedNanointeger
pathstring

Path is the relative path to the file inside the storage.

sizeinteger

Size is the size of the file in bytes.

Request
const response = await fetch('//localhost:9090/api/file/{id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "cid": "text",
  "fileRanges": [
    {
      "cid": "text"
    }
  ],
  "hash": "text",
  "path": "text"
}

Get all deals that have been made for a file

GET//localhost:9090/api/file/{id}/deals
Path parameters
id*integer

File ID

Response

OK

Body
dealsarray of model.Deal (object)
fileRangemodel.FileRange (object)
Request
const response = await fetch('//localhost:9090/api/file/{id}/deals', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
[
  {
    "deals": [
      {
        "clientId": "text",
        "createdAt": "text",
        "errorMessage": "text",
        "label": "text",
        "lastVerifiedAt": "text",
        "pieceCid": "text",
        "price": "text",
        "proposalId": "text",
        "provider": "text",
        "state": "proposed",
        "updatedAt": "text",
        "verified": false
      }
    ],
    "fileRange": {
      "cid": "text"
    }
  }
]

prepare job for a given item

POST//localhost:9090/api/file/{id}/prepare_to_pack
Path parameters
id*integer

File ID

Response

OK

Body
integer
Request
const response = await fetch('//localhost:9090/api/file/{id}/prepare_to_pack', {
    method: 'POST',
    headers: {},
});
const data = await response.json();
Response
text

Push a file to be queued

Tells Singularity that something is ready to be grabbed for data preparation

POST//localhost:9090/api/preparation/{id}/source/{name}/file
Path parameters
id*string

Preparation ID or name

name*string

Source storage ID or name

Body

File Info

pathstring

Path to the new file, relative to the source

Response

OK

Body
attachmentIdinteger

Associations

cidstring

CID is the CID of the file.

directoryIdinteger
fileRangesarray of model.FileRange (object)
hashstring

Hash is the hash of the file.

idinteger
lastModifiedNanointeger
pathstring

Path is the relative path to the file inside the storage.

sizeinteger

Size is the size of the file in bytes.

Request
const response = await fetch('//localhost:9090/api/preparation/{id}/source/{name}/file', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "cid": "text",
  "fileRanges": [
    {
      "cid": "text"
    }
  ],
  "hash": "text",
  "path": "text"
}

Last updated