✨
Singularity
English
English
  • Overview
    • What is Singularity
    • V1 or V2
  • Installation
    • Download binaries
    • Install via docker
    • Built from source
    • Deploy to production
    • Version upgrade
  • Data Preparation
    • Get Started
    • Performance Tuning
  • Content Distribution
    • Distribute CAR files
  • Deal Making
    • Create a deal schedule
  • Topics
    • Inline Preparation
    • Benchmark
  • 💻CLI Reference
    • Menu
    • Ez Prep
    • Version
    • Admin
      • Init
      • Reset
      • Migrate Dataset
      • Migrate Schedule
    • Download
    • Extract Car
    • Deal
      • Schedule
        • Create
        • List
        • Update
        • Pause
        • Resume
        • Remove
      • Send Manual
      • List
    • Run
      • Api
      • Dataset Worker
      • Content Provider
      • Deal Tracker
      • Deal Pusher
      • Download Server
    • Wallet
      • Import
      • List
      • Remove
    • Storage
      • Create
        • Acd
        • Azureblob
        • B2
        • Box
        • Drive
        • Dropbox
        • Fichier
        • Filefabric
        • Ftp
        • Google Cloud Storage
        • Gphotos
        • Hdfs
        • Hidrive
        • Http
        • Internetarchive
        • Jottacloud
        • Koofr / Digi Storage
          • Digistorage
          • Koofr / Digi Storage
          • Other
        • Local
        • Mailru
        • Mega
        • Netstorage
        • Onedrive
        • Oos
          • Env_auth
          • Instance_principal_auth
          • No_auth
          • Resource_principal_auth
          • User_principal_auth
        • Opendrive
        • Pcloud
        • Premiumizeme
        • Putio
        • Qingstor
        • AWS S3 and compliant
          • Aws
          • Alibaba
          • Arvancloud
          • Ceph
          • Chinamobile
          • Cloudflare
          • Digitalocean
          • Dreamhost
          • Huaweiobs
          • Ibmcos
          • Idrive
          • Ionos
          • Liara
          • Lyvecloud
          • Minio
          • Netease
          • Other
          • Qiniu
          • Rackcorp
          • Scaleway
          • Seaweedfs
          • Stackpath
          • Storj
          • Tencentcos
          • Wasabi
        • Seafile
        • Sftp
        • Sharefile
        • Sia
        • Smb
        • Storj
          • Existing
          • New
        • Sugarsync
        • Swift
        • Union
        • Uptobox
        • Webdav
        • Yandex
        • Zoho
      • Explore
      • List
      • Remove
      • Update
        • Acd
        • Azureblob
        • B2
        • Box
        • Drive
        • Dropbox
        • Fichier
        • Filefabric
        • Ftp
        • Google Cloud Storage
        • Gphotos
        • Hdfs
        • Hidrive
        • Http
        • Internetarchive
        • Jottacloud
        • Koofr / Digi Storage
          • Digistorage
          • Koofr / Digi Storage
          • Other
        • Local
        • Mailru
        • Mega
        • Netstorage
        • Onedrive
        • Oos
          • Env_auth
          • Instance_principal_auth
          • No_auth
          • Resource_principal_auth
          • User_principal_auth
        • Opendrive
        • Pcloud
        • Premiumizeme
        • Putio
        • Qingstor
        • AWS S3 and compliant
          • Aws
          • Alibaba
          • Arvancloud
          • Ceph
          • Chinamobile
          • Cloudflare
          • Digitalocean
          • Dreamhost
          • Huaweiobs
          • Ibmcos
          • Idrive
          • Ionos
          • Liara
          • Lyvecloud
          • Minio
          • Netease
          • Other
          • Qiniu
          • Rackcorp
          • Scaleway
          • Seaweedfs
          • Stackpath
          • Storj
          • Tencentcos
          • Wasabi
        • Seafile
        • Sftp
        • Sharefile
        • Sia
        • Smb
        • Storj
          • Existing
          • New
        • Sugarsync
        • Swift
        • Union
        • Uptobox
        • Webdav
        • Yandex
        • Zoho
      • Rename
    • Prep
      • Create
      • List
      • Status
      • Rename
      • Attach Source
      • Attach Output
      • Detach Output
      • Start Scan
      • Pause Scan
      • Start Pack
      • Pause Pack
      • Start Daggen
      • Pause Daggen
      • List Pieces
      • Add Piece
      • Explore
      • Attach Wallet
      • List Wallets
      • Detach Wallet
      • Remove
  • 🌐Web API Reference
    • Admin
    • Deal Schedule
    • Deal
    • File
    • Job
    • Piece
    • Preparation
    • Storage
    • Wallet Association
    • Wallet
    • Specification
  • ❓FAQ
    • Database is locked
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Web API Reference

File

PreviousDealNextJob

Last updated 1 year ago

Was this helpful?

🌐

Get details about a file

get
Path parameters
idintegerRequired

File ID

Responses
200
OK
application/json
500
Internal Server Error
application/json
get
GET /api/file/{id} HTTP/1.1
Host: localhost:9090
Accept: */*
{
  "attachmentId": 1,
  "cid": "text",
  "directoryId": 1,
  "fileRanges": [
    {
      "cid": "text",
      "fileId": 1,
      "id": 1,
      "jobId": 1,
      "length": 1,
      "offset": 1
    }
  ],
  "hash": "text",
  "id": 1,
  "lastModifiedNano": 1,
  "path": "text",
  "size": 1
}

Get all deals that have been made for a file

get
Path parameters
idintegerRequired

File ID

Responses
200
OK
application/json
500
Internal Server Error
application/json
get
GET /api/file/{id}/deals HTTP/1.1
Host: localhost:9090
Accept: */*
[
  {
    "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
      }
    ],
    "fileRange": {
      "cid": "text",
      "fileId": 1,
      "id": 1,
      "jobId": 1,
      "length": 1,
      "offset": 1
    }
  }
]

prepare job for a given item

post
Path parameters
idintegerRequired

File ID

Responses
200
OK
application/json
Responseinteger
400
Bad Request
application/json
500
Internal Server Error
application/json
post
POST /api/file/{id}/prepare_to_pack HTTP/1.1
Host: localhost:9090
Accept: */*
1

Get content of a file

get
Path parameters
idintegerRequired

File ID

Header parameters
RangestringOptional

HTTP Range Header

Responses
200
OK
application/json
Responsestring
206
Partial Content
application/json
400
Bad Request
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
get
GET /api/file/{id}/retrieve HTTP/1.1
Host: localhost:9090
Accept: */*
text
  • GETGet details about a file
  • GETGet all deals that have been made for a file
  • POSTprepare job for a given item
  • GETGet content of a file
  • POSTPush a file to be queued

Push a file to be queued

post

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

Path parameters
idstringRequired

Preparation ID or name

namestringRequired

Source storage ID or name

Body
pathstringOptional

Path to the new file, relative to the source

Responses
200
OK
application/json
400
Bad Request
application/json
500
Internal Server Error
application/json
post
POST /api/preparation/{id}/source/{name}/file HTTP/1.1
Host: localhost:9090
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "path": "text"
}
{
  "attachmentId": 1,
  "cid": "text",
  "directoryId": 1,
  "fileRanges": [
    {
      "cid": "text",
      "fileId": 1,
      "id": 1,
      "jobId": 1,
      "length": 1,
      "offset": 1
    }
  ],
  "hash": "text",
  "id": 1,
  "lastModifiedNano": 1,
  "path": "text",
  "size": 1
}