Piece
Get metadata for a piece for how it may be reassembled from the data source
Piece CID
OK
Bad Request
Not Found
Internal Server Error
GET /api/piece/{id}/metadata HTTP/1.1
Accept: */*
{}Preparation ID or name
OK
Bad Request
Internal Server Error
GET /api/preparation/{id}/piece HTTP/1.1
Accept: */*
[
{
"attachmentId": 1,
"pieces": [
{
"attachmentId": 1,
"createdAt": "text",
"fileSize": 1,
"id": 1,
"jobId": 1,
"minPieceSizePadding": 1,
"numOfFiles": 1,
"pieceCid": "text",
"pieceSize": 1,
"pieceType": "text",
"preparationId": 1,
"rootCid": "text",
"storageId": 1,
"storagePath": "text"
}
],
"source": {
"clientConfig": {
"caCert": [
"text"
],
"clientCert": "text",
"clientKey": "text",
"connectTimeout": 1,
"disableHttp2": true,
"disableHttpKeepAlives": true,
"expectContinueTimeout": 1,
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"insecureSkipVerify": true,
"lowlevelRetries": 1,
"noGzip": true,
"retryBackoff": 1,
"retryBackoffExponential": 1,
"retryDelay": 1,
"retryMaxCount": 1,
"scanConcurrency": 1,
"skipInaccessibleFile": true,
"timeout": 1,
"useServerModTime": true,
"userAgent": "text"
},
"config": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"createdAt": "text",
"id": 1,
"name": "text",
"path": "text",
"preparationsAsOutput": [
{
"createdAt": "text",
"deleteAfterExport": true,
"id": 1,
"maxSize": 1,
"minPieceSize": 1,
"name": "text",
"noDag": true,
"noInline": true,
"outputStorages": [
"[Circular Reference]"
],
"pieceSize": 1,
"sourceStorages": [
"[Circular Reference]"
],
"updatedAt": "text",
"walletId": 1
}
],
"preparationsAsSource": [
{
"createdAt": "text",
"deleteAfterExport": true,
"id": 1,
"maxSize": 1,
"minPieceSize": 1,
"name": "text",
"noDag": true,
"noInline": true,
"outputStorages": [
"[Circular Reference]"
],
"pieceSize": 1,
"sourceStorages": [
"[Circular Reference]"
],
"updatedAt": "text",
"walletId": 1
}
],
"type": "text",
"updatedAt": "text"
},
"storageId": 1
}
]Preparation ID or name
File size of the CAR file, this is required for boost online deal
CID of the piece
Size of the piece (required for external import, optional if piece exists in DB)
Root CID of the CAR file, used to populate the label field of storage deal
OK
MinPieceSizePadding tracks virtual padding for inline mode only. Inline: stores padding amount, PieceReader serves zeros virtually. Non-inline: always 0, literal zeros are written to CAR file for Curio TreeD compatibility.
PieceType indicates whether this is a data piece or DAG piece
Association - SET NULL for fast prep deletion, async cleanup
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.
Bad Request
Internal Server Error
POST /api/preparation/{id}/piece HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 68
{
"fileSize": 1,
"pieceCid": "text",
"pieceSize": "text",
"rootCid": "text"
}{
"attachmentId": 1,
"createdAt": "text",
"fileSize": 1,
"id": 1,
"jobId": 1,
"minPieceSizePadding": 1,
"numOfFiles": 1,
"pieceCid": "text",
"pieceSize": 1,
"pieceType": "text",
"preparationId": 1,
"rootCid": "text",
"storageId": 1,
"storagePath": "text"
}Deletes a piece (CAR) and its associated records. For data pieces, resets file ranges to allow re-packing. For DAG pieces, resets directory export flags for re-generation.
Preparation ID or name
Piece CID
Delete the physical CAR file from storage (default: true)
Delete even if deals reference this piece
No Content
No content
Bad Request
Not Found
Internal Server Error
DELETE /api/preparation/{id}/piece/{piece_cid} HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 31
{
"deleteCar": true,
"force": true
}No content
Last updated
Was this helpful?