Copy
Ask AI
cpln policy [SUBCOMMAND]
Copy
Ask AI
Commands:
cpln policy access-report <ref> Show the access report for the referenced policy
cpln policy add-binding <ref> Bind one or more permissions to the referenced policy and associate it with one or more users / service accounts / groups / identities
cpln policy clone <ref> Clone a policy [aliases: copy]
cpln policy create Create a new policy
cpln policy delete <ref...> Delete one or more referenced policies
cpln policy edit <ref> Edit the referenced policy, as YAML, within an editor
cpln policy eventlog <ref> Show the event log of the referenced policy [aliases: log]
cpln policy get [ref...] Retrieve one or more referenced policies
cpln policy patch <ref> Update the referenced policy's metadata using an input file
cpln policy permissions Show the grantable permissions for a policy object type
cpln policy query Find all the policies based on the given query
cpln policy remove-binding <ref> Remove the bindings of one or more permissions from the referenced policy and disassociate it from one or more users / service accounts / groups / identities
cpln policy tag <ref...> Manage the tags belonging to one or more referenced policies
cpln policy update <ref> Update properties of the referenced policy
Options:
--help Show help [boolean]
policy access-report
Show the access report for the referenced policy UsageCopy
Ask AI
cpln policy access-report <ref> [OPTIONS]
Reference
Reference
Copy
Ask AI
Positionals:
ref The resource reference. Usually it is the name of the resource. [required]
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
Copy
Ask AI
cpln policy access-report demo-policy --org demo-cpln-organization
policy add-binding
Bind one or more permissions to the referenced policy and associate it with one or more users / service accounts / groups / identities UsageCopy
Ask AI
cpln policy add-binding <ref> --permission PERMISSION_NAME COMMAND_OPTIONS [OPTIONS]
Reference
Reference
Copy
Ask AI
Positionals:
ref The resource reference. Usually it is the name of the resource. [required]
Command options:
--email User email to add permission
--serviceaccount Service account name to add permission
--group Group name to add permission
--identity Identity name OR link to add permission
--permission Permission to add [required]
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
--gvc Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
- Bind the view permission to the referenced policy named `demo-policy-add-binding` and associate it with the built-in controlplane service account
Copy
Ask AI
cpln policy add-binding demo-policy --permission view --serviceaccount controlplane --org demo-cpln-organization
policy clone
Clone a policy UsageCopy
Ask AI
cpln policy clone <ref> --name CLONE_NAME [OPTIONS]
Reference
Reference
Copy
Ask AI
Positionals:
ref The resource reference. Usually it is the name of the resource. [required]
Command options:
--name Set the name for the clone [required]
--description Optional description, defaults to the name if not set
--tag Attach tags (e.g., --tag drink=water)
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
Copy
Ask AI
cpln policy clone demo-policy --name demo-policy-clone --org demo-cpln-organization
policy create
Create a new policy UsageCopy
Ask AI
cpln policy create --name POLICY_NAME --target-kind TARGET [OPTIONS]
Reference
Reference
Copy
Ask AI
Command options:
--name Name of the new policy, type - to generate a valid name [required]
--description, --desc Optional description, defaults to the name if not set
--target-kind Select a target kind for this policy [required] [choices: "account", "agent", "auditctx", "cloudaccount", "domain", "dbcluster", "group", "gvc", "identity", "image", "location", "memcachecluster", "org", "policy", "quota", "secret", "serviceaccount", "spicedbcluster", "task", "user", "volumeset", "workload"]
--all Apply policy to all instances of the kind [boolean]
--resource Enumerate resource names to add to the policy
--tag Attach tags (e.g., --tag drink=water)
Query spec options:
--query-match Query filter type [choices: "all", "none", "any"] [default: "all"]
--query-property Property to query
--query-tag Tag to query
--query-rel Relation to query
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
Copy
Ask AI
cpln policy create --name demo-policy --target-kind org --all --desc demo-policy --tag drink=water --org demo-cpln-organization
policy delete
Delete one or more referenced policies UsageCopy
Ask AI
cpln policy delete <ref...> [OPTIONS]
Deleting a policy will remove all associated resources (targets, bindings, etc.)
Reference
Reference
Copy
Ask AI
Positionals:
ref One or more resource references. Usually it is the name of the resource. [array] [required] [default: []]
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
Copy
Ask AI
cpln policy delete demo-policy --org demo-cpln-organization
policy edit
Edit the referenced policy, as YAML, within an editor UsageCopy
Ask AI
cpln policy edit <ref> [OPTIONS]
The default editor can be set by using the EDITOR environment variable.
Reference
Reference
Copy
Ask AI
Positionals:
ref The resource reference. Usually it is the name of the resource. [required]
Command options:
--replace, -r Replace instead of patch/merge [boolean] [default: false]
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
Copy
Ask AI
cpln policy edit demo-policy --org demo-cpln-organization
policy eventlog
Show the event log of the referenced policy UsageCopy
Ask AI
cpln policy eventlog <ref> [OPTIONS]
Reference
Reference
Copy
Ask AI
Positionals:
ref The resource reference. Usually it is the name of the resource. [required]
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
Copy
Ask AI
cpln policy eventlog demo-policy --org demo-cpln-organization
policy get
Retrieve one or more referenced policies UsageCopy
Ask AI
cpln policy get [ref...] [OPTIONS]
An empty reference will return all references
Reference
Reference
Copy
Ask AI
Positionals:
ref One or more resource references. Usually it is the name of the resource. [array] [default: []]
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
- Get all policies
Copy
Ask AI
cpln policy get --org demo-cpln-organization
- Get one policy
Copy
Ask AI
cpln policy get demo-policy-get-1 --org demo-cpln-organization
- Get multiple policies
Copy
Ask AI
cpln policy get demo-policy-get-1 demo-policy-get-2 --org demo-cpln-organization
policy patch
Update the referenced policy’s metadata using an input file UsageCopy
Ask AI
cpln policy patch <ref> --file FILE_NAME [OPTIONS]
Running this command with the option
--file - sets the input to stdin. The input is required to be a valid JSON or YAML string (e.g., {"description": "My new description"} or description: My new description). To complete the update, press Control-D (or Control-Z if you are using Windows).Reference
Reference
Copy
Ask AI
Positionals:
ref The resource reference. Usually it is the name of the resource. [required]
Command options:
--file, -f File to load the patch from. Use `--file -` to enable input from stdin. [required]
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
Copy
Ask AI
cpln policy patch demo-policy --file update.json --org demo-cpln-organization
policy permissions
Show the grantable permissions for a policy object type UsageCopy
Ask AI
cpln policy permissions [OPTIONS]
Reference
Reference
Copy
Ask AI
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
Copy
Ask AI
cpln policy permissions --org demo-cpln-organization
policy query
Find all the policies based on the given query UsageCopy
Ask AI
cpln policy query QUERY_OPTIONS [OPTIONS]
Reference
Reference
Copy
Ask AI
Query options:
--match Query filter type [choices: "all", "none", "any"] [default: "all"]
--property, --prop Property to query
--tag Tag to query
--rel Tag to query
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
Use the
--match option to display all, none, or any of the results based on a given property or tag- Search for a policy based on the name property
Copy
Ask AI
cpln policy query --match any --prop name=demo-policy --org demo-cpln-organization
- Search for a policy based on the description property
Copy
Ask AI
cpln policy query --match any --prop description="demo-policy" --org demo-cpln-organization
- Search for a policy based on a tag
Copy
Ask AI
cpln policy query --match any --tag drink=water --org demo-cpln-organization
- Search for a policy based on a property and tag
Copy
Ask AI
cpln policy query --match any --prop description="demo-policy" --tag drink=water --org demo-cpln-organization
policy remove-binding
Remove the bindings of one or more permissions from the referenced policy and disassociate it from one or more users / service accounts / groups / identities UsageCopy
Ask AI
cpln policy remove-binding <ref> --permission PERMISSION_NAME COMMAND_OPTIONS [OPTIONS]
Reference
Reference
Copy
Ask AI
Positionals:
ref The resource reference. Usually it is the name of the resource. [required]
Command options:
--email User email to remove permission
--serviceaccount Service account name to remove permission
--group Group name to remove permission
--identity Identity name OR link to remove permission
--permission Permission to remove [required]
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
--gvc Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
- Remove the binding of the view permission from the policy named
demo-policyand disassociate it with the built-in controlplane service account.
Copy
Ask AI
cpln policy remove-binding demo-policy --permission manage --serviceaccount controlplane --org demo-cpln-organization
policy tag
Manage the tags belonging to one or more referenced policies UsageCopy
Ask AI
cpln policy tag <ref...> --tag KEY=VALUE [OPTIONS]
Built-in tags, which begin with cpln/*, can’t be modified.
Reference
Reference
Copy
Ask AI
Positionals:
ref One or more resource references. Usually it is the name of the resource. [array] [required] [default: []]
Command options:
--tag Attach tags (e.g., --tag drink=water)
--remove Remove tags (e.g., --remove tagname)
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Example
Example
- Add a tag to a policy
Copy
Ask AI
cpln policy tag demo-policy-tag-1 --tag drink=water --org demo-cpln-organization
- Update same tag (after running the example above)
Copy
Ask AI
cpln policy tag demo-policy-tag-1 --tag drink=coffee --org demo-cpln-organization
- Remove tag (after running the example above)
Copy
Ask AI
cpln policy tag demo-policy-tag-1 --remove drink --org demo-cpln-organization
- Add same tag to multiple policies
Copy
Ask AI
cpln policy tag demo-policy-tag-1 demo-policy-tag-2 --tag multiple-policies=true --org demo-cpln-organization
- Update same tag on multiple policies (after running the example above)
Copy
Ask AI
cpln policy tag demo-policy-tag-1 demo-policy-tag-2 --tag multiple-policies=demo-policy --org demo-cpln-organization
- Remove same tag from multiple policies (after running the example above)
Copy
Ask AI
cpln policy tag demo-policy-tag-1 demo-policy-tag-2 --remove multiple-policies --org demo-cpln-organization
policy update
Update properties of the referenced policy UsageCopy
Ask AI
cpln policy update <ref> --set UPDATE_PROPERTY [OPTIONS]
Reference
Reference
Copy
Ask AI
Positionals:
ref The resource reference. Usually it is the name of the resource. [required]
Update Properties:
--set Update the following properties (e.g., --set description="Updated Description"):
description string
tags.<key> string
targetLinks string[]
target { 'all' }
Arrays can be appended to, replaced, or removed using the `+=`, `=`, or `-=` operators, respectively. [required]
Context options:
--profile Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
--org Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
Format options:
--output, -o Set the output format [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
--color Colorize the output [boolean] [default: true]
--ts Timestamp format if the output format is text (e.g., --output=text) [choices: "iso", "local", "age"]
--max Maximum number of records to show. A value less than 1 will return all records. [number] [default: 50]
Request options:
--token Override the authorization token
--endpoint Override the API URL
--insecure, -k Ignore TLS errors [boolean]
Debug options:
--verbose, -v Enable verbose output to stderr [boolean] [default: false]
--debug, -d Show all HTTP communications [boolean] [default: false]
Options:
--help Show help [boolean]
Options
Options
- The
--setoption allows the modification of the following policy properties:description- Description of the policy
- Type: string
tags- Tags (key=value) associated with the policy
- Type: string
targetLinks- Array of target links belonging to the policy
- Type: string
target- The target of the policy
- Type: string
- Allowed values: ‘all’
Example
Example
- For the examples below, the initial policy is configured as:
Copy
Ask AI
+------------+------------+--------------+------------+--------+--------+--------------+
|NAME |DESCRIPTION |CREATED |TARGET KIND |MATCHES |ORIGIN |TAGS |
|------------|------------|--------------|------------|--------|--------|--------------|
|demo-policy |demo-policy |0 minutes ago |org |all |default |drink="water" |
+------------+------------+--------------+------------+--------+--------+--------------+
- Update a policy’s description
Copy
Ask AI
cpln policy update demo-policy --set description="new description" --org demo-cpln-organization
- Update a policy’s tags
Copy
Ask AI
cpln policy update demo-policy --set tags.demo-key=demo-value --org demo-cpln-organization
- Add to a policy’s target links.
Copy
Ask AI
cpln policy update demo-policy --set targetLinks+="/org/demo-cpln-organization/gvc/demo-gvc-policy" --org demo-cpln-organization
- Remove from a policy’s target links.
Copy
Ask AI
cpln policy update demo-policy --set targetLinks-="/org/demo-cpln-organization/gvc/demo-gvc-policy" --org demo-cpln-organization
- Update a policy’s target to all
Copy
Ask AI
cpln policy update demo-policy --set target=all --org demo-cpln-organization