Updated on 2023-09-14 GMT+08:00

Modifying a Permanent Access Key

Function

This API can be used by the administrator to modify the specified permanent access key of an IAM user or used by an IAM user to modify one of their own permanent access keys.

The API can be called using both the global endpoint and region-specific endpoints.

URI

PUT /v3.0/OS-CREDENTIAL/credentials/{access_key}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

access_key

Yes

String

AK of the access key to be modified.

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Fill application/json;charset=utf8 in this field.

X-Auth-Token

Yes

String

If the administrator is requesting to modify a specified permanent access key of an IAM user, see Actions.

If an IAM user is requesting to modify one of their own permanent access keys, the user token (no special permission requirements) of the user is required.

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

credential

Yes

Object

Authentication information.

Table 4 credential

Parameter

Mandatory

Type

Description

status

No

String

Status of the access key.

Options:

  • active: Enabled
  • inactive: Disabled

description

No

String

Description of the access key.

Response Parameters

Table 5 Parameters in the response body

Parameter

Type

Description

credential

Object

Authentication information.

Table 6 credential

Parameter

Type

Description

user_id

String

IAM user ID.

access

String

AK.

status

String

Status of the access key.

Options:

  • active: Enabled
  • inactive: Disabled

create_time

String

Time when the access key was created.

NOTE:

The value is a UTC time in the YYYY-MM-DDTHH:mm:ss.ssssssZ format, for example, 2023-06-28T08:56:33.710000Z. For details about the date and timestamp formats, see ISO-8601.

description

String

Description of the access key.

Example Request

Request for an IAM user to disable their specific permanent access key

PUT https://iam.myhuaweicloud.eu/v3.0/OS-CREDENTIAL/credentials/{access_key}
{
    "credential": {
        "status": "inactive",
        "description": "IAMDescription"
    }
}

Example Response

Status code: 200

The request is successful.

{
    "credential": {
        "status": "inactive",
        "access": "LOSZM4YRVLKOY9...",
        "create_time": "2020-01-08T06:26:08.123059Z",
        "user_id": "07609fb9358010e21f7bc00375..."
    }
}

Status Codes

Status Code

Description

200

The request is successful.

400

Invalid parameters.

401

Authentication failed.

403

Access denied.

404

The requested resource cannot be found.

500

Internal server error.

Error Codes

None