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

Function copyAsset

python/ee/data.py:1534–1555  ·  view source on GitHub ↗

Copies the asset from sourceId into destinationId. Args: sourceId: The ID of the asset to copy. destinationId: The ID of the new asset created by copying. allowOverwrite: If True, allows overwriting an existing asset.

(
    sourceId: str,
    destinationId: str,
    allowOverwrite: bool = False
)

Source from the content-addressed store, hash-verified

1532
1533
1534def copyAsset(
1535 sourceId: str,
1536 destinationId: str,
1537 allowOverwrite: bool = False
1538) -> None:
1539 """Copies the asset from sourceId into destinationId.
1540
1541 Args:
1542 sourceId: The ID of the asset to copy.
1543 destinationId: The ID of the new asset created by copying.
1544 allowOverwrite: If True, allows overwriting an existing asset.
1545 """
1546 request = {
1547 'destinationName':
1548 _cloud_api_utils.convert_asset_id_to_asset_name(destinationId),
1549 'overwrite':
1550 allowOverwrite
1551 }
1552 name = _cloud_api_utils.convert_asset_id_to_asset_name(sourceId)
1553 _execute_cloud_call(
1554 _get_cloud_projects().assets().copy(sourceName=name, body=request)
1555 )
1556
1557
1558def renameAsset(sourceId: str, destinationId: 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