Monitoring/CPU

From Hostway API Documentation
Revision as of 13:36, 30 May 2016 by Corinne.chui (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

POST /accounts/account/dedicatedServers/dedicated_server/ipAddresses/ip_address/monitoring/cpu

This API call is deprecated!

Create CPU check

Parameters

account - string
dedicated_server - string
ip_address - string


Request

JSON

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

monitoring

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


Result

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"
      }
   ]
}

monitoring

type - string
cpu
links - list
Hypermedia for this resource.
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
options
options.maxLoad - int


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


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

GET /accounts/account/dedicatedServers/dedicated_server/ipAddresses/ip_address/monitoring/cpu/id

This API call is deprecated!

Get CPU check details

Parameters

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


Result

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"
      }
   ]
}

monitoring

type - string
cpu
links - list
Hypermedia for this resource.
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
options
options.maxLoad - number


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.


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


PUT /accounts/account/dedicatedServers/dedicated_server/ipAddresses/ip_address/monitoring/cpu/id

This API call is deprecated!

Update CPU check

Parameters

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

Request

JSON

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

monitoring

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

Result

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"
      }
   ]
}

monitoring

type - string
cpu
links - list
Hypermedia for this resource.
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
options
options.maxLoad - int


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.

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


DELETE /accounts/account/dedicatedServers/dedicated_server/ipAddresses/ip_address/monitoring/cpu/id

This API call is deprecated!

Delete CPU check


Parameters

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


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.


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