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.
- For external artifacts, create a patch artifact image and add its file. See Create the Patch Artifact Image.
- Describe the artifacts in an artifact configuration file. See Write the Artifact Configuration File.
- Create the patch envelope with
zcli patch-envelope create. - Attach the patch envelope to application instances with
zcli edge-app-instance patch-envelope-attach. See Attach a Patch Envelope to Application Instances. - Set the patch envelope to the active state, if you did not create it active.
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.
-
Create the image record:
-
Upload the file:
READY. Then find the image ID, which the artifact configuration file needs:
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):
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.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:
--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 Artifactstable with each inline artifact’s ID, metadata, file name, and base64 data. - An
External Artifactstable 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.
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:
MY_PROJECT:
Attach a Patch Envelope to Application Instances
ZCLI attaches and detaches patch envelopes withzcli 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
--app-instance for each application instance. The following example attaches a patch envelope to two application instances:
Detach a patch envelope
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.--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.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.