Set a named credential as preferred credential
post
https://EM_HOST:EM_CONSOLE_HTTPS_PORT/em/api/namedCredentials/actions/setPreferredCredential
Sets an existing named credential as preferred for the target type/target instance and set name provided in the payload.
Request
There are no request parameters for this operation.
Supported Media Types
- application/json
Root Schema : schema
Type:
object
Schema object to hold Preferred Credential data required in the setPreferredCredential action. credGuid can be passed or credName and credOwner combination in order to find the named credential to set as preferred.
Show Source
-
authenticationTargetType: string
The authenticating target type. Defaults to targetTypeNameExample:
host
-
credGuid: string
Unique identifier for a named credentialExample:
B0FBBE587FD201E2E0537013790A7D03
-
credName: string
Name for a named credentialExample:
NAMEDCRED1
-
credOwner: string
User owner of the named credentialExample:
SYSMAN
-
forUser: string
User for which preferred credential is being setExample:
SYSMAN
-
isAuthenticationRequired: boolean
true if authentication is required before saving credentialExample:
false
Match All
Show Source
-
object
PreferredCredentialCommon
Common schema object to hold Preferred Credential data
Nested Schema : PreferredCredentialCommon
Type:
object
Common schema object to hold Preferred Credential data
Show Source
-
isDefault(required): boolean
true when preferred credential is target type level. false when it is target instance levelExample:
false
-
isGlobal(required): boolean
true when preferred credential is global scope. false when it is User scope.Example:
true
-
setName(required): string
Name for a credential setExample:
HostCredsNormal
-
targetGuid: string
Target instance id of a preferred credential.Example:
A3CDDE587FD221E2F3539013290B7F05
-
targetName: string
Target instance name for which named credential is authenticated toExample:
host.us.oracle.com
-
targetTypeName: string
Name of the target typeExample:
host
Examples
Back to Top
Response
Supported Media Types
- application/json
200 Response
Preferred credential set successfully
Root Schema : PreferredCredential
Type:
object
Schema object to hold Preferred Credential data returned from the search action
Show Source
-
credGuid: string
Unique identifier for a named credentialExample:
B0FBBE587FD201E2E0537013790A7D03
-
isCredSetConfigured: boolean
true when preferred credential is configured for given case and link to NC is available. when effective value is there and not configured set as false but NC link is available. If no Preferred set at all then false and no link to NC.Example:
false
-
links: object
links
Read Only:
true
the credential name and target links associated to the preferred credentials -
targetTypeGuid: string
Unique identifier for target typeExample:
DD395385F69A25570431A719EEA45030
Match All
Show Source
-
object
PreferredCredentialCommon
Common schema object to hold Preferred Credential data
Nested Schema : links
Type:
object
Read Only:
true
the credential name and target links associated to the preferred credentials
Show Source
Nested Schema : PreferredCredentialCommon
Type:
object
Common schema object to hold Preferred Credential data
Show Source
-
isDefault(required): boolean
true when preferred credential is target type level. false when it is target instance levelExample:
false
-
isGlobal(required): boolean
true when preferred credential is global scope. false when it is User scope.Example:
true
-
setName(required): string
Name for a credential setExample:
HostCredsNormal
-
targetGuid: string
Target instance id of a preferred credential.Example:
A3CDDE587FD221E2F3539013290B7F05
-
targetName: string
Target instance name for which named credential is authenticated toExample:
host.us.oracle.com
-
targetTypeName: string
Name of the target typeExample:
host
Nested Schema : Link
Type:
object
Represents a link(could be self, previous or next)
Show Source
-
href: string
URL for LinkExample:
/em/api/<resources>?page=b2Zmc2V0OjA&limit=0
400 Response
Bad Request. The payload is null or missing some parameters
Root Schema : ErrorResponse
Type:
object
Error response
Show Source
-
code(required): string
A short error code that defines the error, meant for programmatic parsing
-
message(required): string
A human-readable error string
401 Response
Unauthorized. The user does not have permissions to perform the requested operation
Root Schema : ErrorResponse
Type:
object
Error response
Show Source
-
code(required): string
A short error code that defines the error, meant for programmatic parsing
-
message(required): string
A human-readable error string
403 Response
Forbidden. The user is forbidden to perform the requested operation
Root Schema : ErrorResponse
Type:
object
Error response
Show Source
-
code(required): string
A short error code that defines the error, meant for programmatic parsing
-
message(required): string
A human-readable error string
409 Response
Conflict
Root Schema : ErrorResponse
Type:
object
Error response
Show Source
-
code(required): string
A short error code that defines the error, meant for programmatic parsing
-
message(required): string
A human-readable error string
500 Response
Internal Server Error. Exception in execution of REST API.
Root Schema : ErrorResponse
Type:
object
Error response
Show Source
-
code(required): string
A short error code that defines the error, meant for programmatic parsing
-
message(required): string
A human-readable error string
503 Response
Service Unavailable. The server is unable to process the request.
Root Schema : ErrorResponse
Type:
object
Error response
Show Source
-
code(required): string
A short error code that defines the error, meant for programmatic parsing
-
message(required): string
A human-readable error string