Method: projects.assets.patch

Updates an asset. There are a number of constraints on the update operation:

  • Only the title, description, startTime, endTime, and properties fields of the asset can be updated.
  • Naming "properties" in updateMask results in all user-defined properties of the asset being replaced by the properties in asset.
  • Naming "title", "description", "startTime" or "endTime" in updateMask and not providing a value in asset results in that field becoming unset.
  • It is possible to update individual properties by naming them in updateMask, like "properties.my_property_name". The property's value will be set to the corresponding value from asset.properties. If there is no corresponding value in asset.properties, or if there is a value but it is a NullValue, the property will be deleted from the asset.
  • Properties can be set only to string or number values, or deleted by specifying a NullValue.
  • Supplying an empty updateMask will result in the asset's timestamps and properties all being replaced by the values in asset.

HTTP request

PATCH https://earthengine.googleapis.com/v1/{asset.name=projects/*/assets/**}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
asset.name

string

The name of the asset. name is of the format "projects/*/assets/**" (e.g. "projects/earthengine-legacy/assets/users//").

Request body

The request body contains data with the following structure:

JSON representation
{
  "asset": {
    "cloudStorageLocation": {
      "uris": [
        string
      ]
    },
    "featureViewAssetLocation": {
      "assetOptions": {
        object (FeatureViewOptions)
      }
    },
    "type": enum (Type),
    "name": string,
    "id": string,
    "updateTime": string,
    "properties": {
      "fields": {
        string: value,
        ...
      }
    },
    "startTime": string,
    "endTime": string,
    "geometry": {
      "fields": {
        string: value,
        ...
      }
    },
    "bands": [
      {
        "id": string,
        "dataType": {
          object (PixelDataType)
        },
        "grid": {
          object (PixelGrid)
        },
        "pyramidingPolicy": enum (PyramidingPolicy),
        "missingData": {
          object (MissingData)
        }
      }
    ],
    "sizeBytes": string,
    "featureCount": string,
    "quota": {
      "sizeBytes": string,
      "maxSizeBytes": string,
      "assetCount": string,
      "maxAssets": string
    }
  },
  "updateMask": string
}
Fields
asset.type

enum (Type)

The type of the asset.

asset.id

string

The ID of the asset. Equivalent to name without the "projects/*/assets/" prefix (e.g. "users//"). Note that this is intended for display purposes only. It should not be used as an input to another operation. Use name instead.

asset.updateTime

string (Timestamp format)

The last-modified time of the asset.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

asset.properties

object (Struct format)

Key/value properties associated with the asset.

asset.startTime

string (Timestamp format)

The timestamp associated with the asset, if any, e.g. the time at which a satellite image was taken. For assets that correspond to an interval of time, such as average values over a month or year, this timestamp corresponds to the start of that interval.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

asset.endTime

string (Timestamp format)

For assets that correspond to an interval of time, such as average values over a month or year, this timestamp corresponds to the end of that interval (exclusive).

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

asset.geometry

object (Struct format)

The spatial footprint associated with the asset, if any, as a GeoJSON geometry object (see RFC 7946).

asset.bands[]

object (ImageBand)

Information about the data bands of the image asset. Omitted for non-image assets.

asset.sizeBytes

string (int64 format)

The size of a leaf asset (e.g. an image) in bytes.

asset.featureCount

string (int64 format)

The number of features in the asset, if applicable.

asset.quota

object (FolderQuota)

The quota information associated with the folder asset, if any. Returned for top-level user-owned folder assets (e.g. "users/*" or "projects/*").

updateMask

string (FieldMask format)

The update mask specifying which fields of the asset to update.

This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

Union field location. Information about where and how the raster tiles are stored. location can be only one of the following:
asset.cloudStorageLocation

object (CloudStorageLocation)

The location of this asset on Cloud Storage. For VCOGs (Virtual Cloud Optimized GeoTIFFs).

asset.featureViewAssetLocation

object (FeatureViewLocation)

The location of this FeatureView in EE.

Response body

If successful, the response body contains an instance of EarthEngineAsset.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/earthengine
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.