Managing policies with the CLI
The policy command tool can be used to list policy objects, evaluate policies or objects, or evaluate policies or objects and apply the evaluated actions.
This section includes:
Policy tool CLI commands
Option | Argument | Description |
---|---|---|
| Name | The agent policy to evaluate. Outputs a list of actions that the agent policy can apply. |
| Name | Evaluates an agent policy group. Outputs a list of actions that the agent policy group can apply. |
| Not applicable | Apply the evaluated actions. If not specified, policies are evaluated only. Actions are not applied, but the evaluated actions are output. |
| Name | Application Service hostname. |
| Number | Application Service port number. |
| filename | Write action output to a CSV format file. |
| agent_policy_name | Deep copies an agent policy (requires --prefix and/or --suffix and requires --deep-copy-option and optionally --disable-deep-copy-policy-components). |
| agent_policy_group_name | Deep copies an agent policy group (requires --prefix and/or --suffix and requires --deep-copy-option and optionally --disable-deep-copy-policy-components). |
| object_policy_name | Deep copies an object policy (requires --object-policy-type and requires --deep-copy-option and optionally --disable-deep-copy-policy-components). |
| object_policy_group_name | Deep copies an object policy group (requires --prefix and/or --suffix and requires --deep-copy-option and optionally --disable-deep-copy-policy-components). |
| object_policy_group_name | The deep copy option specifying what to do if a copied policy component name already exists. fail - fail when duplicate policy component name exists replace - replace the existing named policy component with the copied one use - use the existing named policy component instead of the copied one |
| Not applicable | Disable all deep copied policy components. Otherwise, they are enabled. |
| Not applicable | Includes example evaluation output (requires an evaluation option). |
| Filename | Write action output to a JSON format file. |
| Not applicable | List all agent policies. |
| Not applicable | List all agent policy groups. |
| Not applicable | List all object policies. |
| Not applicable | Lists all object policy groups. |
| Topic name path | Requires --object-type-path. Name path of an object to evaluate against all policies. E.g. "myHost!myQmgr!myQueue". Outputs a list of actions that apply to the object. |
| Topic type path | Requires --object-name-path. Type path of an object to evaluate against all policies. E.g. ComMQSoftwareNetworkHost!ComMQSoftwareWebSphereMQQueueManager!ComMQSoftwareMQLocalQueue". Outputs a list of actions that apply to the object. |
| Name | Requires --object-policy-type. The object policy to evaluate. Outputs a list of actions that apply to the object policy. |
| Type name | Requires --object-policy. The type name of the object policy to evaluate (e.g. "ComMQSoftwareNetworkHost"). Outputs a list of actions that apply to the object policy. |
| Name | The object policy group to evaluate. Outputs a list of actions that apply to the object group policy. |
| prefix | Prefix prepended to the policy component to form a new deep copy name. |
| suffix | Suffix appended to the policy component to form a new deep copy name. |
| Not applicable | Print out usage information. |
| Not applicable | Run in batch mode Runs the command in batch mode. Without this flag, you are prompted to press the Enter key (or to press Ctrl+c to cancel) before the command is processed. This flag disables that request. |
| Password | Password. Use this password to access the services. |
| Not applicable | Specify password via stdin. This is mutually exclusive with -p. |
| Not applicable | Runs silently. Suppresses output of evaluations. Ignored for list options. |
Examples of how to use the Policy commands from the CLI
Goal | Command |
---|---|
List agent policies | % policytool -b -p BMCSOFTWARE SA --list-agent-policies |
Evaluate the "WMQ_Agents" agent policy, output the actions to a JSON format file, but do not apply the actions. | % policytool -b -p BMCSOFTWARE SA --agent-policy "WMQ_Agents" --json actions.json |
Evaluate the "WMQ_Agents" agent policy, output the actions to the console, and apply the actions. |
|
Evaluate an agent host against all matching policies and output the actions to the console, but do not apply the actions. | % policytool -b -p BMCSOFTWARE SA --object-name-path "myAgent" --object-type-path "ComMQSoftwareNetworkHost" |
Comments
Log in or register to comment.