REST Resource: projects.locations.assets

Resource: Asset

An asset represents a video or an image.

JSON representation
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "labels": {
    string: string,
    ...
  },
  "crc32c": string,
  "state": enum (State),
  "error": {
    object (Status)
  },

  // Union field resource can be only one of the following:
  "video": {
    object (VideoAsset)
  },
  "image": {
    object (ImageAsset)
  }
  // End of list of possible types for union field resource.
}
Fields
name

string

The resource name of the asset, in the form of: projects/{project}/locations/{location}/assets/{assetId}.

createTime

string (Timestamp format)

Output only. The creation time.

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".

updateTime

string (Timestamp format)

Output only. The update time.

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".

labels

map (key: string, value: string)

User-defined key/value metadata.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

crc32c

string

Based64-encoded CRC32c checksum of the asset file. For more information, see the crc32c checksum of the Cloud Storage Objects resource. If crc32c is omitted or left empty when the asset is created, this field is filled by the crc32c checksum of the Cloud Storage object indicated by VideoAsset.uri or ImageAsset.uri. If crc32c is set, the asset can't be created if the crc32c value does not match with the crc32c checksum of the Cloud Storage object indicated by VideoAsset.uri or ImageAsset.uri.

state

enum (State)

Output only. The state of the asset resource.

error

object (Status)

Output only. Only present when state is ERROR. The reason for the error state of the asset.

Union field resource. The reference to the asset. The maximum size of the resource is 250 MB. resource can be only one of the following:
video

object (VideoAsset)

VideoAsset represents a video.

image

object (ImageAsset)

ImageAsset represents an image.

VideoAsset

VideoAsset represents a video. The supported formats are MP4, MPEG-TS, and FLV. The supported video codec is H264. The supported audio codecs are AAC, AC3, MP2, and MP3.

JSON representation
{
  "uri": string
}
Fields
uri

string

Cloud Storage URI of the video. The format is gs://my-bucket/my-object.

ImageAsset

Image represents an image. The supported formats are JPEG, PNG.

JSON representation
{
  "uri": string
}
Fields
uri

string

Cloud Storage URI of the image. The format is gs://my-bucket/my-object.

State

State of the asset resource.

Enums
STATE_UNSPECIFIED State is not specified.
CREATING The asset is being created.
ACTIVE The asset is ready for use.
DELETING The asset is being deleted.
ERROR The asset has an error.

Methods

create

Creates a Asset with the provided unique ID in the specified region.

delete

Deletes the specified asset if it is not used.

get

Returns the specified asset.

list

Returns a list of all assets in the specified region.