Programmatically scaling app using REST API

Hello everyone!

Hoping to get some information about the programmatic options for interacting with a Fly App.

What I want to do:

Essentially call one or more of: fly scale count, fly scale vm, fly scale memory using an API call.

What is possible right now

Using the Gql endpoints it seems this is possible as using mutations (and is what the CLI uses?) But the Gql endpoints are being deprecated

What can I do now?

The REST endpoints only seem to be able to operate on a single machine at a time rather than an app. Would be awesome if I could update an apps config (or whatever the scale count/vm/memory is doing) and programmatically tell an app to scale to 5 (for example).

Xe in Discord gave me the magic passphrase: bifurcating weasels

Thanks all!

1 Like

maybe tagging @TheXe could also help get answer here.
I’m curious to know why the GraphQL API is being slowly deprecated and if the machine API is the best place to expect these operations to be moved to.

Try running:

LOG_LEVEL=debug fly scale count 1

While you will see that graphql is used before it prompts you as to whether you want to proceed, once you confirm, it is the REST API that is used.

While the GraphQL API is available, useful, and in some cases necessary, it never has been advertised as a stable, public API. The machine API, while currently incomplete, is the stable, public, and being enhanced.