copy
Copy an asset into another folder (async copy operation).
copy
Copy an asset into another folder (async copy operation).
Copy asset_id into destination_folder_id. The original is unchanged.
Safety class: A · API type: admin · Min version: —
Confinement
Both asset_id and destination_folder_id must be within your run-root anchor.
Signatures
def copy(sdk, asset_id, destination_folder_id):
"""Copy asset_id into destination_folder_id; return the copy-operation dict."""
return sdk.copy_asset([asset_id], destination_folder_id)
export async function copy(sdk, assetId, destinationFolderId) {
// The returned id is the copy operation, not the new asset; poll the
// destination folder's children to confirm the copy.
return await sdk.copyAsset([assetId], destinationFolderId);
}
Parameters
| Parameter (Python) | Parameter (JS) | Type | Required | Notes |
|---|---|---|---|---|
sdk | sdk | Nomad_SDK | yes | |
asset_id | assetId | str | yes | e.g. <asset-uuid> |
destination_folder_id | destinationFolderId | str | yes | e.g. <folder-uuid> |
Returns
dict | None — {id: COPY-OPERATION id} - NOT the new asset id. Confirm by polling destination children.
Errors
- 401 unauthenticated
- 404 asset or destination not found
Notes
The returned
idis the copy operation, not the new asset. Confirm the copy by
polling the destination folder's children until the new asset appears.
See also: Python ↔ JS naming map · Return shapes.
