Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New endpoints for mobile integration #25

Open
ryanj opened this issue Apr 6, 2015 · 4 comments
Open

New endpoints for mobile integration #25

ryanj opened this issue Apr 6, 2015 · 4 comments

Comments

@ryanj
Copy link
Contributor

ryanj commented Apr 6, 2015

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.

@bleathem
Copy link
Owner

bleathem commented Apr 7, 2015

How about moving /changes to /container/changes?

@ryanj
Copy link
Contributor Author

ryanj commented Apr 9, 2015

Sounds good. I'm working out API implementation here: https://github.com/ryanj/1k-commander

Up next:

@ryanj
Copy link
Contributor Author

ryanj commented Apr 13, 2015

Sounds like we may be sending PNGs instead of text-based "claims". An admin review queue may be needed.

We can't store PNG data in the ENV. PNG images will be destroyed when the container is deleted.

@ryanj
Copy link
Contributor Author

ryanj commented Apr 13, 2015

Mobile / Feedhenry team is going to own the data validation UI. They'll post the cleaned result directly to a container. All data will be lost when/if the container is destroyed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants