Manage plugins

This page describes how you can edit, view, and delete plugins created using Service Extensions.

For a product overview, see Service Extensions overview.

Edit plugins

This section describes how you can edit plugins created using Service Extensions.

Edit a plugin

To edit a plugin, follow these steps:

Run the gcloud service-extensions wasm-plugins update command:

gcloud service-extensions wasm-plugins update WASM_PLUGIN \
    --description=PLUGIN_DESCRIPTION \
    --labels=[LABELS,...]

Replace the following:

  • WASM_PLUGIN: the name of the plugin
  • PLUGIN_DESCRIPTION: the description of the plugin
  • LABELS: labels in the form of key-value pairs separated by commas

Add a new version of a plugin

You can modify the source plugin code and then add it as a new version of the plugin.

To add a new version of a plugin, follow these steps:

Run the gcloud service-extensions wasm-plugins update command:

gcloud service-extensions wasm-plugins update WASM_PLUGIN \
    --image=IMAGE \
    --main-version=MAIN_VERSION \
    --plugin-config=PLUGIN_CONFIG | --plugin-config-file=PLUGIN_CONFIG_FILE | --plugin-config-uri=PLUGIN_CONFIG_URI

Replace the following:

  • WASM_PLUGIN: the ID or the fully qualified name of the plugin
  • IMAGE: the URI of the container image that has a new version of the Wasm module stored in the Artifact Registry repository.
  • MAIN_VERSION: the ID of the plugin version to create and set as the main (or serving) version.
  • PLUGIN_CONFIG, PLUGIN_CONFIG_FILE, or PLUGIN_CONFIG_URI: the optional configuration file, which can be specified inline as text, as a local file, or as a container image in Artifact Registry, respectively.

Change the main version of a plugin

To change the main version of a plugin, follow these steps:

Run the gcloud service-extensions wasm-plugins update command:

gcloud service-extensions wasm-plugin update \
    --main-version=WASM_PLUGIN_VERSION

Replace WASM_PLUGIN_VERSION with the name of the main version of the plugin.

It might take a few minutes for the new plugin version to be distributed across all locations. The number of minutes might vary across locations because the plugin is not delivered to all locations simultaneously.

View plugins

This section describes how you can view plugins and plugin versions created using Service Extensions.

List plugins

To list the plugins in your project, use one of the following methods:

Run the gcloud service-extensions wasm-plugins list command:

gcloud service-extensions wasm-plugins list

The plugins in your project are listed in a table that has the following information:

  • Name: the name of the plugin
  • Description: the description of the plugin
  • Main version: the active version of the plugin
  • Update time: the time when the plugin was last modified

View the details of a plugin

To view the details of a plugin, use one of the following methods:

  • To view the details of a plugin, run the gcloud service-extensions wasm-plugins describe command:

    gcloud service-extensions wasm-plugins describe WASM_PLUGIN
    

    Replace WASM_PLUGIN with the name of the plugin.

    The following details are provided about the plugin:

    • the plugin name
    • the creation and modification timestamps for the plugin,
    • the labels
    • the log sampling rate (if logging is enabled)
  • To list the versions for a plugin, run the gcloud service-extensions wasm-plugin-versions list command:

    gcloud service-extensions wasm-plugin-versions list WASM_PLUGIN
    

    Replace WASM_PLUGIN with the name of the plugin.

    The versions of the specified plugin are listed in a table with the name of the plugin.

  • To view the details of a plugin version, run the gcloud service-extensions wasm-plugin-versions describe command:

    gcloud service-extensions wasm-plugin-versions describe WASM_PLUGIN_VERSION
    

    Replace WASM_PLUGIN_VERSION with the main version of the plugin.

    The following details are provided about the plugin version:

    • the version name
    • the creation timestamp
    • a description, if it was entered
    • the URI and digests for the container image
    • the plugin configuration file or image and related digests

Delete plugins

This section describes how you can delete plugins and plugin versions created using Service Extensions.

Delete a plugin

To delete a plugin, follow these steps:

  1. Remove the Wasm action from the Media CDN service. To do this, remove the wasmAction line from the YAML file, and then re-import it. For more information, see Deploy plugins in Media CDN routes.

  2. Run the gcloud service-extensions wasm-plugins delete command:

    gcloud service-extensions wasm-plugins delete WASM_PLUGIN
    

    Replace WASM_PLUGIN with the name of the plugin.

Deleting a plugin also deletes the related versions and Wasm actions.

Delete a version of a plugin

To delete a version of a plugin, follow these steps:

Run the gcloud service-extensions wasm-plugin-versions delete command:

gcloud service-extensions wasm-plugin-versions delete WASM_PLUGIN_VERSION

Replace WASM_PLUGIN_VERSION with the name of a plugin version that's not being used as the main version.

If a version is set as the main version, which is the main (active) version, you can delete it only after you set another version as the main version.

What's next