set_preferred_credential
Sets a named credential as a target-preferred credential for the user.
Format
emcli set_preferred_credential -set_name="set_name" -target_name="target_name" -target_type="ttype" -credential_name="cred_name" [-credential_owner ="owner]" [-test] [ ] indicates that the parameter is optional
Options
-
set_name
Sets the preferred credential for this credential set.
-
target_name
Sets the preferred credential for this target.
-
target_type
Target type for the target/credential set.
-
credential_name
Name of the credential.
-
credential_owner
Owner of the credential. This defaults to the currently logged in user.
-
test
Tests the credential against the target_name before setting the preferred credential.
Examples
Example 1
This example sets the named credential MyHostCredentials as the target preferred credential for the target test.example.com:host as HostCredsNormal.
emcli set_preferred_credential -set_name=HostCredsNormal -target_name=test.oracle.com -target_type=host -credential_name=MyHostCredentials -credential_owner="Joe"
Example 2
This example sets the named credential MyDBCredentials as the target preferred credential for the target myDB:oracle_database as Normal Database Credentials. The command tests the named credential against myDB:oracle_database before setting the preferred credential.
emcli set_preferred_credential -target_type=oracle_database -target_name=myDB -set_name=DBCredsNormal -credential_name=MyDBCredentials -credential_owner="Joe" -test