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

Host API

John E. Vincent edited this page Apr 11, 2011 · 2 revisions

Host API

This is the final Host API for release 1.0

/hosts/

  • GET: returns JSON of all Host objects including truncated (name and status) Service objects

    • payload: none

    • success: 200

        {
          "localhost": {
            "created_at": "2011-04-11 04:08:18 UTC",
            "updated_at": "2011-04-11 04:08:18 UTC",
            "tags": [
      
            ],
            "id": "1",
            "links": [
      
            ],
            "services": {
              "noah": "up",
              "redis": "up"
            },
            "status": "up"
          },
          "host1.domain.com": {
            "created_at": "2011-04-11 04:08:18 UTC",
            "updated_at": "2011-04-11 04:08:18 UTC",
            "tags": [
              "production"
            ],
            "id": "2",
            "links": [
              "/my_sample_organization",
              "/my_other_org"
            ],
            "services": {
              "smtp": "pending",
              "mysql": "pending",
              "https": "pending",
              "http": "pending"
            },
            "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 truncated Services

    • payload: none

    • success: 200

        {
          "name": "host1.domain.com",
          "created_at": "2011-04-11 04:08:18 UTC",
          "updated_at": "2011-04-11 04:08:18 UTC",
          "tags": [
            "production"
          ],
          "id": "2",
          "links": [
            "/my_sample_organization",
            "/my_other_org"
          ],
          "services": {
            "smtp": "pending",
            "mysql": "pending",
            "https": "pending",
            "http": "pending"
          },
          "status": "up"
        }
      
    • failure: 404

    • error: 500

  • PUT: Updates or creates Host hostname

    • require options: name, status

    • payload:

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

        {
          "name": "some_random_host",
          "result": "success",
          "id": "5",
          "new_record": true,
          "status": "down"
        }
      
    • 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",
          "tags": [],
          "links":[],
          "status":"up",
          "updated_at":"2011-01-22 20:43:06 UTC",
          "host":"localhost"
        }
      
    • failure: 404

    • error: 500

  • PUT: Not supported. See Service API

  • POST: Not supported. See Service API

  • DELETE: Not supported. See Service API

Clone this wiki locally