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

Draft Configuration API

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

Draft Configuration API

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

/configurations/

  • GET: returns JSON array of all Configuration objects

    • payload: none

    • success: 200

        [
          {
            "name": "redis",
            "format": "string",
            "body": "redis://127.0.0.1:6379/0",
            "application": "noah",
            "id": "1",
            "update_at": "2011-01-22 07:55:48 UTC"
          },
          {
            "name": "host",
            "format": "string",
            "body": "localhost",
            "application": "noah",
            "id": "2",
            "update_at": "2011-01-22 07:55:48 UTC"
          },
          {
            "name": "port",
            "format": "string",
            "body": "9292",
            "application": "noah",
            "id": "3",
            "update_at": "2011-01-22 07:55:48 UTC"
          },
          {
            "name": "database.yml",
            "format": "yaml",
            "body": "development:\n  database: development_database\n  adapter: mysql\n  username: dev_user\n  password: dev_password\n",
            "application": "myrailsapp1",
            "id": "4",
            "update_at": "2011-01-22 07:55:48 UTC"
          },
          {
            "name": "config.json",
            "format": "json",
            "body": "{\n  \"id\":\"hostname\",\n  \"data\":\"localhost\"\n}\n",
            "application": "myrestapp1",
            "id": "5",
            "update_at": "2011-01-22 07:55:48 UTC"
          }
        ]
      
    • 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.

/configurations/appname

  • GET: returns JSON array of all Configuration objects for Application appname

    • payload: none

    • success: 200

        [
          {
            "name": "redis",
            "format": "string",
            "body": "redis://127.0.0.1:6379/0",
            "application": "noah",
            "id": "1",
            "update_at": "2011-01-22 07:55:48 UTC"
          },
          {
            "name": "host",
            "format": "string",
            "body": "localhost",
            "application": "noah",
            "id": "2",
            "update_at": "2011-01-22 07:55:48 UTC"
          },
          {
            "name": "port",
            "format": "string",
            "body": "9292",
            "application": "noah",
            "id": "3",
            "update_at": "2011-01-22 07:55:48 UTC"
          }
        ]
      
    • failure: 404

    • error: 500

  • PUT: Not supported. See Draft Application API

  • POST: Not supported. See Draft Application API

  • DELETE: No supported. See Draft Application API

/configurations/appname/configname

  • GET: returns body of Configuration item configname for Application appname, optionally setting proper mime-type

    • payload: none

    • success: 200 (ex. GET /myrailsapp1/database.yml)

        development:
          database: development_database
          adapter: mysql
          username: dev_user
          password: dev_password
      
    • failure: 404

    • error: 500

  • PUT: Updates or creates the configuration item configname for application appname. Also creates Application appname if non-existant.

    • required options: body, format

    • payload:

        {
          "format":"yaml",
          "body":"development:\n  database: development_database\n  adapter: mysql\n  username: dev_user\n  password: dev_password\n"
        }
      
    • success: 200 (note action and dependencies will change based on config/application being created vs. updated)

        {"result":"success","id":"6","action":"update","dependencies":"updated","application":"anappp","item":"anconfig"}
      
    • failure: 500

    • error: 500

  • POST: Not supported.

  • DELETE: Deletes the given Configuration item configname for Application appname. Does NOT delete appname.

    • payload: none

    • success: 200

        {
          "result":"success",
          "action":"delete",
          "id":"5",
          "application":"myrestapp1",
          "item":"config.json"
        }
      
    • failure: 404

    • error: 500