Public API for launching containers?

Hi team!

Does Fly support a public API that I could post HTTP to, to spin up a new app?

I’d love to be able to offer my customers (who aren’t very technical) the ability to spin up specific docker containers with the push of a button on a website.

Much love, Hugh

We have two public APIs actually:

I really feel like you need machines! We talk more about it here: Fly Machines: an API for fast-booting VMs · Fly

Thought I must say GraphQL is prone to changes so stay tuned on the Playground to be up to date with our format.

1 Like

Perrrrfect yes Machines API is exactly what I’m looking for :slight_smile:

Thank you!

1 Like

@lubien - is there a way of provisioning volumes via the API that can be used with each Machine?

You can, but it’s not well documented. We haven’t officially released volume support for machines yet, but you’re welcome to use it.

If you create a volume, you’ll see an ID for it in fly volumes list. You can pass that to machine run like this:

fly machine run <img> -v vol_70zy6r7y763rdjng:/data

That will mount vol_70zy6r7y763rdjng at /data. If you get this wrong, you won’t get helpful errors yet. :slight_smile:

1 Like

Thank you @kurt and @lubien - I’m looking for a HTTP API for provisioning and attaching Volumes to machines (via Machines API). The examples above seem to be for the CLI!

Do you know roughly when the HTTP API for the above might be ready?

Oh, everything in flyctl uses an HTTP API. The createVolume mutation is on our GraphQL API, here’s how it gets called: flyctl/resource_volumes.go at 994c20db1aaed2cec82d5f3f930f461a95aba030 · superfly/flyctl · GitHub

The -v argument gets turned into mounts on the generated machine config: flyctl/types.go at e1a65d5b087684092c2ffb880d43f343dd79c59e · superfly/flyctl · GitHub

Gotcha! I’ll reverse engineer the CLI for anything that’s not in the formal API docs. Thank you team!