Skip to main content
Use the ZEDEDA CLI (ZCLI) to manage patch envelopes from the command line. This article covers zcli patch-envelope commands, with syntax and examples for each operation. A patch envelope is a versioned bundle of files, called artifacts, that Edge Infrastructure Services delivers to running application instances without redeploying them. Each patch envelope belongs to one project. An artifact is one of the following:
  • An inline artifact, which embeds a base64-encoded payload directly in the patch envelope.
  • An external artifact, which references a patch artifact image that is stored in a datastore. Use external artifacts for larger files.
Delivering files with a patch envelope takes the following steps:
  1. For external artifacts, create a patch artifact image and add its file. See Create the Patch Artifact Image.
  2. Describe the artifacts in an artifact configuration file. See Write the Artifact Configuration File.
  3. Create the patch envelope with zcli patch-envelope create.
  4. Attach the patch envelope to application instances with zcli edge-app-instance patch-envelope-attach. See Attach a Patch Envelope to Application Instances.
  5. Set the patch envelope to the active state, if you did not create it active.
For the console procedures and background, see Update Applications with Runtime Bundles and Patch Envelopes.

Before You Start

  • ZCLI is installed and authenticated against your enterprise. See Get Started.
  • You have the SysManager or SysAdmin role in your enterprise. See Manage Roles.
  • The project that the patch envelope belongs to already exists. See Manage Projects.
  • The application instances that will receive the patch envelope belong to that project.

Patch Envelope States

The --action flag sets the state of a patch envelope. The console calls these states Active and Stored. ZCLI accepts the values in any letter case. Any other value prints Invalid value for --action parameter. Value should either be "store" or "activate" and ZCLI does not send the request.

Prepare the Artifacts

Create the patch artifact image

Skip this step if all your artifacts are inline. An external artifact references an image that you create with the --patch-artifact-image flag. Create the image record, then upload or uplink its file.
  1. Create the image record:
  2. Upload the file:
Wait for the image status to change to READY. Then find the image ID, which the artifact configuration file needs:
The ID appears in the Image ID field. For details about patch artifact images, upload, and uplink, see Manage Images.

Write the artifact configuration file

zcli patch-envelope create reads the artifacts from a JSON file that you pass with --artifact-config-file. The file contains an artifacts list with one object for each artifact. The following example contains one external artifact and one inline artifact:
To base64-encode a file for base64Data, run base64 -i settings.txt on macOS or base64 -w 0 settings.txt on Linux.
ZCLI sends the contents of the artifacts list exactly as written. It does not check the format values, encode the inline data, or look up the image ID from imageName. Copy the image ID from zcli image show --detail, and encode inline data yourself before you create the patch envelope.
ZCLI includes a sample artifact configuration file, patch-artifact-config.tmpl, but the sample has a trailing comma after the last artifact, which is not valid JSON. If you start from that sample, remove the trailing comma. ZCLI has no command to copy the sample, so the preceding example is a simpler starting point.

Create a Patch Envelope

Create a patch envelope in a project from an artifact configuration file.
Example (create the patch envelope in the stored state, to activate it later):
The artifact configuration file must be readable from inside the ZCLI container. See Work With Local Files.
If you create the patch envelope with --action=activate, it starts delivering as soon as you attach it to application instances. Use --action=store if you want to attach it first and activate it later.
If the artifact configuration file is not valid JSON, ZCLI prints the parse error and Invalid artifact config received, please input valid artifact configuration. and does not create the patch envelope. If the file has no artifacts list, ZCLI prints Unexpected error executing command 'patch-envelope' and does not create the patch envelope. If the file does not exist, ZCLI stops with a Python error. Check the path before you run the command.

View Patch Envelopes

View a single patch envelope

View one patch envelope by name or by ID. Unlike most ZCLI commands, show takes the name as the --name flag, not as a positional argument.
To view a patch envelope by name:
To view the full configuration of a patch envelope:
To view a patch envelope by ID:
Without --detail, the output shows the name, ID, title, user-defined version, action, project name, and creation time. The action appears as the full API value, for example PATCH_ENVELOPE_ACTION_STORE. With --detail, the output also shows the following:
  • The description and the short action value, for example Store.
  • The project ID and project name.
  • Device Count, the number of edge nodes the patch envelope is attached to.
  • An Inline Artifacts table with each inline artifact’s ID, metadata, file name, and base64 data.
  • An External Artifacts table with each external artifact’s ID, artifact metadata, file name, image name, image ID, and blob metadata.
  • Version, the revision number that Edge Infrastructure Services increases each time the patch envelope changes. This is separate from the user-defined version.
  • Who created and last updated the patch envelope, and when.
The inline artifacts table prints the full base64 data of each inline artifact, so the output can be long. To read the configuration as JSON, run zcli --format=json patch-envelope show --name=MY_PATCH_ENVELOPE.

List patch envelopes

List all patch envelopes, or filter the list. The list shows the ID, name, title, user-defined version, action, and project name of each patch envelope, followed by a count by action. To list all patch envelopes:
To list the patch envelopes in projects whose name contains MY_PROJECT:
To show only the count of patch envelopes by action:

Attach a Patch Envelope to Application Instances

ZCLI attaches and detaches patch envelopes with zcli edge-app-instance commands. The application instances and the patch envelope must belong to the project that you pass with --project.

Attach a patch envelope

Repeat --app-instance for each application instance. The following example attaches a patch envelope to two application instances:

Detach a patch envelope

The following example detaches the patch envelope from one application instance:
For details, see Manage Patch Envelopes in Manage Application Instances.

Update a Patch Envelope

Change the title, description, or state of a patch envelope.

Activate a patch envelope

Set a stored patch envelope to the active state, so that it delivers its artifacts to the application instances it is attached to.
To stop delivery without detaching the patch envelope, set it back to the stored state with --action=store.
update cannot change the artifacts, the user-defined version, or the project. To deliver different files, create a new patch envelope with a new artifact configuration file, attach it to the application instances, and then delete the old patch envelope. update also cannot clear the title or description. An empty value leaves the current value unchanged.

Delete a Patch Envelope

Delete a patch envelope by name.
Example:
delete does not ask for confirmation and has no -f flag. ZCLI deletes the patch envelope as soon as you run the command. Edge Infrastructure Services does not delete a patch envelope that is attached to edge nodes. Detach it from all application instances first.

Next Steps

Manage Images

Create the patch artifact images that external artifacts reference.

Manage Application Instances

Attach and detach patch envelopes on application instances.

Update Applications with Runtime Bundles

Create and manage patch envelopes and binary artifacts in the Edge Infrastructure Services console.

Overview

All ZCLI command procedures, organized by resource type.