GET service ostor-usage
Description
Lists existing statistics objects or queries information contained in a specified object.
Requests
Syntax
GET /?ostor-usage HTTP/1.1 Host: <host> Date: <date> Authorization: <authorization_string>
GET /?ostor-usage&obj=<object_name> HTTP/1.1 Host: <host> Date: <date> Authorization: <authorization_string>
GET ?ostor-usage&after=<object_name>&limit=<number> HTTP/1.1 Host: <host> Date: <date> Authorization: <authorization_string>
Parameters
Parameter | Description | Required |
---|---|---|
obj
|
Statistics object name. Type: string. Default value: none. |
No |
after
|
Object name after which to show the list of statistics objects. The specified name will not be shown in the response. Type: string. Default value: none. |
No |
limit
|
Number of statistics objects to show in the response. Type: integer. Default value: none. |
No |
If the obj
subresource is undefined, the response contains information about all existing statistics objects. Otherwise, information from the specified object obj
is returned.
Headers
This implementation uses only common request headers.
Responses
Headers
This implementation uses only common response headers.
Body
If obj
is unspecified:
{ "nr_items": <number_of_statistics_objects>, "truncated": <true_if_list_is_truncated>, "items": [ <list_of_statistics_objects> "<first_object's_name>", "s3-usage-<obj1>", "s3-usage-<obj2>", "s3-usage-<obj3>", ... ] }
If obj
is specified:
{ "fmt_version": <version_of_response_format>, "service_id": <id_of_service_that_collected_statistics>, "start_ts": <timestamp_of_statistics_upload>, "period": <statistics_upload_period_in_seconds>, "nr_items": <number_of_counters>, "items": [<list_of_usage_counters> { "key": { "bucket": "<bucket_name>", "epoch": <bucket_epoch_time>, "user_id": "<user_id>", "tag": "<statistics_object_tag>" }, "counters": { "ops": { "put":<count_of_put_operations>, "get": <count_of_get_operations>, "list": <count_of_list_operations>, "other": <count_of_other_operations> }, "net_io": { "uploaded": <number_of_uploaded_bytes_during_period>, "downloaded": <number_of_downloaded_bytes_during_period> } } }, ... ] }
Examples
Sample request #1
The following request returns information about all statistics objects.
GET /?ostor-usage /HTTP1.1 Date : Mon, 11 Apr 2016 16:43:16 GMT+3:00 Host : s3.example.com Authorization : <authorization_string>
Sample response #1
HTTP/1.1 200 OK x-amz-req-time-micros : 404 Transfer-encoding : chunked Server : nginx/1.8.1 Connection : keep-alive x-amz-request-id : 80000000000000030006b6be3b0ae378 Date : Mon, 11 Apr 2016 13:43:16 GMT 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.000Z-30", "s3-usage-8000000000000003-2016-04-11T13:33:55.000Z-30", "s3-usage-8000000000000003-2016-04-11T13:34:25.000Z-30" ] }
Sample request #2
The following request returns information from the object s3-usage-8000000000000003-2016-04-11T13:33:55.000Z-30
.
GET /?ostor-usage&obj=s3-usage-8000000000000003-2016-04-11T13:12:53.000Z-30 /HTTP1.1 Date: Mon, 11 Apr 2016 17:48:21 GMT+3:00 Host: s3.example.com Authorization: <authorization_string>
Sample response #2
HTTP/1.1 200 OK X-amz-req-time-micros : 576 Transfer-encoding : chunked Server : nginx/1.8.1 Connection : keep-alive X-amz-request-id : 80000000000000030006b6bf23c77f09 Date : Mon, 11 Apr 2016 14:48:21 GMT Content-type : application/json { "fmt_version": 1, "service_id":8000000000000003, "start_ts":1460380373, "period": 30, "nr_items":2, "items": [ { "key": { "bucket": "bucket", "epoch":16394, "user_id": "f82c23f7823589eb", "tag": "" }, "counters": { "ops": { "put":15, "get":0, "list":1, "other":0 }, "net_io": { "uploaded":99785, "downloaded":0 } } }, { "key": { "bucket": "", "epoch":0, "user_id": "f82c23f7823589eb", "tag": "" }, "counters": { "ops": { "put":0, "get":2, "list":0, "other":0 }, "net_io": { "uploaded":0, "downloaded":0 } } } ] }
Sample request #3
The following request returns information about 5 statistics objects after the object s3-usage-8000000000000015-2024-02-15T11:56:49.000Z-1800
.
GET /?ostor-usage&after=s3-usage-8000000000000015-2024-02-15T11:56:49.000Z-1800&limit=5 /HTTP1.1 Date: Fri, 19 Apr 2024 15:07:53 GMT+3:00 Host: s3.example.com Authorization: <authorization_string>
Sample response #3
HTTP/1.1 200 OK x-amz-req-time-micros : 404 Transfer-encoding : chunked Server : nginx/1.8.1 Connection : keep-alive x-amz-request-id : 80000000000000030006b6be3b0ae378 Date : Fri, 19 Apr 2024 15:07:53 GMT Content-type : application/json { "nr_items": 5, "truncated": false, "items": [ "s3-usage-8000000000000015-2024-02-15T12:12:03.000Z-30", "s3-usage-8000000000000015-2024-02-15T12:15:21.000Z-30", "s3-usage-8000000000000015-2024-02-15T12:20:36.000Z-30", "s3-usage-8000000000000015-2024-02-15T12:25:40.000Z-30", "s3-usage-8000000000000015-2024-02-15T12:31:54.000Z-30" ] }