ServerMonitoringDetailsBandwidth

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
=='''GET''' /servers/'''id'''/monitoring/bandwidth?''scope=monitoringScope''&''startDate=startDate''&''endDate=endDate''&''period=monitoringPeriod''&''method=statisticsMethod'''''==
 
 
This operation will list Bandwidth monitoring details for a specific [[Server]].
 
This operation will list Bandwidth monitoring details for a specific [[Server]].
 +
 +
=='''GET''' /servers/'''id'''/monitoring/bandwidth?''scope=monitoringScope''&''startDate=startDate''&''endDate=endDate''&''period=monitoringPeriod''&''method=statisticsMethod'''''==
  
 
=== Parameters ===
 
=== Parameters ===

Revision as of 19:23, 12 April 2013

This operation will list Bandwidth monitoring details for a specific Server.

Contents

GET /servers/id/monitoring/bandwidth?scope=monitoringScope&startDate=startDate&endDate=endDate&period=monitoringPeriod&method=statisticsMethod

Parameters

id
The unique identifier of the server.
scope
The monitoring scope used. Possible values: receive and transmit.
startDate
Start date for monitoring details report in format yyyy-mm-dd hh:mm:ss.
endDate
End date for monitoring details report in format yyyy-mm-dd hh:mm:ss.
period
The time period in seconds used for data interval. Possible values: 3600(one hour) or 86400(one day).
method
Statistics method used. Possible values: avg,sum,min and max.

Result

JSON

[
   {
      "count": 143, 
      "date": "2012-05-07 00:00:00", 
      "values": 344130.30069930002
   }, 
   {
      "count": 144, 
      "date": "2012-05-08 00:00:00", 
      "values": 658.34027777777999
   }
]
count - integer
The count of bandwidth operations for the period specified.
date - string
The date and time stamp for the period specified.
values - float
The sample value calculated depending on statistics method used.

Response Codes

Success
HTTP/1.1 200 OK
The request is accepted for processing.
Failure
HTTP/1.1 400 Bad Request
HTTP/1.1 401 Unauthorized - This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
HTTP/1.1 404 Not Found - The resource does not exist.

Examples

Successfully get Bandwidth usage monitoring data

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?scope=usage&startDate=2012-05-07&endDate=2012-05-10&period=86400&method=avg

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 200 OK

Response Body:

[
   {
      "count": 143, 
      "date": "2012-05-07 00:00:00", 
      "values": 344130.30069930002
   }, 
   {
      "count": 144, 
      "date": "2012-05-08 00:00:00", 
      "values": 658.34027777777999
   }, 
   {
      "count": 144, 
      "date": "2012-05-09 00:00:00", 
      "values": 2.1111111111111001
   }
]

Failure while trying to get Bandwidth usage monitoring data with a bad scope parameter

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?scope=fake-scope&startDate=2012-05-07&endDate=2012-05-10&period=86400&method=avg

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{
   "badRequest": {
      "message": "Bad request", 
      "code": 400, 
      "details": "The bandwidth monitoring scope is not supported" 
   }
}

Failure while trying to get Bandwidth usage monitoring data with a bad date parameter

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?scope=usage&startDate=fake-date&endDate=2012-05-10&period=86400&method=avg

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{
   "badRequest": {
      "message": "Bad request", 
      "code": 400, 
      "details": {
         "startDate": "Invalid date"
      }
   }
}

Failure while trying to get Bandwidth usage monitoring data with a bad period parameter

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?scope=usage&startDate=2012-05-07&endDate=2012-05-10&period=fake-period&method=avg

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{
   "badRequest": {
      "message": "Bad request", 
      "code": 400, 
      "details": {
         "period": "\"fake-period\" is not a number"
      }
   }
}

Failure while trying to get Bandwidth usage monitoring data with a bad method parameter

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?scope=usage&startDate=2012-05-07&endDate=2012-05-10&period=86400&method=fake-method

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{
   "badRequest": {
      "message": "Bad request", 
      "code": 400, 
      "details": "Invalid statistics_method"
   }
}

Failure while trying to get Bandwidth usage monitoring data with a missing scope parameter

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?startDate=2012-05-07&endDate=2012-05-10&period=86400&method=avg

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{
   "badRequest": {
      "message": "Bad request", 
      "code": 400, 
      "details": "The bandwidth monitoring scope is missing" 
   }
}

Failure while trying to get Bandwidth usage monitoring data with a missing date parameter

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?scope=usage&endDate=2012-05-10&period=86400&method=avg

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{
   "badRequest": {
      "message": "Bad request", 
      "code": 400, 
      "details": {
         "startDate": "Required"
      }
   }
}

Failure while trying to get Bandwidth usage monitoring data with a missing period parameter

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?scope=usage&startDate=2012-05-07&endDate=2012-05-10&method=avg

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{
   "badRequest": {
      "message": "Bad request", 
      "code": 400, 
      "details": {
         "period": "Required"
      }
   }
}

Failure while trying to get Bandwidth usage monitoring data with a missing method parameter

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?scope=usage&startDate=2012-05-07&endDate=2012-05-10&period=86400

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{
   "badRequest": {
      "message": "Bad request", 
      "code": 400, 
      "details": {
         "method": "Required"
      }
   }
}

Failure while trying to get Bandwidth usage monitoring data for a non-existent server

GET http(s)://{api_server}/servers/{fake-server_name}/monitoring/bandwidth?scope=usage&startDate=2012-05-07&endDate=2012-05-10&period=86400&method=avg

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 404 Not Found

Response Body:

{
   "itemNotFound": {
      "message": "Resource not found", 
      "code": 404, 
      "details": ""
   }
}

Unauthorized access

GET http(s)://{api_server}/servers/{server_name}/monitoring/bandwidth?scope=usage&startDate=2012-05-07&endDate=2012-05-10&period=86400&method=avg

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded fake_authentication_string

Response Code:

HTTP/1.1 401 Unauthorized

Response Body:

    401 Unauthorized
    This server could not verify that you are authorized to
    access the document you requested.  Either you supplied the
    wrong credentials (e.g., bad password), or your browser
    does not understand how to supply the credentials required.


blog comments powered by Disqus


Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox