move
Move an asset into a different folder.
move
Move an asset into a different folder.
Move asset_id into destination_folder_id.
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 move(sdk, asset_id, destination_folder_id):
"""Move asset_id into destination_folder_id. Returns the move response dict."""
return sdk.move_asset(asset_id, destination_folder_id, None, None, None)
export async function move(sdk, assetId, destinationFolderId) {
// The three nulls are name, batchAction, contentDefinitionId.
return await sdk.moveAsset(assetId, destinationFolderId, null, null, null);
}
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 — {items:[{assetStatus: 'Moving'}], totalItemCount}. ASYNC - poll get(asset_id).parentId until it flips.
Errors
- 401 unauthenticated
- 404 asset or destination not found
Notes
The three
Nones arename,batch_action,content_definition_id— required positional
args with no defaults. The move is asynchronous: the responseitems[*]come back with
assetStatus.description == "Moving", so confirm by polling the asset back until
parentIdequals the destination. On the wire this is
{"targetIds": [asset_id], "actionArguments": {"destinationFolderAssetId": dest}}; passing a
non-NonenameaddsactionArguments.nameand renames the asset as it moves.
The move is asynchronous: the response
items[*]come back with
assetStatus.description === "Moving". Confirm by pollinggetAsset(assetId)until
parentIdequals the destination. On the wire this is
{ targetIds: [assetId], actionArguments: { destinationFolderAssetId: destinationFolderId } };
a non-nullNAMEaddsactionArguments.name, renaming the asset as it moves.
See also: Python ↔ JS naming map · Return shapes.
