Skip to main content

Has anyone written a batchfile for a user to start an instance of FME Cloud using the API from a windows desktop?

I would like to allow users to start the server to access an app they need to use occasionally then the server shut down within the hour to save on running costs.

Hi. I am assuming FME won't be on the machines of the users running the script? If it is, then you could just create a workspace using the FME Cloud transformers and then run the workspace via the command line.

If they don't have FME then you will need to call the API directly. You could use curl for this, but that doesn't come standard on Windows so you would have to install that. The rough steps will be as follows:

  1. Create an API token on FME Cloud.
  2. Identify the FME Cloud API call you wish to use, it's probably this one.
  3. Use Postman to test the API call using the token you generated in step 2.
  4. Create a script to call the API. You will need to embed the API token in the script.

Once the FME Server is running, you can automatically shut down the server using the FMECloudInstanceController, more ideas here on this one. I would recommend shutting down with a few minutes before the hour as if you go 1 minute over you will be charged for another hour.


Reply