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

Application API

John E. Vincent edited this page Apr 27, 2011 · 3 revisions

Application API

This is the final Application API documentation for 1.0

/applications/

  • GET: returns JSON representation of all Application objects and dependent Configuration objects

    • payload: none

    • success: 200

        {
          "myrailsapp1": {
            "created_at": "2011-04-21 06:57:42 UTC",
            "updated_at": "2011-04-21 06:57:42 UTC",
            "tags": [
              "sample_data",
              "production"
            ],
            "id": "8774fead-e63a-8e5c-0453-1b5330bbd04c",
            "links": [
              "/my_sample_organization"
            ],
            "configurations": {
              "database.yml": {
        	"format": "yaml",
        	"body": "development:\n  database: development_database\n  adapter: mysql\n  username: dev_user\n  password: dev_password\n"
              }
            }
          },
          "myrestapp1": {
            "created_at": "2011-04-21 06:57:42 UTC",
            "updated_at": "2011-04-21 06:57:42 UTC",
            "tags": [
      
            ],
            "id": "1c8f2c78-57e8-666a-2fea-ea005dad7ec2",
            "links": [
      
            ],
            "configurations": {
              "config.json": {
        	"format": "json",
        	"body": "{\n  \"id\":\"hostname\",\n  \"data\":\"localhost\"\n}\n"
              }
            }
          }
        }
      
    • 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.

/applications/appname

  • GET: returns materialized JSON of named Application object with Configuration objects

    • payload: none

    • success: 200

        {
          "name": "noah",
          "created_at": "2011-04-21 06:57:42 UTC",
          "updated_at": "2011-04-21 06:57:42 UTC",
          "tags": [
      
          ],
          "id": "606808f8-9d6e-61bf-cd57-eb1af98c4ffe",
          "links": [
      
          ],
          "configurations": {
            "redis_url": {
              "format": "string",
              "body": "redis://127.0.0.1:6379/0"
            },
            "noah_host": {
              "format": "string",
              "body": "localhost"
            },
            "noah_port": {
              "format": "string",
              "body": "9292"
            }
          }
        }
      
    • failure: 404

    • error: 500

  • PUT: Creates or Updates Application object in request path

    • required options: name

    • payload:

        {"name":"appname"}
      
    • success: 200

        {"result":"success","id":"a57a66dd-1be4-cfdc-6087-fb891e11bc99","action":"create","name":"barapp"}
      
    • failure: 500

  • DELETE: deletes the named Application object

    • payload: none

    • success: 200

        {
          "name": "foo",
          "result": "success",
          "action": "delete",
          "id": "8a83af7c-969c-c029-f234-46a3289ab7b0"
        }
      
    • failure: 404

    • error: 500

/applications/appname/configurations/configname

  • GET: returns named Configuration object for named Application object as JSON or in raw form

    • payload: Using a custom header of Accept: application/json will return the JSON representation Using any other custom Accept header will return the raw object. By default, most clients will send Accept: */* in the request. This will result in the JSON representation EVERY time. If you wish to get the raw data, the best way to ensure that is to send Accept: application/octet

    • success: 200

        {
          "id":"1",
          "name":"redis",
          "format":"string",
          "body":"redis://127.0.0.1:6379/0",
          "update_at":"2011-01-18 04:17:17 UTC",
          "application":"noah"
        }
      
    • failure: 404

    • error: 500

  • PUT: adds the named Configuration to named Application. Optionally it creates the named Application and/or Configuration if they do not exist

    • payload:

        {"body":"barbody1","format":"string"}
      
    • success: 200

        {
          "name": "barapp2",
          "result": "success",
          "action": "create",
          "id": "220ca459-5ee7-9838-f9b5-0e81f9435ff5",
          "configuration": {
            "action": "create",
            "id": "4cd77d03-bc94-e52a-9613-8676ec217ee0",
            "item": "barconf2"
          }
        }
      
    • failure: 404

    • error: 500

  • POST: Not supported.

  • DELETE: deletes the named Configuration from the named Application. Does NOT delete the underlying Configuration object

    • payload: none

    • success: 200

        {
          "name": "barapp2",
          "result": "success",
          "action": "delete",
          "id": "220ca459-5ee7-9838-f9b5-0e81f9435ff5",
          "configuration": "barconf2"
        }
      
    • failure: 404

    • error: 500