Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Draft Host API

John E. Vincent edited this page Mar 19, 2011 · 3 revisions

Draft Host API

The following API is subject to change as suggestions and neccessity dictates.

/hosts/

  • GET: returns JSON array of all Host objects including Service objects

    • payload: none

    • success: 200

        [
          {
            "name": "localhost",
            "updated_at": "2011-01-22 07:55:48 UTC",
            "id": "1",
            "services": [
              {
        	"name": "redis",
        	"updated_at": "2011-01-22 07:55:48 UTC",
        	"id": "1",
        	"host": "localhost",
        	"status": "up"
              }
            ],
            "status": "up"
          },
          {
            "name": "host1.domain.com",
            "updated_at": "2011-01-22 07:55:48 UTC",
            "id": "2",
            "services": [
              {
        	"name": "https",
        	"updated_at": "2011-01-22 07:55:48 UTC",
        	"id": "4",
        	"host": "host1.domain.com",
        	"status": "pending"
              },
              {
        	"name": "smtp",
        	"updated_at": "2011-01-22 07:55:48 UTC",
        	"id": "5",
        	"host": "host1.domain.com",
        	"status": "pending"
              },
              {
        	"name": "mysql",
        	"updated_at": "2011-01-22 07:55:48 UTC",
        	"id": "6",
        	"host": "host1.domain.com",
        	"status": "pending"
              },
              {
        	"name": "noah",
        	"updated_at": "2011-01-22 08:22:33 UTC",
        	"id": "15",
        	"host": "host1.domain.com",
        	"status": "up"
              }
            ],
            "status": "up"
          }
        ]
      
    • failure: 404

    • error: 500

  • PUT: Not supported. Possible future support for bulk operations

  • POST: not supported. Possible future support for bulk operations

  • DELETE: not supported.

/hosts/hostname

  • GET: returns JSON object for Host hostname including Services

    • payload: none

    • success: 200

        {
          "name": "localhost",
          "updated_at": "2011-01-22 07:55:48 UTC",
          "id": "1",
          "services": [
            {
              "name": "redis",
              "updated_at": "2011-01-22 07:55:48 UTC",
              "id": "1",
              "host": "localhost",
              "status": "up"
            }
          ],
          "status": "up"
        }
      
    • failure: 404

    • error: 500

  • PUT: Updates or creates Host hostname

    • require options: name, status

    • payload:

        {
          "name":"localhost",
          "status":"down" 
        }
      
    • success: 200

        {
          "result":"success",
          "id":"5",
          "status":"down",
          "name":"localhost"
        }
      
    • failure: 404

    • error: 500

  • POST: Not supported.

  • DELETE: Deletes Host object hostname and all dependent Service objects

    • payload: none

    • success: 200

        {
          "result":"success",
          "id":"5",
          "name":"localhost",
          "service_count":"0"
        }
      

/hosts/hostname/servicename

  • GET: Returns Service servicename for Host hostname

    • payload: none

    • success: 200

        {
          "id":"2",
          "name":"noah",
          "status":"up",
          "updated_at":"2011-01-22 20:43:06 UTC",
          "host":"localhost"
        }
      
    • failure: 404

    • error: 500

  • PUT: Not supported. See Draft Service API

  • POST: Not supported. See Draft Service API

  • DELETE: Not supported. See Draft Service API

Clone this wiki locally