POST service ostor-users
Description
Generates or revokes access key pairs of existing users or accounts.
Requests
Syntax
POST /?ostor-users&emailAddress=<value>&genKey HTTP/1.1 Host: <host> Date: <date> Authorization: <authorization_string>
POST /?ostor-users&emailAddress=<value>&revokeKey=<value> HTTP/1.1 Host: <host> Date: <date> Authorization: <authorization_string>
POST /?ostor-users&emailAddress=<value>&accountName=<value>&genKey HTTP/1.1 Host: <host> Date: <date> Authorization: <authorization_string>
POST /?ostor-users&emailAddress=<value>&accountName=<value>&revokeKey=<value> HTTP/1.1 Host: <host> Date: <date> Authorization: <authorization_string>
Parameters
| Parameter | Description | Required |
|---|---|---|
emailAddress
|
User email address. Type: string. Default value: none. |
Yes |
accountName
|
Account name. Type: string. Default value: none. |
No |
genKey
|
Generates a new access key pair for the user or account. A user or an account 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* |
* Only one of the required parameters can be set in a single request.
Headers
This implementation uses only common request headers.
Responses
Headers
This implementation uses only common response headers.
Body
If 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.
Examples
Sample request #1
Generates a new key pair for the user with the email user1@email.com.
POST /?ostor-users&emailAddress=user1@email.com&genKey HTTP/1.1 Host: s3.example.com Date: Thu, 07 Apr 2016 15:51:13 GMT +3:00 Authorization: <authorization_string>
Sample response #1
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"
}
]
}
Sample request #2
Generates a new key pair for the account account1 of the user with the email user1@email.com.
POST /?ostor-users&emailAddress=user1@email.com&accountName=account1&genKey HTTP/1.1 Host: s3.example.com Date: Wed, 24 Mar 2021 17:32:41 +0200 Authorization: <authorization_string>
Sample response #2
HTTP/1.1 200 OK
Server: nginx
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Date: Wed, 24 Mar 2021 15:32:42 GMT
x-amz-req-time-micros: 51835
x-amz-request-id: 8000000000000016000060d7e970100a
{
"UserEmail": "user2@email.com",
"UserId": "bc6265392b818465",
"AWSAccessKeys": [
{
"AWSAccessKeyId": "bc6265392b818465YQ0R",
"AWSSecretAccessKey": "D6dSND8MZFSsKxp4bJFRXsCFEz3bC32nhpEzFpvP"
}
]
}
Sample request #3
Revokes the key pair with the ID 8eaa6ab4749a29b4034G for the user with the email user1@email.com.
POST /?ostor-users&emailAddress=user1@email.com&revokeKey=8eaa6ab4749a29b4034G HTTP/1.1 Host: s3.example.com Date: Wed, 24 Mar 2021 17:36:57 +0200 Authorization: <authorization_string>
Sample response #3
HTTP/1.1 200 OK Server: nginx Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive Date: Wed, 24 Mar 2021 15:36:58 GMT x-amz-req-time-micros: 43652 x-amz-request-id: 8000000000000016000060d7f8b178be