Could somebody give me an overview of how to call the Juju controller API from my own application?
I’ve done a little looking around and it looks like the API is all websockets? Or is there a REST API. I’m just looking for a quick pointer on how it is designed and where I might go for more information. I found the schema file, but I don’t know exactly how that translates into requests I can make to the server.
The Juju API is accessed over the websocket using RPC style calls. You can take a look at the javascript lib juju docs and the examples to get up to speed quickly on interacting with the Juju API.
I’m currently in the process of rewriting the js libjuju to use TypeScript so that every call and response has detailed response and type information as well as to fix some DX issues we’ve had over the years but this version of the API is well used, stable, and the new one won’t change much wrt how the API is consumed.
You can also see how the Juju Dashboard uses this library.
While not strictly about the TS conversion this updated schema issue will be closed when the conversion is complete. I’ve been running into minor issues here and there with the new Juju schema which have required updates to it from the Juju side so it’s been a bit of a hot-potatoe of late. I’m hoping to have it up, at least in beta form within the next week or so