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

Draft Service API

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

Draft Service API

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

/services/

  • GET: returns JSON array of all Service objects

    • payload: none

    • success: 200

        [
          {
            "name": "redis",
            "updated_at": "2011-01-22 20:43:06 UTC",
            "id": "1",
            "host": "localhost",
            "status": "up"
          },
          {
            "name": "noah",
            "updated_at": "2011-01-22 20:43:06 UTC",
            "id": "2",
            "host": "localhost",
            "status": "up"
          },
          {
            "name": "http",
            "updated_at": "2011-01-22 20:43:06 UTC",
            "id": "3",
            "host": "host1.domain.com",
            "status": "pending"
          },
          {
            "name": "https",
            "updated_at": "2011-01-22 20:43:06 UTC",
            "id": "4",
            "host": "host1.domain.com",
            "status": "pending"
          }
        ]
      
    • 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.

/services/servicename

  • GET: returns JSON array for all Services named servicename

    • payload: none

    • success: 200

        [
          {
            "name": "http",
            "updated_at": "2011-01-22 20:43:06 UTC",
            "id": "3",
            "host": "host1.domain.com",
            "status": "pending"
          },
          {
            "name": "http",
            "updated_at": "2011-01-22 20:43:06 UTC",
            "id": "7",
            "host": "host2.domain.com",
            "status": "pending"
          },
          {
            "name": "http",
            "updated_at": "2011-01-22 20:43:06 UTC",
            "id": "11",
            "host": "host3.domain.com",
            "status": "pending"
          }
        ]
      
    • failure: 404

    • error: 500

  • PUT: Updates or optionally creates Service servicename. Does NOT create Host in payload.

    • require options: name, host, status

    • payload:

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

        {
          "name": "https",
          "result": "success",
          "action": "add",
          "id": "18",
          "host": "localhost"
        }
      
    • failure: 404

    • error: 500

  • POST: Not supported.

  • DELETE: Not supported

/services/servicename/hostname

  • GET: Returns Service servicename for Host hostname

    • payload: none

    • success: 200

        {
          "name": "https",
          "updated_at": "2011-01-22 21:01:38 UTC",
          "id": "18",
          "host": "localhost",
          "status": "up"
        }
      
    • failure: 404

    • error: 500

  • PUT: Not supported. See Draft Host API

  • POST: Not supported. See Draft Host API

  • DELETE: Deletes Service servicename for Host hostname

    • payload: none

    • success: 200

        {
          "result": "success",
          "action": "delete",
          "id": "18",
          "host": "localhost",
          "service":"https"
        }
      
    • failure: 404

    • error: 500