2.2. PUT Service ostor-users

2.2.1. Description

Creates a new user or generates/revokes access key pairs of existing users.

2.2.2. Requests

2.2.2.1. Syntax

PUT /?ostor-users&emailAddress=<value> HTTP/1.1
Host: s3.amazonaws.com
Date: <date>
Authorization: <authorization_string>
PUT /?ostor-users&emailAddress=<value>&genKey HTTP/1.1
Host: s3.amazonaws.com
Date: <date>
Authorization: <authorization_string>
PUT /?ostor-users&emailAddress=<value>&revokeKey=<value> HTTP/1.1
Host: s3.amazonaws.com
Date: <date>
Authorization: <authorization_string>

2.2.2.2. Parameters

Parameter Description Required
emailAddress

User email address.

Type: string.

Default value: none.

Yes
genKey

Generates a new access key pair for the user. A user can only have two key pairs.

Type: flag.

Default value: none.

No
revokeKey

Removes the access key pair that corresponds to the specified access key.

Type: string.

Default value: none.

No

If neither genKey nor revokeKey are set, a new user with the specified email will be created.

2.2.2.3. Headers

This implementation uses only common request headers.

2.2.3. Responses

2.2.3.1. Headers

This implementation uses only common response headers.

2.2.3.2. Body

If a new user is created or a key is generated, the body is a JSON dictionary with user information.

{
"UserEmail" : "<email>",
"UserId" : "<id>",
"AWSAccessKeys : [
{
"AWSAccessKeyId" : "<access_key>",
"AWSSecretAccessKey" : "<secret_key>"
}]
}

If a key is revoked, the body is empty.

2.2.4. Examples

2.2.4.1. Sample Request #1

Creates a user with the email test@test.test.

PUT /?ostor-users&emailAddress=test@test.test HTTP/1.1
Host: s3.amazonaws.com
Date: Thu, 07 Apr 2016 16:01:03 GMT +3:00
Authorization: <authorization_string>

2.2.4.2. Sample Response #1

HTTP/1.1 200 OK
x-amz-req-time-micros : 186132
Transfer-encoding : chunked
Server : nginx/1.8.1
Connection : keep-alive
X-amz-request-id : 80000000000000030003746059efad68
Date : Thu, 07 Apr 2016 13:01:08 GMT
Content-type : application/json

{
"UserEmail": "test@test.test",
"UserId": "a721fc1a64f13a05",
"AWSAccessKeys": [
{
"AWSAccessKeyId": "a721fc1a64f13a05OQF4",
"AWSSecretAccessKey": "VtzYY4ZHWYzbWLUrRMSzVhB07UvD6Z5nGsAPtESV"
}]
}

2.2.4.3. Sample Request #2

Generates a new key pair for the user with the email user1@email.com.

PUT /?ostor-users&emailAddress=user1@email.com&genKey HTTP/1.1
Host: s3.amazonaws.com
Date: Thu, 07 Apr 2016 15:51:13 GMT +3:00
Authorization: <authorization_string>

2.2.4.4. Sample Response #2

HTTP/1.1 200 OK
x-amz-req-time-micros : 384103
Transfer-encoding : chunked
Server : nginx/1.8.1
Connection : closed
x-amz-request-id : 8000000000000003000374603639905b
Date : Thu, 07 Apr 2016 12:51:09 GMT
Content-type : application/json

{
"UserEmail": "user1@email.com",
"UserId": "8eaa6ab4749a29b4",
"AWSAccessKeys": [
{
"AWSAccessKeyId": "8eaa6ab4749a29b4034G",
"AWSSecretAccessKey": "7spuMfShCIl2tX6dFtSl7TEP7ZQbIGl1GgE0Emdy"
},
{
"AWSAccessKeyId": "8eaa6ab4749a29b4EJUY",
"AWSSecretAccessKey": "ELzQ8CTMFcYQCGSP5lnGvmJxFC9xXrEJ4CjBAA2k"
}]
}