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服务器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:自动化,deployments.fmw) that uses theFME Server的REST API至 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.请一定要检查出 FME Server安全文档for 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服务器PRODin the attached workspace and make sure to check outREST API文档for 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
之前我们上传/部署我们的项目,我们需要删除现有的项目,使只有包括在项目缺失的变化会受到尊重生产服务器。欲了解更多详细信息,在这个REST端点退房文件和HTTPCaller删除的连接工作空间中的项目。
/ fmerest / V3 /迁移/恢复/上传?importMode = INSERT和pauseNotifications = FALSE
现在,我们可以上传/部署从出口项目FME Server的STG早些时候,FME服务器PROD。对于这个任务,我们将再次使用迁移REST API的项目上传到我们的生产环境。请一定要检查出REST API文档并与在HTTPCaller的设置进行比较,以熟悉使用FMEServer的REST API在工作区的概念。
要捕获所有信息,如果出现任何错误,可以增加了几个伐木工人。终止也可以帮助在某一点停止工作空间,如果我们已经知道出事了。
所提供的工作空间,以展示自动化的部署下,我们使用FME Server的项目在本教程中审查的概念有些想法的例子。有很多的由FME提供的东西和功能,可以添加到这一点,所以请使用这个例子作为起点,探索的可能性。
© 2019 Safe Software Inc |Legal