Skip to content

Decide on API Resources (URLs) #8

Description

@mikeschinkel

Use this issue to track discussions about API Resource namespace.

Base

  • Defaults to: api.pressboxx.local

Top Level / Root

  • /projects
  • /config
  • /release
  • /defaults
  • /terminal
  • /packages
  • /services
  • /hosts

Projects

  • GET /projects - Returns list of projects
  • POST /projects - Create a new project
    • Body: JSON (or hostname={hostname}?)
  • GET /projects/{hostname} - Returns project info
  • PUT /projects/{hostname} - Update project info
    • Body: Project Info in JSON (but consider application/x-www-form-urlencoded?)
  • PUT /projects/{hostname}/status - Archive/Unarchive a project
    • Body: archived or active
  • PUT /projects/{hostname}/{whatever} - Make appropriate changes
    • Body: New value for {whatever}
  • PATCH /projects/{hostname} - Archive/Unarchive a project
    • Body: JSON (or status=archived or status=active?)
  • PATCH /projects/{hostname} - Make appropriate changes
    • Body: JSON (or whatever={new_value}?)
  • DELETE /projects/{hostname} - Deletes a project

Config

  • GET /config - Returns configuration info (default: application/json)
  • PUT /config - Update configuration info
  • GET /config/ip - Returns IP address of PressBoxx (default: text/plain)
  • PUT /config/ip - Updates IP address of PressBoxx
  • GET /config/projects/path - Returns path used for projects (On Mac, probably ~/Sites)
  • PUT /config/projects/path - Updates path used for projects
  • GET /config/access/ips - Returns JSON array of IPs to allow access (default: ???)
  • PUT /config/access/ips - Update list of IP addresses
  • GET /config/access/macs - Returns JSON array of MACs to allow access (default: ???)
  • PUT /config/access/macs - Update list of MAC addresses

Release

  • GET /release - JSON object of Release info

  • GET /release/name - Name of PressBox release (e.g. "Hummingbird" or "Mustang (Ford)")

  • GET /release/version - Semver Numbered version of PressBox release

  • GET /release/installed

  • /release/installed/{installed_item}

  • /release/installed/{installed_item}/name - Name of installed item

  • /release/installed/{installed_item}/type - Type of item: command or service

  • /release/installed/{installed_item}/version - Version of installed item

  • /release/installed/{installed_item}/website - URL to describe installed item

  • /release/installed/{installed_item}/commands - Object with properties in JSON

  • /release/installed/{installed_item}/commands/{usage} - Command line to run

    {
        "name" : "Hummingbird",
        "version" : "1.0",
        "installed": { 
            "wp-cli" : {
                "name" : "wp",
                "version" : "1.2.3",
                "type" : "command",
                "commands": {
                    "run" :     "wp",
                    "version" : "wp --version"
                    "version_raw" : "echo ${$(wp --version):10:6}"
                }
            },
            "jq" : {
                "type" : "command",
                "commands": {
                    "run" :     "jq",
                    "version" : "jq -v"
                }
            },
            "nginx" : {
                "type" : "service",
                "commands": {
                    "start" : "sudo service nginx start"
                    "restart" : "sudo service nginx restart"
                    "stop" : "sudo service nginx stop"
                    "version" : "nginx -v"
                }
            },
            "redis" : {},
            "memcached" : {},
            "jq" : {},
            "python" : {},
            "ruby" : {},
            "boxx-cli" : {}
        }
    
    }
    

THE BELOW STILL NEEDS TO BE FLESHED OUT

Defaults

  • /defaults
    • Site templates
    • Project defaults
      • processvm
      • webserver
      • admin username/password (WP)

Services

For all services, not just the services installed on Release.

  • /services
    • Apache
      • mods_enabled
      • Port
      • Log file location
      • Log view
    • Nginx
      • Port
      • Log file location
      • Log view
    • MySQL
      • Port
      • Log file location
      • Log view
    • Redis
      • cache
    • Memcached
      • cache

Packages

  • /packages
  • /packages/{namespace}/{package_name}

Terminal

Used to set the versions for command line usage, e.g. what version will running php use; 5.6, 7.0, etc?

  • /terminal
  • /terminal/{command}
    • Command => 'php', 'ruby', 'python', 'apachectl', etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions