Fly.io Secret Create API

Hi, I’ve use the openapi-generator to turn the openapi spec into a rust fly.io sdk. For the most part it’s working. However I’m running into an issue where the secrets create endpoint is giving me an error due to the value that i’m passing for secret_type path parameter. Specifically I’m trying to utilize the Secret Create API Endpoint.

It’s not specified in the open api json what the possible values are for secret_type. Would anyone be able to help me out?

Is it possible that this openapi spec is out of date? Is there a new endpoint or way to do this?

Would anyone that works at Fly or the Fly API be able to tell me if the API is maintained or still supported or if the API docs are out of date?

Hi @kennetpostigo, not a current employee, but I think perhaps the secrets endpoint in the Machines API hasn’t been intentionally launched yet. Maybe @Tim_Newsham can confirm or deny.

The docs you’re looking at are generated from source code. There are hand-built docs for the Machines API, which will necessarily lag but are more human oriented and task targeted.

These currently give flyctl (fly secrets set) as the way to set secrets — there’s also the GraphQL API, which AFAIK will eventually be phased out, and isn’t officially supported for external use. Folks are aware that many customers do use it, so I’d expect the phase-out to be gentle-ish.

If you want to trace how flyctl uses Fly.io APIs in “production”, you can dig around in the flyctl source and the Go API client that was separated out from it a while back. Here’s the CreateSecret function in the flaps (Machines API) client if you’re interested. I didn’t root around far enough to see if flyctl is using flaps now or is still using GraphQL.

1 Like

Got it thanks for the links! I’ll look for the correct secret type in that source code, hopefully it’s in there.

1 Like

You’re looking for AppSecret most likely :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.