조각

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
[
  {
    "attachmentId": 0,
    "pieces": [
      {
        "attachmentId": 0,
        "createdAt": "text",
        "fileSize": 0,
        "id": 0,
        "jobId": 0,
        "numOfFiles": 0,
        "pieceCid": "text",
        "pieceSize": 0,
        "preparationId": 0,
        "rootCid": "text",
        "storageId": 0,
        "storagePath": "text"
      }
    ],
    "source": {
      "clientConfig": {
        "caCert": [
          "text"
        ],
        "clientCert": "text",
        "clientKey": "text",
        "connectTimeout": 0,
        "disableHttp2": false,
        "disableHttpKeepAlives": false,
        "expectContinueTimeout": 0,
        "insecureSkipVerify": false,
        "lowlevelRetries": 0,
        "noGzip": false,
        "retryBackoff": 0,
        "retryBackoffExponential": 0,
        "retryDelay": 0,
        "retryMaxCount": 0,
        "scanConcurrency": 0,
        "skipInaccessibleFile": false,
        "timeout": 0,
        "useServerModTime": false,
        "userAgent": "text"
      },
      "config": {},
      "createdAt": "text",
      "id": 0,
      "name": "text",
      "path": "text",
      "preparationsAsOutput": [
        {
          "createdAt": "text",
          "deleteAfterExport": false,
          "id": 0,
          "maxSize": 0,
          "name": "text",
          "noDag": false,
          "noInline": false,
          "outputStorages": [],
          "pieceSize": 0,
          "sourceStorages": [],
          "updatedAt": "text"
        }
      ],
      "preparationsAsSource": [
        {
          "createdAt": "text",
          "deleteAfterExport": false,
          "id": 0,
          "maxSize": 0,
          "name": "text",
          "noDag": false,
          "noInline": false,
          "outputStorages": [],
          "pieceSize": 0,
          "sourceStorages": [],
          "updatedAt": "text"
        }
      ],
      "type": "text",
      "updatedAt": "text"
    },
    "storageId": 0
  }
]

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
{
  "attachmentId": 0,
  "createdAt": "text",
  "fileSize": 0,
  "id": 0,
  "jobId": 0,
  "numOfFiles": 0,
  "pieceCid": "text",
  "pieceSize": 0,
  "preparationId": 0,
  "rootCid": "text",
  "storageId": 0,
  "storagePath": "text"
}

Last updated