Acronis Cyber Infrastructure 3.
Copyright Statement Copyright ©Acronis International GmbH, 2002-2019. All rights reserved. ”Acronis” and ”Acronis Secure Zone” are registered trademarks of Acronis International GmbH. ”Acronis Compute with Confidence”, ”Acronis Startup Recovery Manager”, ”Acronis Instant Restore”, and the Acronis logo are trademarks of Acronis International GmbH. Linux is a registered trademark of Linus Torvalds. VMware and VMware Ready are trademarks and/or registered trademarks of VMware, Inc.
Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 About the Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2. User Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.
2.2.3.1 Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2.3.2 Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.4.1 Sample Request #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.4.2 Sample Response #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5 PUT Service ostor-limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.5.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.5.2 Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.5.3 2.5.4 2.6 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.5.2.2 Parameters . . . . . . . . . . . . . . . .
2.7.2 2.7.3 2.7.4 Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.7.2.1 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.7.2.2 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.7.2.3 Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.2.4.1 Sample Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.2.4.2 Sample Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CHAPTER 1 Introduction 1.1 About the Guide The guide explains how to use the REST API to manage S3 clusters based on Acronis Cyber Infrastructure. The system API enables storage administrators to manage users, limits, and billing statistics. The system REST API enables remote execution of operations similar to ostor-s3-admin functionality. 1.2 Authentication Management request must be authenticated with the AWS Access Key ID corresponding to the S3 system user.
CHAPTER 2 User Management 2.1 GET Service ostor-users 2.1.1 Description Lists information about all users or the user specified by either email or ID. 2.1.2 Requests 2.1.2.1 Syntax GET /?ostor-users HTTP/1.1 Host: s3.amazonaws.com Date: Authorization: GET /?ostor-users&emailAddress= HTTP/1.1 Host: s3.amazonaws.com Date: Authorization: GET /?ostor-users&id= HTTP/1.1 Host: s3.amazonaws.
Chapter 2. User Management 2.1.2.2 Parameters Table 2.1.2.2.1: GET Service ostor-users parameters Parameter Description Required emailAddress User email address. No* Type: string. Default value: none. id User ID. No* Type: string. Default value: none. * Only one of the required parameters can be set in a single request. If neither emailAddress nor id are set, the response is information about all users, otherwise the response is information about the user with the specified email or ID. 2.1.2.
Chapter 2. User Management }] } 2.1.3.3 Errors Returns Error Code 400 if more than one parameter is set. 2.1.4 Examples 2.1.4.1 Sample Request #1 Returns information about all users GET /?ostor-users HTTP/1.1 Host: s3.amazonaws.com Date: Wed, 30 Apr 2016 22:32:00 GMT Authorization: 2.1.4.2 Sample Response #1 HTTP/1.1 200 OK Transfer-encoding : chunked Server : nginx/1.8.
Chapter 2. User Management "AWSAccessKeyId": "da2ccd035ce34bc3XD5P", "AWSSecretAccessKey": "wHfEBQFO7HN7fhoHx45lHHyBInAOOCZTHtvveYlB" }] }, { "UserEmail": "root0@email.com", "UserId": "f82c23f7823589eb", "AWSAccessKeys": [ { "AWSAccessKeyId": "f82c23f7823589ebN4KD", "AWSSecretAccessKey": "MbKetIRMW8rrZh16yfb2dMj16ejHuBHfOa37bp5V" }] }, { "UserEmail": "root1@email.
Chapter 2. User Management "AWSSecretAccessKey": "HHD59Sf9KB4fGOxrjqhzyLBeHsODXD40QZeomKfy" }] } 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= HTTP/1.1 Host: s3.amazonaws.com Date: Authorization: PUT /?ostor-users&emailAddress=&genKey HTTP/1.1 Host: s3.amazonaws.
Chapter 2. User Management Table 2.2.2.2.1 – continued from previous page Parameter Description Required genKey Generates a new access key pair for the user. A No user can only have two key pairs. Type: flag. Default value: none. revokeKey Removes the access key pair that corresponds to No the specified access key. Type: string. Default value: none. If neither genKey nor revokeKey are set, a new user with the specified email will be created. 2.2.2.
Chapter 2. User Management 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: 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.
Chapter 2. User Management 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.
Chapter 2. User Management 2.3.2.2 Parameters Table 2.3.2.2.1: DELETE Service ostor-users parameters Parameter Description Required emailAddress User email address. Yes* Type: string. Default value: none. id User ID. Yes* Type: string. Default value: none. * Only one of the required parameters can be set in a single request. 2.3.2.3 Headers This implementation uses only common request headers. 2.3.3 Responses 2.3.3.1 Headers This implementation uses only common response headers. 2.3.3.
Chapter 2. User Management 2.3.4 Examples 2.3.4.1 Sample Request Deletes the user with the email test@test.test. DELETE /?ostor-users&emailAddress=test@test.test HTTP/1.1 Host: s3.amazonaws.com Date: Wed, 30 Apr 2016 22:32:00 GMT Authorization: 2.3.4.2 Sample Response HTTP/1.1 203 No Content x-amz-req-time-micros : 172807 Server : nginx/1.8.
Chapter 2. User Management Authorization: 2.4.2.2 Parameters Table 2.4.2.2.1: GET Service ostor-limits parameters Parameter Description Required emailAddress User email address. Yes* Type: string. Default value: none. id User ID. Yes* Type: string. Default value: none. bucket Bucket name. Yes* Type: string. Default value: none. * Only one of the required parameters can be set in a single request. 2.4.2.3 Headers This implementation uses only common request headers. 2.
Chapter 2. User Management "ops:put" : "", "ops:list" : "", "ops:delete" : "", "bandwidth:out" : "", } Zero value means “unlimited”. 2.4.3.3 Errors Returns Error Code 400 if multiple parameters are set at once. Note: The limits are disabled by default. If limits for a user/bucket requested are disabled, an error will be returned. Use PUT ostor-limits to enable limits. 2.4.
Chapter 2. User Management "ops:delete" : "0.50", "bandwidth:out" : "0" } 2.4.4.3 Sample Request #2 Returns information about limits for the bucket bucket-1. GET /?ostor-limits&bucket=bucket-1 HTTP/1.1 Host: s3.amazonaws.com Date: Wed, 30 Apr 2016 22:32:00 GMT Authorization: 2.4.4.4 Sample Response #2 HTTP/1.1 200 OK Transfer-encoding : chunked Server : nginx/1.8.
Chapter 2. User Management 2.5.2 Requests 2.5.2.1 Syntax PUT /?ostor-limits&emailAddress= HTTP/1.1 Host: s3.amazonaws.com Date: Authorization: GET /?ostor-limits&bucket= HTTP/1.1 Host: s3.amazonaws.com Date: Authorization: 2.5.2.2 Parameters Table 2.5.2.2.1: PUT Service ostor-limits parameters Parameter Description Required emailAddress User email address. Yes* Type: string. Default value: none. id User ID.
Chapter 2. User Management Table 2.5.2.2.1 – continued from previous page Parameter Description Required default Sets the default value for operations limits. If set, all unspecified No operations limits are set to default, otherwise they are set to 0. Requires the ops subresource to be set. Type: integer. Default: 0. put Sets the PUT operations limit value. No Requires the ops subresource to be set. Type: integer. Default: default. get Sets the GET operations limit value.
Chapter 2. User Management 2.5.2.3 Headers This implementation uses only common request headers. 2.5.3 Responses 2.5.3.1 Headers This implementation uses only common response headers. 2.5.3.2 Body Empty. 2.5.3.3 Errors Returns Error Code 400 if a wrong set of parameters is specified. 2.5.4 Examples 2.5.4.1 Sample Request #1 Sets all operations limits for the user with the email user1@email.com to zero. PUT /?ostor-limits&emailAddress=user1@email.com&ops&default=0 HTTP/1.1 Host: s3.amazonaws.
Chapter 2. User Management Date : Thu, 07 Apr 2016 14:08:56 GMT Content-type : application/json 2.5.4.3 Sample Request #2 Sets all operations limits for the user with the email user1@email.com to 1 ops/sec. PUT /?ostor-limits&emailAddress=user1@email.com&ops&default=60 HTTP/1.1 Host: s3.amazonaws.com Date: Thu, 07 Apr 2016 14:08:55 GMT Authorization: 2.5.4.4 Sample Response #2 HTTP/1.1 200 OK Transfer-encoding : chunked Server : nginx/1.8.
Chapter 2. User Management 2.5.4.7 Sample Request #4 Sets operations limits for the bucket testbucket. The new PUT operations limit is 60 ops/s, LIST limit is 0.5 ops/s, GET and DELETE limits are 1 ops/s. PUT /?ostor-limits&bucket=testbucket&ops&default=60&put=3600&list=30 HTTP/1.1 Host: s3.amazonaws.com Date: Thu, 07 Apr 2016 14:08:55 GMT Authorization: 2.5.4.8 Sample Response #4 HTTP/1.1 200 OK Transfer-encoding : chunked Server : nginx/1.8.
Chapter 2. User Management DELETE /?ostor-limits&bucket=&bandwidth HTTP/1.1 Host: s3.amazonaws.com Date: Authorization: 2.6.2.2 Parameters Table 2.6.2.2.1: DELETE Service ostor-limits parameters Parameter Description Required emailAddress User email address. Yes* Type: string. Default value: none. id User ID. Yes* Type: string. Default value: none. bucket Bucket name. Yes* Type: string. Default value: none. ops Removes operations limits.
Chapter 2. User Management 2.6.3.2 Body Empty. Note: If limits are successfully removed, Status204NoContent will be returned. 2.6.4 Examples 2.6.4.1 Sample Request #1 The following request deletes all operations limits for a user with the email user1@email.com. PUT /?ostor-limits&emailAddress=user1@email.com&ops HTTP/1.1 Host: s3.amazonaws.com Date: Thu, 07 Apr 2016 14:08:55 GMT Authorization: 2.6.4.2 Sample Response HTTP/1.
Chapter 2. User Management 2.6.4.4 Sample Response #2 HTTP/1.1 204 No Content Transfer-encoding : chunked Server : nginx/1.8.1 Connection: closed x-amz-request-id : 80000000000000030005c8caec96d65b Date : Thu, 07 Apr 2016 14:08:56 GMT Content-type : application/json 2.7 GET Service ostor-buckets 2.7.1 Description Lists information on all buckets or the buckets of the user specified by either email or ID. 2.7.2 Requests 2.7.2.1 Syntax GET /?ostor-buckets HTTP/1.1 Host: s3.amazonaws.
Chapter 2. User Management 2.7.2.2 Parameters Table 2.7.2.2.1: GET Service ostor-buckets parameters Parameter Description Required emailAddress User email address. No* Type: string. Default value: none. id User ID. No* Type: string. Default value: none. * Only one of the required parameters can be set in a single request. If neither emailAddress nor id are set, the response is the list of all buckets, otherwise the response is the bucket list of the user with the specified email or ID. 2.7.2.
Chapter 2. User Management { "current" : , "hmax": , "h_integral": , "last_ts": } }, { ... }] } 2.7.3.3 Errors Returns Error Code 400 if more than one parameter is set. 2.7.4 Examples 2.7.4.1 Sample Request Returns information on all buckets in S3. GET /?ostor-buckets HTTP/1.1 Host: s3.amazonaws.com Date: Wed, 30 Apr 2016 22:32:00 GMT Authorization: 2.7.4.
Chapter 2. User Management "size": { "current": 46700160, "h_integral": 28160196480, "hmax": 46700160, "last_ts": 424237 }, "epoch": 0, "owner_id": "ccbec013d9fd3918", "name": "bucket2", "creation_date": "2018-05-25T13:51:55.000Z" }, { "size": { "current": 12288, "h_integral": 8036352, "hmax": 12288, "last_ts": 424186 }, "epoch": 0, "owner_id": "9d80d59edbe2862a", "name": "bucket3", "creation_date": "2018-05-23T10:30:49.
CHAPTER 3 Usage Statistics The S3 gateway can collect usage statistics for S3 users and S3 buckets. The collected data are saved as regular objects. One such object contains statistics for the set usage period. To enable statistics collection, set S3_GW_USAGE_BUCKET to True in the gateway configuration file (/var/lib/ostor/local/gw.conf by default).
Chapter 3. Usage Statistics GET /?ostor-users&obj=object name HTTP/1.1 Host: s3.amazonaws.com Date: Authorization: 3.1.2.2 Parameters The parameter is specified by the obj subresource. If the obj subresource is undefined, the response contains information about all existing statistics objects. Otherwise information from the specified object obj is returned. Table 3.1.2.2.1: GET Service ostor-usage parameters Parameter Description Required obj Statistics object name.
Chapter 3. Usage Statistics "s3-usage-obj2", "s3-usage-obj3", ...
Chapter 3. Usage Statistics Content-type : application/json { "nr_items": 9, "truncated": false, "items": [ "s3-usage-8000000000000003-2016-04-11T13:10:29.000Z-1800", "s3-usage-8000000000000003-2016-04-11T13:12:53.000Z-30", "s3-usage-8000000000000003-2016-04-11T13:13:23.000Z-30", "s3-usage-8000000000000003-2016-04-11T13:15:53.000Z-30", "s3-usage-8000000000000003-2016-04-11T13:16:23.000Z-30", "s3-usage-8000000000000003-2016-04-11T13:31:54.000Z-30", "s3-usage-8000000000000003-2016-04-11T13:33:25.
Chapter 3. Usage Statistics }, { "key": { "bucket": "", "epoch":0, "user_id": "f82c23f7823589eb", "tag": "" }, "counters": { "ops": { "put":0, "get":2, "list":0, "other":0 }, "net_io": { "uploaded":0, "downloaded":0 } } } ] } 3.2 DELETE Service ostor-usage 3.2.1 Description Deletes the statistics object specified by name. 3.2.2 Requests 3.2.2.1 Syntax DELETE /?ostor-users&obj= HTTP/1.1 Host: s3.amazonaws.com Date: Authorization: 3.2.2.2 Parameters Table 3.2.2.2.
Chapter 3. Usage Statistics 3.2.3 Responses 3.2.3.1 Headers This implementation uses only common response headers. 3.2.3.2 Body Empty. Note: If the request is successful, Status204NoContent is returned. 3.2.4 Examples 3.2.4.1 Sample Request The following request deletes statistics object with name s3-usage-8000000000000003-2016-04-11T13:33:55.000Z-30. DELETE /?ostor-usage&obj=s3-usage-8000000000000003-2016-04-11T13:12:53.000Z-30 /HTTP1.