File

Get details about a file

get

/file/{id}

Path parameters
idintegerrequired

File ID

Responses
curl -L \
  --url '//localhost:9090/api/file/{id}'
{
  "attachmentId": 1,
  "cid": "text",
  "directoryId": 1,
  "hash": "text",
  "id": 1,
  "lastModifiedNano": 1,
  "path": "text",
  "size": 1,
  "fileRanges": [
    {
      "cid": "text",
      "fileId": 1,
      "id": 1,
      "jobId": 1,
      "length": 1,
      "offset": 1
    }
  ]
}

Get all deals that have been made for a file

get

/file/{id}/deals

Path parameters
idintegerrequired

File ID

Responses
curl -L \
  --url '//localhost:9090/api/file/{id}/deals'
[
  {
    "fileRange": {
      "cid": "text",
      "fileId": 1,
      "id": 1,
      "jobId": 1,
      "length": 1,
      "offset": 1
    },
    "deals": [
      {
        "clientId": "text",
        "createdAt": "text",
        "dealId": 1,
        "endEpoch": 1,
        "errorMessage": "text",
        "id": 1,
        "label": "text",
        "lastVerifiedAt": "text",
        "pieceCid": "text",
        "pieceSize": 1,
        "price": "text",
        "proposalId": "text",
        "provider": "text",
        "scheduleId": 1,
        "sectorStartEpoch": 1,
        "startEpoch": 1,
        "state": "proposed",
        "updatedAt": "text",
        "verified": true
      }
    ]
  }
]

prepare job for a given item

post

/file/{id}/prepare_to_pack

Path parameters
idintegerrequired

File ID

Responses
curl -L \
  --request POST \
  --url '//localhost:9090/api/file/{id}/prepare_to_pack'
1

Get content of a file

get

/file/{id}/retrieve

Path parameters
idintegerrequired

File ID

Header parameters
Rangestring

HTTP Range Header

Responses
curl -L \
  --url '//localhost:9090/api/file/{id}/retrieve'
text

Push a file to be queued

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

post

/preparation/{id}/source/{name}/file

Path parameters
idstringrequired

Preparation ID or name

namestringrequired

Source storage ID or name

Body
pathstring

Path to the new file, relative to the source

Responses
curl -L \
  --request POST \
  --url '//localhost:9090/api/preparation/{id}/source/{name}/file' \
  --header 'Content-Type: application/json'
{
  "attachmentId": 1,
  "cid": "text",
  "directoryId": 1,
  "hash": "text",
  "id": 1,
  "lastModifiedNano": 1,
  "path": "text",
  "size": 1,
  "fileRanges": [
    {
      "cid": "text",
      "fileId": 1,
      "id": 1,
      "jobId": 1,
      "length": 1,
      "offset": 1
    }
  ]
}

Last updated

Was this helpful?