Method: projects.assets.copy
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Requête HTTP
POST https://earthengine.googleapis.com/v1beta/{sourceName=projects/*/assets/**}:copy
L'URL utilise la syntaxe de transcodage gRPC.
Paramètres de chemin d'accès
Paramètres |
sourceName |
string
Nom de l'élément à copier. name est au format "projects/*/assets/**" (par exemple, "projects/earthengine-legacy/assets/users/[USER]/[ASSET]"). Tous les composants appartenant à l'utilisateur sont inclus dans le projet "earthengine-legacy" (par exemple, "projects/earthengine-legacy/assets/users/foo/bar"). Tous les autres composants sont associés au projet "earthengine-public" (par exemple, "projects/earthengine-public/assets/LANDSAT"). (par exemple, "assets/users/[USER]/[ASSET]").
L'autorisation IAM suivante est requise pour la ressource sourceName indiquée :
|
Corps de la requête
Le corps de la requête contient des données présentant la structure suivante :
Représentation JSON |
{
"destinationName": string,
"overwrite": boolean
} |
Champs |
destinationName |
string
Nom de la destination vers laquelle copier l'élément. name est au format "projects/*/assets/**" (par exemple, "projects/earthengine-legacy/assets/users/[USER]/[ASSET]"). Tous les composants appartenant à l'utilisateur sont inclus dans le projet "earthengine-legacy" (par exemple, "projects/earthengine-legacy/assets/users/foo/bar"). Tous les autres composants sont associés au projet "earthengine-public" (par exemple, "projects/earthengine-public/assets/LANDSAT").
L'autorisation IAM suivante est requise pour la ressource destinationName indiquée :
earthengine.assets.create
|
overwrite |
boolean
Indique si l'écrasement d'un élément existant est autorisé.
|
Corps de la réponse
Si la requête aboutit, le corps de la réponse contient une instance de EarthEngineAsset
.
Champs d'application des autorisations
Nécessite l'un des champs d'application OAuth suivants :
https://www.googleapis.com/auth/earthengine
https://www.googleapis.com/auth/cloud-platform
Pour en savoir plus, consultez OAuth 2.0 Overview.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[null,null,["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003eCopies an Earth Engine asset from a source to a destination location.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying the source and destination asset names in the request.\u003c/p\u003e\n"],["\u003cp\u003eAllows overwriting an existing asset at the destination with the \u003ccode\u003eoverwrite\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eNeeds appropriate IAM permissions for both source (get) and destination (create) assets.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication can be achieved using Earth Engine or Cloud Platform OAuth scopes.\u003c/p\u003e\n"]]],["To copy an asset, send a POST request to `https://earthengine.googleapis.com/v1beta/{sourceName=projects/*/assets/**}:copy`. Specify the `sourceName` path parameter to indicate the asset to copy and include a request body with the `destinationName` string and an `overwrite` boolean, which indicates if an existing asset can be overwritten. User-owned assets are under `earthengine-legacy`, and all other assets are under `earthengine-public`. The response will contain the copied asset information. Authorization is required.\n"],null,["# Method: projects.assets.copy\n\nCopies an asset.\n\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1beta/{sourceName=projects/*/assets/**}:copy`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sourceName` | `string` The name of the asset to copy. `name` is of the format \"projects/\\*/assets/\\*\\*\" (e.g., \"projects/earthengine-legacy/assets/users/\\[USER\\]/\\[ASSET\\]\"). All user-owned assets are under the project \"earthengine-legacy\" (e.g., \"projects/earthengine-legacy/assets/users/foo/bar\"). All other assets are under the project \"earthengine-public\" (e.g., \"projects/earthengine-public/assets/LANDSAT\"). (e.g., \"assets/users/\\[USER\\]/\\[ASSET\\]\"). Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `sourceName`: - `earthengine.assets.get` |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------|\n| ``` { \"destinationName\": string, \"overwrite\": boolean } ``` |\n\n| Fields ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `destinationName` | `string` The destination name to which to copy the asset. `name` is of the format \"projects/\\*/assets/\\*\\*\" (e.g., \"projects/earthengine-legacy/assets/users/\\[USER\\]/\\[ASSET\\]\"). All user-owned assets are under the project \"earthengine-legacy\" (e.g., \"projects/earthengine-legacy/assets/users/foo/bar\"). All other assets are under the project \"earthengine-public\" (e.g., \"projects/earthengine-public/assets/LANDSAT\"). Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `destinationName`: - `earthengine.assets.create` |\n| `overwrite` | `boolean` Whether to allow overwriting an existing asset. |\n\n### Response body\n\nIf successful, the response body contains an instance of [EarthEngineAsset](/earth-engine/reference/rest/v1beta/projects.assets#EarthEngineAsset).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/earthengine`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]