Modify an API key
Modify the name of an API key or switch its status between Enabled and Disabled. The associated cloud service and expiration time cannot be changed after creation.
Modify the name of an API key for easier identification or switch its status between Enabled and Disabled. The cloud service (ServiceName) and expiration time (ExpirationTime) are fixed upon creation. To change them, create a new API key and delete the original credential.
Modifiable fields
|
Field |
Modifiable |
Description |
|
Name (ServiceCredentialName) |
Yes |
You can modify the name in the console or by calling the |
|
Status (Status) |
Yes |
You can switch the status between |
|
Cloud Service (ServiceName) |
No |
Set at creation. To use a different cloud service, create a new API key. |
|
Expiration Time (ExpirationTime) |
No |
Cannot be changed after creation. To use a different validity period, delete the current credential and create a new one. |
Rename an API key
-
Log on to the RAM console and go to the Credential Management tab of the target RAM user.
-
In the target row of the API Keys list, click the Edit icon to the right of the Name column.
-
In the Rename API Key dialog box, enter a new name, and click OK.
Enable and disable an API key
A disabled API key is invalid. All API calls that use the credential will fail until you re-enable the key. You must disable an API key before you can delete it. For more information, see Delete an API key.
Disable in the console
-
In the Actions column for the target API key, click Disable.
-
In the Disable confirmation dialog box, confirm the message ("disable API Key {Name}?") and click Disable.
-
The status of the credential in the list changes to Disabled, and the Enable and Delete buttons appear in the Actions column.
Disabling an API key takes effect immediately and interrupts services that rely on it. Before you proceed, ensure all callers have switched to a different credential.
Enable in the console
-
In the row for the disabled API key, click Enable.
-
In the Enable confirmation dialog box, click Enable. The status changes back to Enabled.
An expired API key (Expired) cannot be enabled and must be re-created.
Change status by API
Call the UpdateServiceCredential operation and set the Status parameter to Active or Inactive.
UpdateServiceCredential parameters
|
Parameter |
Type |
Required |
Description |
|
ServiceCredentialId |
String |
Yes |
The ID of the service credential to modify. |
|
UserPrincipalName |
String |
Yes |
The logon name of the RAM user. |
|
ServiceCredentialName |
String |
No |
The new name for the API key. If this parameter is omitted, the name remains unchanged. |
|
Status |
String |
No |
The new status of the API key. Valid values: |