조각

Get metadata for a piece

Get metadata for a piece for how it may be reassembled from the data source

GET//localhost:9090/api/piece/{id}/metadata
Path parameters
id*string

Piece CID

Response

OK

Body
store.PieceReader (object)
Request
const response = await fetch('//localhost:9090/api/piece/{id}/metadata', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
text

List all prepared pieces for a preparation

GET//localhost:9090/api/preparation/{id}/piece
Path parameters
id*string

Preparation ID or name

Response

OK

Body
attachmentIdinteger
piecesarray of model.Car (object)
sourcemodel.Storage (object)
storageIdinteger
Request
const response = await fetch('//localhost:9090/api/preparation/{id}/piece', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
[
  {
    "pieces": [
      {
        "createdAt": "text",
        "pieceCid": "text",
        "rootCid": "text",
        "storagePath": "text"
      }
    ],
    "source": {
      "clientConfig": {
        "caCert": [
          "text"
        ],
        "clientCert": "text",
        "clientKey": "text",
        "disableHttp2": false,
        "disableHttpKeepAlives": false,
        "insecureSkipVerify": false,
        "noGzip": false,
        "retryBackoffExponential": 0,
        "skipInaccessibleFile": false,
        "useServerModTime": false,
        "userAgent": "text"
      },
      "config": {},
      "createdAt": "text",
      "name": "text",
      "path": "text",
      "preparationsAsOutput": [
        {
          "createdAt": "text",
          "deleteAfterExport": false,
          "name": "text",
          "noDag": false,
          "noInline": false,
          "outputStorages": [],
          "sourceStorages": [],
          "updatedAt": "text"
        }
      ],
      "preparationsAsSource": [
        {
          "createdAt": "text",
          "deleteAfterExport": false,
          "name": "text",
          "noDag": false,
          "noInline": false,
          "outputStorages": [],
          "sourceStorages": [],
          "updatedAt": "text"
        }
      ],
      "type": "text",
      "updatedAt": "text"
    }
  }
]

Add a piece to a preparation

POST//localhost:9090/api/preparation/{id}/piece
Path parameters
id*string

Preparation ID or name

Body

Piece information

fileSizeinteger

File size of the CAR file, this is required for boost online deal

pieceCid*string

CID of the piece

pieceSize*string

Size of the piece

rootCidstring

Root CID of the CAR file, used to populate the label field of storage deal

Response

OK

Body
attachmentIdinteger
createdAtstring
fileSizeinteger
idinteger
jobIdinteger
numOfFilesinteger
pieceCidstring
pieceSizeinteger
preparationIdinteger

Association

rootCidstring
storageIdinteger
storagePathstring

StoragePath is the path to the CAR file inside the storage. If the StorageID is nil but StoragePath is not empty, it means the CAR file is stored at the local absolute path.

Request
const response = await fetch('//localhost:9090/api/preparation/{id}/piece', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "pieceCid": "text",
      "pieceSize": "text"
    }),
});
const data = await response.json();
Response
{
  "createdAt": "text",
  "pieceCid": "text",
  "rootCid": "text",
  "storagePath": "text"
}

Last updated