MCPcopy
hub / github.com/google/earthengine-api / renameAsset

Function renameAsset

python/ee/data.py:1558–1571  ·  view source on GitHub ↗

Renames the asset from sourceId to destinationId. Args: sourceId: The ID of the asset to rename. destinationId: The new ID of the asset.

(sourceId: str, destinationId: str)

Source from the content-addressed store, hash-verified

1556
1557
1558def renameAsset(sourceId: str, destinationId: str) -> None:
1559 """Renames the asset from sourceId to destinationId.
1560
1561 Args:
1562 sourceId: The ID of the asset to rename.
1563 destinationId: The new ID of the asset.
1564 """
1565 src_name = _cloud_api_utils.convert_asset_id_to_asset_name(sourceId)
1566 dest_name = _cloud_api_utils.convert_asset_id_to_asset_name(destinationId)
1567 _execute_cloud_call(
1568 _get_cloud_projects()
1569 .assets()
1570 .move(sourceName=src_name, body={'destinationName': dest_name})
1571 )
1572
1573
1574def deleteAsset(assetId: str) -> None:

Callers

nothing calls this directly

Calls 3

_execute_cloud_callFunction · 0.85
_get_cloud_projectsFunction · 0.85
assetsMethod · 0.80

Tested by

no test coverage detected