Policy Commands
The following commands are for profiles and confirmation policies.
This section includes the following:
Add Profile Attribute (-apa) Command
The add-profile-attribute command edits an existing profile by adding
a new component-setting to the profile. It may also be used to create a new
profile.
|
Parameter
|
-
-P profile – Specify the name of a new or existing profile.
-
-T component – Specify the name of the component to be included
in this profile.
-
-D distribution – Specify the distribution for which this profile
is relevant. If not specified, the command operates on all distributions.
|
|
Flag
|
-
-N – Marks
the component as Not Allowed.
-
-R – Marks
the component as Required.
-
-U – Marks
the component for upgrade if a newer version is available.
|
|
Syntax
|
uce_cli -apa -P "profile" -T "component" ( -N | -R | -U ) [ -D distribution ]
-u username -p password
|
|
Example
|
uce_cli -apa -P myWebSvr -T "httpd" -R -u admin -p 123
uce_cli -apa -P myWebSvr -T "httpd" -U -u admin -p 123
|
|
Result Example
|
The myWebSvr profile now has two more settings
than it originally had: now httpd components are Required and must be Updated.
If the profile did not exist before, it is created.
|
To get a valid value for a name of an existing profile for the -P parameter,
use the -lp command. To get a valid value for the -T parameter,
use the -fc command. To get a valid value for the -D parameter,
use the -ld command.
Add Policy Attribute (-aca) Command
The add-policy-attribute command edits an existing policy, by adding
a new component-action-answer to the policy. This command can also be used
to create a new policy.
|
Parameter
|
-
-C policy – Specify the name of a new or existing policy.
-
-T component – Specify the name of the component for which
the policy answers questions.
-
-D distribution – Specify the distribution for which this policy
is relevant. If not specified, the command operates on all distributions.
-
-install answer – Specify the policy value for installing a
component. Valid values are yes, no,
and ask_me.
-
-downgrade answer – Specify the policy value for downgrading
a component. Valid values are yes, no,
and ask_me.
-
-fix answer – Specify the policy value for fixing a component.
Valid values are yes, no, and ask_me.
-
-remove answer – Specify the policy value for removing a component.
Valid values are yes, no, and ask_me.
-
-upgrade answer – Specify the policy value for upgrading a
component. Valid values are yes, no,
and ask_me.
-
-ignore answer – Specify the policy value for ignoring file
conflicts. Valid values are yes, no,
and ask_me.
|
|
Syntax
|
uce_cli -aca -C "policy" -T "component" ( -install | -downgrade | -fix | -remove | -upgrade
| -ignore ) ( yes | no | ask_me ) [ -D distribution ]
-u username -p password
|
|
Example
|
uce_cli -aca -C newPolicy -T "User Interface" -remove no -u
admin -p 123
|
One action parameter, and only one, is mandatory, with a value of either yes, no, or ask_me.
To get a valid value for an existing policy name for the -C parameter,
use the -lc command; or use a new one to create a new policy.
To get a valid value for the -T parameter, use the -fc command.
To get a valid value for the -D parameter, use the -ld command.
Copy Profile (-cp) Command
The copy-profile command copies an existing profile to a new one. You
can then use -apa command to further customize the copied
profile.
|
Parameter
|
|
|
Syntax
|
uce_cli -cp -sP source-profile -tP target-profile -u username -p password
|
|
Example
|
uce_cli -cp -sP webServer -tP webServerHTTP -u admin -p 123
|
To get a valid value for the -sP parameter, use the -lp command.
Copy Policy (-cc) Command
The copy-policy command copies an existing policy to a new one. You
can then use the -aca command to further customize the copied
policy.
|
Parameter
|
|
|
Syntax
|
uce_cli -cc -sC source-policy -tC target-policy -u username -p password
|
|
Example
|
uce_cli -cc -sC SWAutoYes -tC SWYesKernelNo -u admin -p 123
|
To get valid values for the -sC parameter, use the -lc command.
Export (-exp) Command
The export command allows you to export Profiles or Inventories to XML
files. An Sun Update Connection – Enterprise object in XML format is easy to read and edit, and can
be manipulated as a file.
|
Parameter
|
-
-ent entity-type – Specify the type of the entity. Valid values
are Profile or Inventory.
-
-f pathname – Specify the full path name of the XML file
to which to export.
-
-T list – Specify a comma-separated list of profiles
to export or a list of hosts whose inventories are to be exported. If not
specified, all objects of type -ent are exported.
|
|
Syntax
|
uce_cli -exp -ent ( "Profile" | "Inventory" ) -f pathname.xml [ -T "profile,profile,..."
| "hostname,hostname,..."
] -u username -p password
|
|
Example
|
uce_cli -exp -ent "Profile" -f /home/stuff/httpSverProfile.xml
-u admin -p 123
|
|
Example
|
uce_cli -exp -ent "Inventory" -f /home/stuff/myHost.xml -u
admin -p 123
|
|
Example
|
uce_cli -exp -ent "Inventory" -T "lnx13,lnx10" -f /home/stuff/rpmsOf13-10.xml
-u admin -p 123
|
To get valid values for -T, use the -lp command
to see profiles, or the -lah to see hosts.
Be aware that as this command creates a file outside of Sun Update Connection – Enterprise, the
success of the command is dependent upon your user permissions: the machine
user executing the command has to have permissions to write to the path give
in the -f parameter.
Import (-imp) Command
The import command allows you to import XML files into Sun Update Connection – Enterprise and
convert them back to profiles.
|
Parameter
|
-f filename – Specify the full path name to the XML file
to import.
|
|
Syntax
|
uce_cli -imp -f path/filename.xml
-u username -p password
|
|
Example
|
uce_cli -imp -f /home/stuff/httpSverProfile.xml -u admin -p
123
|