Modifier une access key

Vous pouvez modifier l’état d’une access key pour définir si vous voulez l’utiliser pour signer une requête ou non, ainsi que sa date d’expiration. Pour en savoir plus, voir À propos des access keys.

Modifier une access key avec Cockpit v2

  1. Dans le coin supérieur droit, cliquez sur l’icône IconProfil.
    Un menu déroulant apparaît.

  2. Cliquez sur IconUserKey Access keys.
    La liste de vos access keys apparaît.

  3. Sélectionnez l’access key que vous voulez modifier.
    L’access key est sélectionnée.

  4. Cliquez sur IconEdit Modifier.
    La boîte de dialogue MODIFIER UNE ACCESS KEY apparaît.

  5. (optionnel) Dans la liste, sélectionnez une des valeurs suivantes :

    • Active : L’access key est utilisable pour signer les requêtes.

    • Désactivée : L’access key est inutilisable.

  6. (optionnel) Sélectionnez ou spécifiez la date et l’heure à laquelle vous voulez que votre access key expire.

  7. Cliquez sur Modifier.
    L’access key est modifiée.

Modifier une access key avec OSC CLI

À ce jour, cette section est disponible en anglais uniquement.

The UpdateAccessKey command modifies the attributes of the specified access key of either your root account or an EIM user.

Request sample: Updating the expiration date of the access key
$ osc-cli api UpdateAccessKey --profile "default" \
    --AccessKeyId "ABCDEFGHIJ0123456789" \
    --State "ACTIVE" \
    --ExpirationDate "2063-04-05"
Request sample: Updating one of your own access keys (if you are the root account or an EIM user)
$ osc-cli api UpdateAccessKey --profile "default" \
    --AccessKeyId "ABCDEFGHIJ0123456789" \
    --State "ACTIVE"
Request sample: Updating the access key of a specific EIM user
$ osc-cli api UpdateAccessKey --profile "default" \
    --AccessKeyId "ABCDEFGHIJ0123456789" \
    --State "ACTIVE" \
    --UserName "example-user"
Request sample: Example with login/password authentication
$ osc-cli api UpdateAccessKey --profile "default" --authentication-method "password" --login "$OSC_EMAIL" --password "$OSC_PASSWORD" \
    --AccessKeyId "ABCDEFGHIJ0123456789" \
    --State "ACTIVE" \
    --UserName "example-user"

This command contains the following attributes that you need to specify:

  • AccessKeyId: The ID of the access key.

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • ExpirationDate: (optional) The date and time, or the date, at which you want the access key to expire, in ISO 8601 format (for example, 2020-06-14T00:00:00.000Z or 2020-06-14). If not specified, the access key is set to not expire.

  • State: The new state for the access key (ACTIVE | INACTIVE). When set to ACTIVE, the access key is enabled and can be used to send requests. When set to INACTIVE, the access key is disabled.

  • UserName: (optional) The name of the EIM user that the access key you want to modify is associated with. If you do not specify a user name, this action modifies the access key of the user who sends the request (which can be the root account).

The UpdateAccessKey command returns the following elements:

  • AccessKey: Information about the access key.

    • AccessKeyId: The ID of the access key.

    • CreationDate: The date and time (UTC) at which the access key was created.

    • ExpirationDate: The date and time (UTC) at which the access key expires.

    • LastModificationDate: The date and time (UTC) at which the access key was last modified.

    • State: The state of the access key (ACTIVE if the key is valid for API calls, or INACTIVE if not).

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "AccessKey": {
    "State": "ACTIVE",
    "AccessKeyId": "ABCDEFGHIJ0123456789",
    "CreationDate": "2010-10-01T12:34:56.789+0000",
    "ExpirationDate": "2063-04-05T00:00:00.000+0000",
    "LastModificationDate": "2017-05-10T12:34:56.789+0000"
  }
}

Modifier une access key avec oapi-cli

À ce jour, cette section est disponible en anglais uniquement.

The UpdateAccessKey command modifies the attributes of the specified access key of either your root account or an EIM user.

Request sample: Updating the expiration date of the access key
$ oapi-cli --profile "default" UpdateAccessKey \
    --AccessKeyId "ABCDEFGHIJ0123456789" \
    --State "ACTIVE" \
    --ExpirationDate "2063-04-05"
Request sample: Updating one of your own access keys (if you are the root account or an EIM user)
$ oapi-cli --profile "default" UpdateAccessKey \
    --AccessKeyId "ABCDEFGHIJ0123456789" \
    --State "ACTIVE"
Request sample: Updating the access key of a specific EIM user
$ oapi-cli --profile "default" UpdateAccessKey \
    --AccessKeyId "ABCDEFGHIJ0123456789" \
    --State "ACTIVE" \
    --UserName "example-user"
Request sample: Example with login/password authentication
$ oapi-cli --profile "default" --login "$OSC_EMAIL" --password "$OSC_PASSWORD" UpdateAccessKey \
    --AccessKeyId "ABCDEFGHIJ0123456789" \
    --State "ACTIVE" \
    --UserName "example-user"

This command contains the following attributes that you need to specify:

  • AccessKeyId: The ID of the access key.

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • ExpirationDate: (optional) The date and time, or the date, at which you want the access key to expire, in ISO 8601 format (for example, 2020-06-14T00:00:00.000Z or 2020-06-14). If not specified, the access key is set to not expire.

  • State: The new state for the access key (ACTIVE | INACTIVE). When set to ACTIVE, the access key is enabled and can be used to send requests. When set to INACTIVE, the access key is disabled.

  • UserName: (optional) The name of the EIM user that the access key you want to modify is associated with. If you do not specify a user name, this action modifies the access key of the user who sends the request (which can be the root account).

The UpdateAccessKey command returns the following elements:

  • AccessKey: Information about the access key.

    • AccessKeyId: The ID of the access key.

    • CreationDate: The date and time (UTC) at which the access key was created.

    • ExpirationDate: The date and time (UTC) at which the access key expires.

    • LastModificationDate: The date and time (UTC) at which the access key was last modified.

    • State: The state of the access key (ACTIVE if the key is valid for API calls, or INACTIVE if not).

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "AccessKey": {
    "State": "ACTIVE",
    "AccessKeyId": "ABCDEFGHIJ0123456789",
    "CreationDate": "2010-10-01T12:34:56.789+0000",
    "ExpirationDate": "2063-04-05T00:00:00.000+0000",
    "LastModificationDate": "2017-05-10T12:34:56.789+0000"
  }
}

Pages connexes

Méthodes API correspondantes