Monitoring/CPU

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
 
m (1 revision)
 

Latest revision as of 13:36, 30 May 2016

Contents

[edit] POST /accounts/account/dedicatedServers/dedicated_server/ipAddresses/ip_address/monitoring/cpu

This API call is deprecated!

Create CPU check

[edit] Parameters

account - string
dedicated_server - string
ip_address - string


[edit] Request

[edit] JSON

{
   "monitoring": {
      "check": {
            "enabled": {enabled}, 
            "enabledAlert": {enabled_alert}
         }, 
      "options": {
         "maxLoad": {max_load}
      }
   }
}

[edit] monitoring

[edit] check
check.enabled - boolean
Enable the check
check.enabledAlert - boolean
Enable alerts
[edit] options
options.maxLoad - number


[edit] Result

[edit] JSON

{
   "monitoring": {
      "type": "{type}", 
      "options": {
         "maxLoad": {max_load}
      }, 
      "check": {
         "status": {status}, 
         "lastCheck": {last_check}, 
         "enabledAlert": {enabled_alert}, 
         "enabled": {enabled}, 
         "id": {id}
      }
   }, 
   "links": [
      {
         "href": "{server_name}/accounts/{account}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/{id}", "rel": "self"
      }
   ]
}

[edit] monitoring

type - string
cpu
links - list
Hypermedia for this resource.
[edit] check
check.id - string
Unique identifier for this check.
check.status
Status of the cpu check
check.lastCheck
Time of last cpu check
check.enabled - boolean
Is the check enabled
check.enabledAlert - boolean
Are alerts enabled
[edit] options
options.maxLoad - int


[edit] Response Codes

Success
HTTP/1.1 201 Created
Failure
HTTP/1.1 400 Bad Request: There was an error in the request the client sent
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 403 Forbidden : You don't have permissions to access the resource
HTTP/1.1 404 Not Found : The resource requested is not found.
HTTP/1.1 409 Conflict : Only one memory check for Dedicated Server per IP is allowed


[edit] Examples

POST http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu

Request:

{"monitoring" : {"check": {"enabled": true, "enabledAlert": false}, "options": {"maxLoad": 1.0}}}

Response:

HTTP/1.1 201 Created:
{"monitoring": {"type": "cpu", "options": {"maxLoad": 1.0}, "check": {"status": null, "lastCheck": null, "enabledAlert": false, "enabled": true, "id": 18}}, "links": [{"href": "{server_name}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/18", "rel": "self"}]}


POST http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu

Request:

{"monitoring" : {"check": {"enabledAlert": false}, "options": {"maxLoad": 1.0}}}

Response:

HTTP/1.1 400 Bad Request:
{"badRequest": {"message": "POST data error", "code": 400, "details": {"monitoring.check.enabled": "Required"}}}


POST http(s)://{api_server}/accounts/{account_number}/dedicatedServers/abc/ipAddresses/{ip_address}/monitoring/cpu

Request:

{"monitoring" : {"check": {"enabledAlert": false}, "options": {"maxLoad": 1.0}}}

Response:

HTTP/1.1 404 Not Found


POST http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu

Request:

{"monitoring" : {"check": {"enabled": true, "enabledAlert": false }, "options": {"maxLoad": 1.0}}}

Response:

HTTP/1.1 409 Conflict

[edit] GET /accounts/account/dedicatedServers/dedicated_server/ipAddresses/ip_address/monitoring/cpu/id

This API call is deprecated!

Get CPU check details

[edit] Parameters

account - string
dedicated_server - string
ip_address - string
id - string
Id of the cpu check.


[edit] Result

[edit] JSON

{
   "monitoring": {
      "type": "{type}", 
      "options": {
         "maxLoad": {max_load}
      }, 
      "check": {
         "status": {status}, 
         "lastCheck": {last_check}, 
         "enabledAlert": {enabled_alert}, 
         "enabled": {enabled}, 
         "id": {id}
      }
   }, 
   "links": [
      {
         "href": "{server_name}/accounts/{account}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/{id}", "rel": "self"
      }
   ]
}

[edit] monitoring

type - string
cpu
links - list
Hypermedia for this resource.
[edit] check
check.id - string
Unique identifier for this check.
check.status
Status of the cpu check
check.lastCheck
Time of last cpu check
check.enabled - boolean
Is the check enabled
check.enabledAlert - boolean
Are alerts enabled
[edit] options
options.maxLoad - number


[edit] Response Codes

Success
HTTP/1.1 200 Ok
Failure
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 403 Forbidden : You don't have permissions to access the resource
HTTP/1.1 404 Not Found : The resource requested is not found.


[edit] Examples

GET http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/18

Response:

HTTP/1.1 200 Ok:
{"monitoring": {"type": "cpu", "options": {"maxLoad": 1.0}, "check": {"status": null, "lastCheck": null, "enabledAlert": false, "enabled": true, "id": 18}}, "links": [{"href": "{server_name}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/18/", "rel": "self"}]}


GET http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/9999

Response:

HTTP/1.1 404 Not Found


GET http(s)://{api_server}/accounts/{account_number}/dedicatedServers/abc/ipAddresses/{ip_address}/monitoring/cpu/18

Response:

HTTP/1.1 404 Not Found


[edit] PUT /accounts/account/dedicatedServers/dedicated_server/ipAddresses/ip_address/monitoring/cpu/id

This API call is deprecated!

Update CPU check

[edit] Parameters

account - string
dedicated_server - string
ip_address - string
id - string
Id of the cpu check.

[edit] Request

[edit] JSON

{
   "monitoring": {
      "check": {
            "enabled": {enabled}, 
            "enabledAlert": {enabled_alert}
         }, 
      "options": {
         "maxLoad": {max_load} 
      }
   }
}

[edit] monitoring

[edit] check
check.enabled - boolean
Enable the check
check.enabledAlert - boolean
Enable alerts
[edit] options
options.maxLoad - int

[edit] Result

[edit] JSON

{
   "monitoring": {
      "type": "{type}", 
      "options": {
         "maxLoad": {max_load}
      }, 
      "check": {
         "status": {status}, 
         "lastCheck": {last_check}, 
         "enabledAlert": {enabled_alert}, 
         "enabled": {enabled}, 
         "id": {id}
      }
   }, 
   "links": [
      {
         "href": "{server_name}/accounts/{account}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/{id}", "rel": "self"
      }
   ]
}

[edit] monitoring

type - string
cpu
links - list
Hypermedia for this resource.
[edit] check
check.id - string
Unique identifier for this check.
check.status
Status of the cpu check
check.lastCheck
Time of last cpu check
check.enabled - boolean
Is the check enabled
check.enabledAlert - boolean
Are alerts enabled
[edit] options
options.maxLoad - int


[edit] Response Codes

Success
HTTP/1.1 200 Ok
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 403 Forbidden
HTTP/1.1 404 Not Found : The resource requested is not found.

[edit] Examples

PUT http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/18

Request:

{"monitoring" : {"check": {"enabled": true, "enabledAlert": false}, "options": {"maxLoad": 0.5}}}

Response:

HTTP/1.1 200 Ok:
{"monitoring": {"type": "cpu", "options": {"maxLoad": 0.5}, "check": {"status": null, "lastCheck": null, "enabledAlert": false, "enabled": true, "id": 18}}, "links": [{"href": "{server_name}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/18/", "rel": "self"}]}


PUT http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/18

Request:

{"monitoring": {"options": {"maxLoad": 0.5}}}

Response:

HTTP/1.1 400 Bad Request:
{"badRequest": {"message": "POST data error", "code": 400, "details": {"monitoring.check": "Required"}}}


PUT http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/9999

Request:

{"monitoring": {"check": {"enabled": false, "enabledAlert": false}, "options": {"maxLoad": 0.5}}}

Response:

HTTP/1.1 404 Not Found


[edit] DELETE /accounts/account/dedicatedServers/dedicated_server/ipAddresses/ip_address/monitoring/cpu/id

This API call is deprecated!

Delete CPU check


[edit] Parameters

account - string
dedicated_server - string
ip_address - string
id - string
Id of the cpu check.


[edit] Response Codes

Success deleting the resource
HTTP/1.1 204 No Content
Failure
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 403 Forbidden
HTTP/1.1 404 Not Found : The resource requested is not found.


[edit] Examples

DELETE http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/18

Response:

HTTP/1.1 204 No Content


DELETE http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/cpu/9999

Response:

HTTP/1.1 404 Not Found
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox