Create a key
Learn how to create a new key.
subuser is specified then by default created keys will be swift type. If
only one of access-key or secret-key is provided the committed key
will be automatically generated, that is if only secret-key is specified then
access-key will be automatically generated. By default, a generated key is added to
the keyring without replacing an existing key pair. If access-key is specified and
refers to an existing key owned by the user then it will be modified. The response is a container
listing all keys of the same type as the key created.access-key will have no effect. Additionally, only one swift key might be
held by each user or subuser.Capabilities
`users=write`
Syntax
PUT /admin/user?key&format=json HTTP/1.1
Host FULLY_QUALIFIED_DOMAIN_NAME
Request Parameters
uid
- Description
-
The user ID to receive the new key.
- Type
-
String
- Example
-
foo_user - Required
-
Yes
subuser
- Description
-
The subuser ID to receive the new key.
- Type
-
String
- Example
-
sub_foo - Required
-
No
key-type
- Description
-
Key type to be generated, options are: swift, s3 (default).
- Type
-
String
- Example
-
s3[s3] - Required
-
No
access-key
- Description
-
Specify access key.
- Type
-
String
- Example
-
AB01C2D3EF45G6H7IJ8K - Required
-
No
secret-key
- Description
-
Specify secret key.
- Type
-
String
- Example
-
0ab/CdeFGhij1klmnopqRSTUv1WxyZabcDEFgHij - Required
-
No
generate-key
- Description
-
Generate a new key pair and add to the existing keyring.
- Type
-
Boolean
- Example
-
True [
True] - Required
-
No
Response Entities
keys
- Description
-
Keys of type created associated with this user account.
- Type
-
Container
- Parent
-
N/A
user
- Description
-
The user account associated with the key.
- Type
-
String
- Parent
-
keys
access-key
- Description
-
The access key.
- Type
-
String
- Parent
-
keys
secret-key
- Description
-
The secret key.
- Type
-
String
- Parent
-
keys
Special Error Responses
InvalidAccessKey
- Description
-
Invalid access key specified.
- Code
-
400 Bad Request
InvalidKeyType
- Description
-
Invalid key type specified.
- Code
-
400 Bad Request
InvalidSecretKey
- Description
-
Invalid secret key specified.
- Code
-
400 Bad Request
InvalidKeyType
- Description
-
Invalid key type specified.
- Code
-
400 Bad Request
KeyExists
- Description
-
Provided access key exists and belongs to another user.
- Code
-
409 Conflict