Monitoring/Disk

From Hostway API Documentation
Revision as of 07:17, 13 May 2015 by Mitko.georgiev (Talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

POST /accounts/account_number/dedicatedServers/dedicated_server/ipAddresses/ip_address/monitoring/disk

This API call is deprecated!

Creates Disk check

Parameters

account_number - string
dedicated_server - string
ip_address - string

Request

JSON

 {
   "monitoring": {
      "check": {
         "enabled": true,
         "enabledAlert": false         
      },
      "options": {
         "freeSpace": 10, 
         "partition": "/"
      }      
   }
}

monitoring

check
check.enabled - boolean
Enable the check
check.enabledAlert - boolean
Enable alerts
options
options.freeSpace - int
The disk space usage limit for check alerts
options.partition - string
The partition identifier

Response

JSON

{
   "monitoring": {
      "type": "disk", 
      "options": {
         "freeSpace": 10, 
         "partition": "/"
      }, 
      "check": {
         "status": {status}, 
         "lastCheck": {last_check}, 
         "enabledAlert": {enabled_alert}, 
         "enabled": {enabled}, 
         "id": {id}
      }
   }, 
   "links": [
     {
       "href": "http(s)://{api_server}/accounts/{account_id}/dedicatedServers/{dedicated_server_id}/ipAddresses/{ip_address}/monitoring/disk/{id}", 
       "rel": "self"
     }
   ]
}

monitoring

type - string
disk
links - list
Hypermedia for this resource.
check
check.id - string
Unique identifier for this check.
check.status
Status of the disk check - possible values: null, OK, Warning, Critical, Unknown
check.lastCheck
Time of last disk check
check.enabled - boolean
Is the check enabled
check.enabledAlert - boolean
Are alerts enabled
options
options.freeSpace - int
The disk space usage limit for check alerts
options.partition - string
The partition identifier

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 disk check for Dedicated Server per IP is allowed

Examples

Successfully create a disk check

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

Request:

{"monitoring": {"check": {"enabled": true, "enabledAlert": false}, "options": {"freeSpace" : 10, "partition" : "/"}}}

Response Code:

HTTP/1.1 201 Created

Response Body:

{
   "monitoring": {
      "type": "disk", 
      "options": {
         "freeSpace": 10,
         "partition": "/" 
      }, 
      "check": {
         "status": null, 
         "lastCheck": null, 
         "enabledAlert": false, 
         "enabled": true, 
         "id": 17
      }
   }, 
   "links": [
      {
         "href": "http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/disk/17", 
         "rel": "self"
      }
   ]
}


Bad request - missing options in the request body

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

Request:

{"monitoring": {"check": {"enabled": false, "enabledAlert": false}}}

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{"badRequest": {"message": "POST data error", "code": 400, "details": {"monitoring.options": "Required"}}}


Request to create disk check for a missing dedicated server or IP address

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

Request:

{"monitoring": {"check": {"enabled": true, "enabledAlert": false}, "options": {"freeSpace" : 10, "partition" : "/"}}}

Response Code:

HTTP/1.1 404 Not Found


Add an existing disk check

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

Request:

{"monitoring": {"check": {"enabled": true, "enabledAlert": false}, "options": {"freeSpace" : 10, "partition" : "/"}}}

Response Code:

HTTP/1.1 409 Conflict

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

This API call is deprecated!

Get disk check details

Parameters

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

Response

JSON

{
   "monitoring": {
      "type": disk, 
      "options": {
         "freeSpace": 10, 
         "partition": "/" 
      },
      "check": {
         "status": {status}, 
         "lastCheck": {last_check}, 
         "enabledAlert": {enabled_alert}, 
         "enabled": {enabled}, 
         "id": 17
      }
   }, 
   "links": [
      {
         "href": "http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/disk/{id}", 
         "rel": "self"
      }
   ]
}

monitoring

type - string
disk
links - list
Hypermedia for this resource.
check
check.id - string
Unique identifier for this check.
check.status
Status of the disk check - possible values: null, OK, Warning, Critical, Unknown
check.lastCheck
Time of last disk check
check.enabled - boolean
Is the check enabled
check.enabledAlert - boolean
Are alerts enabled
options
options.freeSpace - int
The disk space usage limit for check alerts
options.partition - string
The partition used for check


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

View disk check details

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

Response Code:

HTTP/1.1 200 OK

Response Body:

{
   "monitoring": {
      "type": "disk", 
      "options": {
         "freeSpace": 10, 
         "partition": "/" 
      }, 
      "check": {
         "status": null, 
         "lastCheck": null, 
         "enabledAlert": false, 
         "enabled": true, 
         "id": 17
      }
   }, 
   "links": [
      {
         "href": "http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/disk/17", 
         "rel": "self"
      }
   ]
}

Access a non-existing disk check

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

Response Code:

HTTP/1.1 404 Not Found

Request a check for missing server or IP addresss

GET http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{fake_server}/ipAddresses/{ip_address}/monitoring/disk/17
GET http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{fake_ip}/monitoring/disk/17

Response Code:

HTTP/1.1 404 Not Found

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

This API call is deprecated!

Update disk check

Parameters

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

Request

JSON

{
   "monitoring": {
      "check": {
            "enabled": {enabled}, 
            "enabledAlert": {enabled_alert}
         }, 
      "options": {
         "freeSpace" : 15, 
         "partition" : "/"
      },
   }
}

monitoring

check
check.enabled - boolean
Enable the check
check.enabledAlert - boolean
Enable alerts
options
options.freeSpace - int
The disk space usage limit for check alerts
options.partition - string
The disk partition identifier


Response

JSON

{
   "monitoring": {
      "type": "{type}", 
      "options": {
         "freeSpace": 15, 
         "partition": "/"
      },
      "check": {
         "status": {status}, 
         "lastCheck": {last_check}, 
         "enabledAlert": {enabledAlert}, 
         "enabled": {enabled}, 
         "id": {id}
      }
   }, 
   "links": [
      {
         "href": "http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/disk/{id}", 
         "rel": "self"
      }
   ]
}

monitoring

type - string
disk
links - list
Hypermedia for this resource.
check
check.id - string
Unique identifier for this check.
check.status
Status of the disk check - possible values: null, OK, Warning, Critical, Unknown
check.lastCheck
Time of last disk check
check.enabled - boolean
Is the check enabled
check.enabledAlert - boolean
Are alerts enabled
options
options.freeSpace - int
The disk space usage limit for check alerts
options.partition - string
The disk partition identifier


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

Update existing disk check

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

Request:

{"monitoring": {"check": {"enabled": true, "enabledAlert": false}, "options": {"freeSpace": 15, "partition": "/"}}}

Response Code:

HTTP/1.1 200 OK

Response Body:

{
   "monitoring": {
      "type": "disk", 
      "options": {
         "freeSpace": 15, 
         "partition": "/" 
      }, 
      "check": {
         "status": null, 
         "lastCheck": 1334148166, 
         "enabledAlert": false, 
         "enabled": true, 
         "id": 17
      }
   }, 
   "links": [
      {
         "href": "http(s)://{api_server}/accounts/{account_number}/dedicatedServers/{dedicated_server}/ipAddresses/{ip_address}/monitoring/disk/17", 
         "rel": "self"
      }
   ]
}

Bad request - update a disk check with wrong request data

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

Request:

{"monitoring": {"options": {"freeSpace" : 15, "partition" : "/"}}}

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{"badRequest": {"message": "POST data error", "code": 400, "details": {"monitoring.check": "Required"}}}


Try to update a missing disk check resource

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

Request:

{"monitoring": {"check": {"enabled": true, "enabledAlert": false}, "options": {"freeSpace" : 15, "partition" : "/"}}}

Response Code:

HTTP/1.1 404 Not Found

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

This API call is deprecated!

Delete disk check

Parameters

account - string
dedicated_server - string
ip_address - string
id - string
Id of the disk 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

Successfully delete a disk check

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

Response Code:

HTTP/1.1 204 No Content


Request to delete a missing disk check resource

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

Response Code:

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