Skip to content

New endpoints for mobile integration #25

Description

@ryanj

mocking out ideas for mobile integration endpoints...

GET /containers

This should return the full list of known demo containers. A kubernetes label can be used to track these instances and to make sure our viz apps are excluded from the result:

[{
  id: 4f903438061c,
  hostname: "http://4f903438061c.containers.example.com",
  env: {}
},
{
  id: 1265e16d0c28,
  hostname: "http://1265e16d0c28.containers.example.com",
  env: {
    user_id: 123456,
    claim: "claimed by ryanj');DROP TABLE CONTAINERS;--"
  }
},
{
  id: ac1d5afd7b69,
  hostname: "http://ac1d5afd7b69.containers.example.com",
  env: {}
},

...

{
  id: 7c89455832dd,
  hostname: "http://7c89455832dd.containers.example.com",
  env: {
    user_id: 234567,
    claim: "claimed by bleathem"
  }
}]

WS GET /changes

Listen to a websocket stream of status updates

GET /container/id

should return a single item

{
  id: 7c89455832dd,
  hostname: "http://7c89455832dd.containers.example.com",
  env: {
    user_id: 234567,
    claim: "claimed by bleathem"
  }
}

PUT /container/id

Set ENV keys for this container in the querystring to claim (or steal):

  /container/7c89455832dd?user_id=INT&claim=urlencoded%20VARCHAR256

DELETE /container/id

Kills the container (using docker kill id), but does not remove the ENV state (stored in kubernetes). K8s should recover the app, including any provided ENV keys.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions