Skip to main content
Use the ZEDEDA CLI (ZCLI) to manage policy documents from the command line. This article covers zcli doc-policy commands, with syntax and examples for each operation. A policy document is an HTML document, such as terms and conditions, that users of Edge Infrastructure Services must accept before they can onboard to the platform. Each policy can have several versions. The version that is marked as latest is the one that users are asked to accept.

Before You Start

  • ZCLI is installed and authenticated. See Get Started.
  • You have a role that allows you to manage platform policy documents. [TBD: confirm which role can run zcli doc-policy commands. The policies apply to all users of the platform, not to a single enterprise, so these commands might be limited to platform operators.]
  • To upload a policy, the policy is saved as a UTF-8 HTML file that ZCLI can read. If you run ZCLI in a container, the file must be inside the container. See Get Started.

How Policy Versions Work

  1. Create a version of a policy with doc-policy create. Creating a version does not show it to users.
  2. Publish the version with doc-policy mark-latest. New users are shown the latest version, and existing users are asked to accept it again.
  3. Delete versions that you no longer need with doc-policy delete.
You can keep several versions of the same policy at the same time. Each version is identified by the policy name and the version string, and each has its own ID.
mark-latest affects every user of the platform. All existing users are asked to accept the new latest version again. Review the policy text before you run it.

Create a Policy Version

Upload an HTML file as a new version of a policy.
Example:
On success, ZCLI prints nothing. To confirm the result, run zcli doc-policy show --all. Keep the following in mind when you prepare the file:
  • ZCLI reads the file as UTF-8 text and uploads its contents. It does not check that the file is valid HTML.
  • ZCLI opens the file for reading and writing, although it does not change the file. If you do not have write permission on the file, for example because it is on a read-only mount, ZCLI prints a Permission denied error and creates nothing. Copy the file to a writable location first.
  • Use a full path in --file-path. Your shell does not expand ~ after =, so the --file-path=~/policy/TnC.html form in zcli doc-policy --help fails with No such file or directory.

View Policy Versions

Show the policy versions that are marked as latest. Add --all to also show versions that are not marked as latest.
To show the versions that are marked as latest:
To show all versions:
The text output shows each version’s policy, version, and file URL. It does not show the version’s ID, which you need for download and delete. To see the ID and all other fields, use JSON output:
The example zcli doc-policy --all in zcli doc-policy --help leaves out show. If you run it as written, ZCLI prints the usage text. Use zcli doc-policy show --all.

Download a Policy Version

Download the HTML of one policy version by its ID.
Example:
ZCLI saves the policy text in the current working directory as <policyFileId>.json. Although the file name ends in .json, the file contains the policy HTML. Rename it to .html to open it in a browser. The ID is shown as optional in the syntax, but it is required in practice. If you leave it out, ZCLI requests a policy with the ID None.

Publish a Policy Version

Mark one version of a policy as the latest version. Users are asked to accept the latest version. See How Policy Versions Work.
Example:
On success, ZCLI prints nothing. To confirm the result, run zcli doc-policy show.

Delete a Policy Version

Delete one policy version by its ID. To find the ID, see View Policy Versions. ZCLI asks Delete Doc Policy <uuid>? [Y/N] unless you pass -f. If you answer no, ZCLI prints Doc policy with id <uuid> not deleted.
Example:

Next Steps

Manage Users

Create users and manage their access to Edge Infrastructure Services.

Get Started

Install ZCLI, configure access to Edge Infrastructure Services, and work with local files.

Command Index

Every ZCLI command group and where to find its procedures.

Overview

All ZCLI command procedures, organized by resource type.