span8
span4
span8
span4
In the first 5 parts of this tutorial, we look at different stages a workflow can go through and how changes (Updates & Deletes) can be deployed, migrated & rolled back on a staging (FME Server STG)and a production (FME Server PROD) server.Now that we understand the basic functionality and capabilities of Project in FME Server we are ready to automate our Deployment to not only keep our 2 Servers in sync and reduce risk but also to save time and minimize manual interaction.
To do that let's create a workspace (download here:automate-deployments.fmw) that uses theFME Server REST APIto carry out all the tasks that we completed in this tutorial so far in one single job:
To be able to use the REST API of FME Server we need to authenticate to FME Server to make sure we are authorized to use the REST API.We can generate a token for this purpose.Please note that we will need tokens for users with the fmesuperuser role to be able to use the migration REST API.Make sure to check out the FME Serversecurity documentationfor more details.In the attached workspace, the base URLs of the 2 FME Server installations and the tokens are specified via published parameters.This way we only need to specify them once to call several different REST API calls in one workspace.Another published parameter will be used to specify the name of the project which is a parameter that is needed in all REST API calls used in this example.The last published parameter holds the location for the backups.
We can use the HTTPCaller to make FME Server REST API calls.There are 3 essential REST endpoints that are used in this workspace.Let's start with exporting our project:
/fmerest/v3/migration/backup/download
To download a project we use the migration endpoint.To only download a specific project from FME Server and not an entire FME Server project we need to make sure that we specify the project name as a form parameter.Check out the HTTPCaller transformers in for exporting fromFME Server STG&FME Server PRODin the attached workspace and make sure to check outREST API documentationfor further details.The downloaded projects can then be written to a designated location for backups of the staging & production environment with an AttributeFileWriter.To create a history of backups the @DateTimeNow() function can be used a prefix to the file names to add a unique timestamp to all backups.
/fmerest/v3/projects/projects/$(projectName)/deleteall
在我们上传/我们的项目部署到产品ion server we need to delete the existing project to make that changes that include deletions in the project will be respected.For more details on this REST endpoint check outthe documentationand the HTTPCaller deleting the project in the attached workspace.
/fmerest/v3/migration/restore/upload?importMode=INSERT&pauseNotifications=false
Now we can upload/deploy the project that was exported fromFME Server STGearlier toFME Server PROD.For this task, we will again use the migration REST API to upload the project to our production environment.Make sure to check out theREST API documentationand compare it with the settings in the HTTPCaller to get familiar with the concept of using the REST API of FMEServer in a workspace.
To capture all information if anything goes wrong and a couple of Loggers can be added.A Terminator can also help to stop a workspace at a certain point if we already know something went wrong.
The provided workspace is an example to showcase some ideas for automating deployments following the concepts we examined in this Tutorial using FME Server Projects.There are a lot of things and functionality provided by FME that can be added to this, so please use this example as starting point to explore the possibilities.
Part 5 - Deploy changes (delete)
Part 2 - Create & Deploy a Project
Part 3 - Deploy changes (update)
Tutorial: Automation (Integration) Planning and Deployment with FME Server
FME Server as a WebHook for littleBits
Getting Started with Automations
Publish a littleBits workspace as an FME Server Workspace Subscription
© 2019 Safe Software Inc |Legal