REST Resource: projects.locations.wasmPlugins

Resource: WasmPlugin

WasmPlugin is a resource representing a service executing a customer-provided Wasm module.

JSON representation
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "description": string,
  "labels": {
    string: string,
    ...
  },
  "mainVersionId": string,
  "mainVersionDetails": {
    object (VersionDetails)
  },
  "logConfig": {
    object (LogConfig)
  }
}
Fields
name

string

Required. Name of the WasmPlugin resource in the following format: projects/{project}/locations/{location}/wasmPlugins/{wasmPlugin}.

createTime

string (Timestamp format)

Output only. The timestamp when the resource was created.

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 timestamp when the resource was updated.

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

description

string

Optional. A human-readable description of the resource.

labels

map (key: string, value: string)

Optional. Set of labels associated with the WasmPlugin resource.

The format must comply with the following requirements.

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

mainVersionId

string

Optional. The ID of the WasmPluginVersion resource that is the currently serving one. The version referred to must be a child of this WasmPlugin resource.

mainVersionDetails
(deprecated)

object (VersionDetails)

Output only. Inlined details of the current main version. Equal to the contents of the WasmPluginVersion resource pointed to by the mainVersionId field.

logConfig

object (LogConfig)

Optional. Specifies the logging options for the activity performed by this WasmPlugin. If logging is enabled, plugin logs are exported to Cloud Logging. Note that the settings relate to the logs generated by using logging statements in your Wasm code. The HTTP request logs are additionally configured in the Media CDN service that uses this WasmPlugin on the request path.

VersionDetails

Details of a WasmPluginVersion resource to be inlined in the WasmPlugin resource.

JSON representation
{
  "createTime": string,
  "updateTime": string,
  "description": string,
  "labels": {
    string: string,
    ...
  },
  "imageUri": string,
  "imageDigest": string,
  "pluginConfig": string,
  "pluginConfigDigest": string,

  // Union field plugin_config_source can be only one of the following:
  "pluginConfigData": string,
  "pluginConfigUri": string
  // End of list of possible types for union field plugin_config_source.
}
Fields
createTime

string (Timestamp format)

Output only. The timestamp when the resource was created.

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 timestamp when the resource was updated.

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

description

string

Optional. A human-readable description of the resource.

labels

map (key: string, value: string)

Optional. Set of labels associated with the WasmPluginVersion resource.

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

imageUri

string

Required. URI of the container image containing the Wasm module, stored in the Artifact Registry. The container image must contain only a single file with the name plugin.wasm. When a new WasmPluginVersion resource is created, the URI gets resolved to an image digest and saved in the imageDigest field.

imageDigest

string

Output only. The resolved digest for the image specified in image. The digest is resolved during the creation of a WasmPluginVersion resource. This field holds the digest value regardless of whether a tag or digest was originally specified in the image field.

pluginConfig
(deprecated)

string (bytes format)

Optional. Configuration for the Wasm plugin. The configuration is provided to the Proxy-Wasm plugin at runtime by using the ON_CONFIGURE callback.

Deprecated: Use pluginConfigData or pluginConfigUri.

A base64-encoded string.

pluginConfigDigest

string

Output only. This field holds the digest (usually checksum) value for the plugin configuration. The value is calculated based on the contents of the pluginConfigData or the container image defined by the pluginConfigUri field.

Union field plugin_config_source.

plugin_config_source can be only one of the following:

pluginConfigData

string (bytes format)

Configuration for the Wasm plugin. The configuration is provided to the Wasm plugin at runtime through the ON_CONFIGURE callback. When a new WasmPluginVersion version is created, the digest of the contents is saved in the pluginConfigDigest field.

A base64-encoded string.

pluginConfigUri

string

URI of the WasmPlugin configuration stored in the Artifact Registry. The configuration is provided to the Wasm plugin at runtime through the ON_CONFIGURE callback. The container image must contain only a single file with the name plugin.config. When a new WasmPluginVersion resource is created, the digest of the container image is saved in the pluginConfigDigest field.

LogConfig

Specifies the logging options for the activity performed by this WasmPlugin. If logging is enabled, plugin logs are exported to Cloud Logging.

JSON representation
{
  "enable": boolean,
  "sampleRate": number,
  "minLogLevel": enum (LogLevel)
}
Fields
enable

boolean

Optional. Specifies whether to enable logging for activity by this WasmPlugin.

Defaults to false.

sampleRate

number

Non-empty default. Configures the sampling rate of activity logs, where 1.0 means all logged activity is reported and 0.0 means no activity is reported. The default value is 1.0, and the value of the field must be between 0 and 1 (inclusive).

The setting relates to logs generated in your Wasm code. Note that for the logs generated on the HTTP processing path, the sample rate is multiplied by the sample rate configured in the Media CDN service using this Wasm plugin.

For example:

  • 0.5 of HTTP requests are logged because of the setting on the Media CDN service
  • Among those requests, 0.5 of logs are exported due to the setting on the Wasm plugin
  • In effect, 0.25 of logs on HTTP processing path are exported

This field can only be specified if logging is enabled for this WasmPlugin.

If the field is not provided when logging is enabled it is set to 1 by default.

minLogLevel

enum (LogLevel)

Non-empty default. Specificies the lowest level of the plugin logs that are exported to Cloud Logging. This setting relates to the logs generated by using logging statements in your Wasm code.

This field is can be set only if logging is enabled for the WasmPlugin resource.

If the field is not provided when logging is enabled, it is set to INFO by default.

LogLevel

Possible values to specify the lowest level of logs to be exported to Cloud Logging.

Enums
LOG_LEVEL_UNSPECIFIED Unspecified value.
TRACE Report logs with TRACE level and above.
DEBUG Report logs with DEBUG level and above.
INFO Report logs with INFO level and above.
WARN Report logs with WARN level and above.
ERROR Report logs with ERROR level and above.
CRITICAL Report logs with CRITICAL level only.

Methods

create

Creates a new WasmPlugin resource in a given project and location.

delete

Deletes the specified WasmPlugin resource.

get

Gets details of the specified WasmPlugin resource.

list

Lists WasmPlugin resources in a given project and location.

patch

Updates the parameters of the specified WasmPlugin resource.