I am trying to publish workspaces via the REST api. Ideally I would like to programmatically get the workspaces dependencies before publishing to make sure the resources are on the server. When I manually publish via Desktop I get a warning about dependencies, I would like to access this info before publishing with REST. I am making the REST calls with Python so if I had a way to get the dependencies with Python that would be real neat.
Solved
Query a workspace for resource dependencies
Best answer by jlutherthomas
So, @2dews and @larry I've got the scoop on what the differences are between REST API and FME Publishing Wizard (I will edit my previous answer)
View original
You can publish to FME Server using the REST API, however this isn't something that we recommend, as the publishing wizard is doing additional stuff to the REST API.
What the FME Desktop Publishing Wizard can do, that the REST API can't:
- Source dataset paths are updated if files are uploaded to FME Server
- Named connections may be renamed when uploaded to FME Server, due to character restrictions. This also includes named connections used in web-as-a-filesystem workflows
- Service registration options are cached within the workspace so they can be used in a future publish. They don't affect the workspace behaviour itself
- Disable destination redirects (to visualizer or to FFS)
- Cache last published repository name and workspace name
So the publishing wizard has methods to search the workspace for all of the workspace dependencies that are part of the publishing process, however this is not available through an API call. So if you use the REST API to publish a workspace, you will need to tell the API everything it will need to know to run the workspace as you want. The API calls out to FME Server, where in this case the API wouldn't be valid as it needs to look at a workspace before it's published.
Because of this, we do not recommend using the REST API to publish workspaces to FME Server, as it isn't guaranteed that it will behave as expected compared to publishing through the Publishing Wizard. So I wouldn't be surprised if you get situations where it doesn't work correctly.
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.