ServerMonitoringDetailsCPU

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
This operation will list CPU monitoring details for a specific [[Server]].
 
This operation will list CPU monitoring details for a specific [[Server]].
  
=='''GET''' /servers/'''id'''/monitoring/cpu?''startDate=startDate''&''endDate=endDate''&''period=monitoringPeriod''&''method=statisticsMethod'''''==
+
='''GET''' /servers/'''id'''/monitoring/cpu?''startDate=startDate''&''endDate=endDate''&''period=monitoringPeriod''&''method=statisticsMethod'''''=
  
=== Parameters ===
+
== Parameters ==
 
; id
 
; id
 
: The unique identifier of the server.
 
: The unique identifier of the server.
Line 19: Line 19:
 
: Statistics method used.  Possible values: '''avg''','''sum''','''min''' and '''max'''.
 
: Statistics method used.  Possible values: '''avg''','''sum''','''min''' and '''max'''.
  
=== Result ===
+
== Result ==
==== JSON ====
+
=== JSON ===
 
  [
 
  [
 
     {
 
     {
Line 43: Line 43:
 
: The sample value calculated depending on statistics method used.
 
: The sample value calculated depending on statistics method used.
  
=== Response Codes ===
+
== Response Codes ==
 
; Success:  
 
; Success:  
 
:''HTTP/1.1 200 OK''
 
:''HTTP/1.1 200 OK''
Line 52: Line 52:
 
:''HTTP/1.1 404 Not Found'' - The resource does not exist.
 
:''HTTP/1.1 404 Not Found'' - The resource does not exist.
  
=== Examples ===
+
== Examples ==
 
'''Successfully get CPU usage monitoring data'''
 
'''Successfully get CPU usage monitoring data'''
 
:'''GET''' http(s)://{api_server}/servers/{server_name}/monitoring/cpu?startDate=2012-05-07&endDate=2012-05-10&period=86400&method=avg
 
:'''GET''' http(s)://{api_server}/servers/{server_name}/monitoring/cpu?startDate=2012-05-07&endDate=2012-05-10&period=86400&method=avg
Line 101: Line 101:
 
       "details": {
 
       "details": {
 
           "startDate": "Invalid date"
 
           "startDate": "Invalid date"
       }
+
       },
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
     }
 
     }
 
  }
 
  }
Line 123: Line 124:
 
       "details": {
 
       "details": {
 
           "period": "\"fake-period\" is not a number"
 
           "period": "\"fake-period\" is not a number"
       }
+
       },
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
     }
 
     }
 
  }
 
  }
Line 143: Line 145:
 
       "message": "Bad request",  
 
       "message": "Bad request",  
 
       "code": 400,  
 
       "code": 400,  
       "details": "Invalid statistics_method"
+
       "details": "Invalid statistics_method",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
     }
 
     }
 
  }
 
  }
Line 165: Line 168:
 
       "details": {
 
       "details": {
 
           "startDate": "Required"
 
           "startDate": "Required"
       }
+
       },
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
     }
 
     }
 
  }
 
  }
Line 187: Line 191:
 
       "details": {
 
       "details": {
 
           "period": "Required"
 
           "period": "Required"
       }
+
       },
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
     }
 
     }
 
  }
 
  }
Line 209: Line 214:
 
       "details": {
 
       "details": {
 
           "method": "Required"
 
           "method": "Required"
       }
+
       },
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
     }
 
     }
 
  }
 
  }
Line 229: Line 235:
 
       "message": "Resource not found",  
 
       "message": "Resource not found",  
 
       "code": 404,  
 
       "code": 404,  
       "details": ""
+
       "details": "",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
     }
 
     }
 
  }
 
  }
Line 253: Line 260:
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:FlexCloud Server API]]
 
[[Category:FlexCloud Server API]]
 
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
 
 
{{#widget:DISQUS
 
|id=hostway
 
|uniqid={{PAGENAME}}
 
|url={{fullurl:{{PAGENAME}}}}
 
}}
 
 
<!--  ########################################################################### -->
 

Revision as of 08:15, 20 May 2013

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

Contents

GET /servers/id/monitoring/cpu?startDate=startDate&endDate=endDate&period=monitoringPeriod&method=statisticsMethod

Parameters

id
The unique identifier of the server.
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": 144, 
      "date": "2012-05-07 00:00:00", 
      "values": 0.0
   }, 
   {
      "count": 143, 
      "date": "2012-05-08 00:00:00", 
      "values": 0.0
   }
]
count - integer
The count of CPU 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 CPU usage monitoring data

GET http(s)://{api_server}/servers/{server_name}/monitoring/cpu?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": 144, 
      "date": "2012-05-07 00:00:00", 
      "values": 0.0
   }, 
   {
      "count": 143, 
      "date": "2012-05-08 00:00:00", 
      "values": 0.0
   }, 
   {
      "count": 144, 
      "date": "2012-05-09 00:00:00", 
      "values": 0.0
   }
]

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

GET http(s)://{api_server}/servers/{server_name}/monitoring/cpu?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"
      },
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
   }
}

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

GET http(s)://{api_server}/servers/{server_name}/monitoring/cpu?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"
      },
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
   }
}

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

GET http(s)://{api_server}/servers/{server_name}/monitoring/cpu?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",
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
   }
}

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

GET http(s)://{api_server}/servers/{server_name}/monitoring/cpu?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"
      },
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
   }
}

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

GET http(s)://{api_server}/servers/{server_name}/monitoring/cpu?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"
      },
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
   }
}

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

GET http(s)://{api_server}/servers/{server_name}/monitoring/cpu?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"
      },
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
   }
}

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

GET http(s)://{api_server}/servers/{fake-server_name}/monitoring/cpu?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": "",
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
   }
}

Unauthorized access

GET http(s)://{api_server}/servers/{server_name}/monitoring/cpu?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.
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox