Your SlideShare is downloading. ×
Python and FME REST
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Python and FME REST

2,159

Published on

Published in: Spiritual, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,159
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Python and FME RESTRob GastonWeb Developer; FarallonGeographics, Inc. April 9, 2013
  • 2. San Francisco EAS EAS is an open source system for maintaining address data At the City and County of San Francisco, FME is being used to ETL parcel and street data used by EAS EAS uses FME Server REST API to check the status of ETL jobs before staging new data
  • 3. EAS, Python and FME EAS makes calls to FME Server REST API via automation scripts written in Python Python is used in EAS both on the backend of the web application and for automation To support automation of calls to FME Server REST services, we built a Python class (FmeServerHelper)
  • 4. Checking for an FMEWorkspace with Python Without FmeServerHelper  With FmeServerHelper
  • 5. fme_server_helper.py
  • 6. FmeServerHelper API doesJobExist - Checks to see if FME workspace exists on this host isJobRunning- Checks to see if FME workspace is currently running on this host isJobQueued - Checks to see if FME workspace is currently queued to run on this host getLatestCompletedJob - Gets the data from FME Server for the last job from a given workspace getJobId- Gets the string id from a FME Server job getJobStatus- Gets the string job status from a FME Server jobGet the code: https://code.google.com/p/eas/source/browse/trunk/automation/src/fme_server_helper.py
  • 7. FmeServerHelper API Documentation doesJobExist(jobDict) : Boolean  getLatestCompletedJob(jobDict) : Dict Checks to see if FME workspace exists on this host Gets the data from FME Server for the last job from a given PARAMETERS: workspace jobDict: Dict - a dictionary containing the workspace and repository PARAMETERS: names jobDict: Dict - a dictionary containing the workspace and repository RETURNS: names Boolean - the existence state of this workspace on this host RETURNS: Dict - a dictionary containing job data from FME Server isJobRunning(jobDict) : Boolean Checks to see if FME workspace is currently running on this host  getJobId(job) : String PARAMETERS: Gets the string id from a FME Server job jobDict: Dict - a dictionary containing the workspace and repository PARAMETERS: names job: Dict - a dictionary containing job data from FME Server RETURNS: RETURNS: Boolean - the running state of this workspace on this host String - the job id isJobQueued(jobDict) : Boolean  getJobStatus(job) : String Checks to see if FME workspace is currently queued to run on this Gets the string job status from a FME Server job host PARAMETERS: PARAMETERS: job: Dict - a dictionary containing job data from FME server jobDict: Dict - a dictionary containing the workspace and repository RETURNS: names String - the job status RETURNS: Boolean - the queued state of this workspace on this host Get the code: https://code.google.com/p/eas/source/browse/trunk/automation/src/fme_server_helper.py
  • 8. What’s Next…? Following the principle of DTSTTCPW (do the simplest thing that could possibly work), FmeServerHelper only currently supports the use cases required by EAS Since EAS is open source, anyone with the time and inclination to create a more complete API for working with FME Server can use fme_server_helper.py as a jumping off point So… get to work and have fun!
  • 9. Thank You! Questions? For more information:  Rob Gaston, rgaston(at)fargeo(dot)com  FarallonGeographics, Inc.  http://www.fargeo.com/  https://code.google.com/p/eas/

×