# REST Resource: projects.locations.wasmActions

- [Resource: WasmAction](https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions#WasmAction)
  - [JSON representation](https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions#WasmAction.SCHEMA_REPRESENTATION)
- [EventType](https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions#EventType)
- [Methods](https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions#METHODS_SUMMARY)

## Resource: WasmAction

`WasmAction` is a resource representing a connection between a `WasmPlugin` resource and an `EdgeCacheService` resource. After a `WasmAction` resource is created, you can't change its reference to a `WasmPlugin` resource.

| JSON representation |
|---|
| ``` { "name": string, "createTime": string, "updateTime": string, "description": string, "labels": { string: string, ... }, "supportedEvents": [ enum (`https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions#EventType`) ], // Union field `target` can be only one of the following: "wasmPlugin": string // End of list of possible types for union field `target`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. Name of the `WasmAction` resource in the following format: `projects/{project}/locations/{location}/wasmActions/{wasmAction}`. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The timestamp when the resource was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The timestamp when the resource was updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `description` | `string` Optional. A human-readable description of the resource. |
| `labels` | `map (key: string, value: string)` Optional. Set of label tags associated with the `WasmAction` resource. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `supportedEvents[]` | ``enum (`https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions#EventType`)`` Optional. Determines which of portion of the request / response is processed by the plugin. Each value translates to a separate plugin invocation. For example, processing request headers involves invoking the `ON_HTTP_HEADERS` callback. If empty, both request headers and response headers are processed. |
| Union field `target`. `target` can be only one of the following: ||
| `wasmPlugin` | `string` Required. The relative resource name of the `WasmPlugin` resource to execute in the following format: `projects/{project}/locations/{location}/wasmPlugins/{wasmPlugin}`. |

## EventType

Defines the portion of the request or response that's processed by the plugin. The valid values are: `REQUEST_HEADERS`, `RESPONSE_HEADERS`.

| Enums ||
|---|---|
| `EVENT_TYPE_UNSPECIFIED` | Unspecified value. Do not use. |
| `REQUEST_HEADERS` | If included in `supportedEvents`, the HTTP request headers are processed. |
| `RESPONSE_HEADERS` | If included in `supportedEvents`, the HTTP response headers are processed. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions/create` | Creates a new `WasmAction` resource in a given project and location. |
| ### `https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions/delete` | Deletes the specified `WasmAction` resource. |
| ### `https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions/get` | Gets details of the specified `WasmAction` resource. |
| ### `https://docs.cloud.google.com/service-extensions/docs/reference/rest/v1alpha1/projects.locations.wasmActions/list` | Lists `WasmAction` resources in a given project and location. |