Statistics

最終更新日:2022-03-01 18:22:18

Function description

  1. Get the number of successful PUT/POST requests in the order of minutes.
  2. Get the bandwidth of the successful upload in the order of minutes.
  3. Get storage usage and number of objects per hour.
  4. Passing request parameters through URL.

Request format

GET /bucketname?statistics&type=requests&method=PUT&startTime=201707200244 HTTP/1.1
Host: Bucket.Endpoint
Date: Date
Authorization: Authorization

Request parameters

Parameters for the interface are as follows:

Name Description Required
type Statistics types.
Optional values: requests(number of requests) , bandwidth, ObjectNum(number of objects)
Yes
startTime The start time of the statistics, accurated to minutes.
If endTime is specified, the statistics is from startTime to endTime , and the interval between startTime and endTime cannot exceed one week.
Format: YYYYMMDDhhmmss
Yes
endTime The start time of the statistics.
Format: YYYYMMDDhhmmss
no
method Request method for monitoring data . This parameter does not take effect when querying the number of objects.
Optional values: PUT /POST
Yes

Request header

Use common request headers .

Request body

Request body is not required.

Response format

HTTP/1 status_code
x-amz-request-id: request id
Date: date
Content-Type: type
Content-Length: length

<?xml version=”0” encoding=”UTF-8” standalone=”yes”?>
<StatisticsResult xmlns=” http://wcs.chinanetcenter.com/document”>
	<Owner>Owner<Owner>
	<Bucket>Bucket</Bucket>
		<Type>Type</Type>
		<Operation >Operation </Operation >
		<StartTime>StartTime</StartTime>
		<EndTime>EndTime</EndTime>
		<Results time="2017-07-23 02:44">2472</Results>
		<Results time="2017-07-23 02:45">2546</Results>
……
</StatisticsResult>

Response header

Use common response headers .

Response body

See description of elements in response in the following table:

Field Name Description
StatisticsResult Root Node of response.
Child nodes: Owner, Bucket, Type, StartTime, EndTime, Results
Type: XML
Parent node: Null
Owner Bucket owner.
Child node: Null
Parent node: StatisticsResult
Type: String
Bucket Bucket name.
Child node: Null
Parent node: StatisticsResult
Type: String
Type Statistics types.
Child node: Null
Parent node: StatisticsResult
Type: String ( requests/bandwidth/ ObjectNum )
Operation Request method.
Child node: Null
Parent node: StatisticsResult
Type: String ( PUT/POST )
When querying the number of objects, this field is empty
StartTime The start time of the statistics.
Child node: Null
Parent node: StatisticsResult
Type: String (Format: YYYYMMDDhhmm)
EndTime The end time of the statistics.
Child node: Null
Parent node: StatisticsResult
Type: String (Format: YYYYMMDDhhmm )
Results Child node: Null
Parent node: StatisticsResult
Type: String

Special response code

Senario HTTP status code Error code Message
A required parameter is missing from the request 400 Bad Request InvalidArgument Please provide parameter {parameter name}
The sub-resource is misspelled or not included when requesting 405 Method Not Allowed MethodNotAllowed MethodNotAllowed
The Method in the request does not belong to one of these methods: GET, HEAD, POST, PATCH, DELETE, OPTIONS, TRACE 400 Bad Request InvalidArgument Method is invalid
The startTime/endTime parameter format is illegal when requesting 400 Bad Request InvalidArgument {parameter name} is Invalid
The start time in the request is later than the current time 400 Bad Request InvalidArgument {parameter name} is invalid
in the request Start time is later than end time 400 Bad Request InvalidArgument The startTIme must be less than endTime
The end time in the request is later than the current time 400 Bad Request InvalidArgument {parameter name} is invalid
URL expires 403 Forbidden RequestTimeTooSkewed The difference between the request time and the current time is too large.
The actual interval between requested queries is greater than one week 400 Bad Request InvalidArgument The difference between the startTime and endTime must be less than one week.
The “type” in the request is not supported ( Spelling mistake and unsupported query are involed ) 400 Bad Request InvalidArgument Parameter Type only support requests and bandwidth
Send the same request over twice in a minute 429 Too Many Requests TooManyRequests You have sent too many requests in a given amount of time.