Créer une access key
Vous pouvez créer une access key pour votre compte. Les access keys vous permettent de signer vos requêtes API. La nouvelle access key est automatiquement spécifiée comme ACTIVE
, lui permettant de signer des requêtes.
Pour utiliser l’API et pour signer vos requêtes, vous devez retrouver dans Cockpit l’une des access keys déjà créées pour votre compte. Pour en savoir plus, voir Obtenir des informations sur vos access keys.
Créer une access key avec Cockpit v2
-
Dans le coin supérieur droit, cliquez sur l’icône .
Un menu déroulant apparaît. -
Cliquez sur Access keys.
La liste de vos access keys apparaît. -
Cliquez sur Créer une access key.
La boîte de dialogue CRÉER UNE ACCESS KEY apparaît. -
(optionnel) Appliquez une date d’expiration.
Il est de bonne pratique d’appliquer une date d’expiration et de renouveler votre access key régulièrement.
-
Cliquez sur Créer.
Votre access key est créée. -
Cliquez sur pour copier l’access key ou la secret key, ou cliquez sur Télécharger pour télécharger un fichier contenant la secret key.
Pour des raisons de sécurité, la secret key est seulement disponible lorsque vous créez l’access key. Sauvegardez-la avec soin, car vous ne pourrez pas la retrouver ultérieurement.
Créer une access key avec OSC CLI
À ce jour, cette section est disponible en anglais uniquement. |
The CreateAccessKey command creates an access key for either your root account or an EIM user. The new key is automatically set to ACTIVE
.
For more information, see About Access Keys.
$ osc-cli api CreateAccessKey --profile "default" \
--ExpirationDate "2063-04-05"
$ osc-cli api CreateAccessKey --profile "default" --authentication-method "password" --login "$OSC_EMAIL" --password "$OSC_PASSWORD" \
--ExpirationDate "2063-04-05"
This command contains the following attributes that you need to specify:
-
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
, or2020-06-14
). To remove an existing expiration date, use the method without specifying this parameter. -
UserName
: (optional) The name of the EIM user that owns the key to be created. If you do not specify a user name, this action creates an access key for the user who sends the request (which can be the root account).
The CreateAccessKey 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. -
SecretKey
: The secret key that enables you to send requests. -
State
: The state of the access key (ACTIVE
if the key is valid for API calls, orINACTIVE
if not).
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"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",
"SecretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"LastModificationDate": "2010-10-01T12:34:56.789+0000"
}
}
Créer une access key avec oapi-cli
À ce jour, cette section est disponible en anglais uniquement. |
The CreateAccessKey command creates an access key for either your root account or an EIM user. The new key is automatically set to ACTIVE
.
For more information, see About Access Keys.
$ oapi-cli --profile "default" CreateAccessKey \
--ExpirationDate "2063-04-05"
$ oapi-cli --profile "default" --login "$OSC_EMAIL" --password "$OSC_PASSWORD" CreateAccessKey \
--ExpirationDate "2063-04-05"
This command contains the following attributes that you need to specify:
-
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
, or2020-06-14
). To remove an existing expiration date, use the method without specifying this parameter. -
UserName
: (optional) The name of the EIM user that owns the key to be created. If you do not specify a user name, this action creates an access key for the user who sends the request (which can be the root account).
The CreateAccessKey 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. -
SecretKey
: The secret key that enables you to send requests. -
State
: The state of the access key (ACTIVE
if the key is valid for API calls, orINACTIVE
if not).
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"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",
"SecretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"LastModificationDate": "2010-10-01T12:34:56.789+0000"
}
}
Pages connexes
Méthodes API correspondantes