Solved

arcgis server rest api and fme


Badge

Hi!

Is it possible to start/stop services on ArcGIS Server via FME-Server using AGS REST capabilities?

Thanks.

icon

Best answer by todd_davis 3 October 2017, 02:02

View original

13 replies

Userlevel 4

If ArcGIS Server has an API entry point for what you want to accomplish, then I'd say yes, most probably.

Maybe this example can help you along?

http://server.arcgis.com/en/server/latest/administer/linux/example-stop-or-start-all-services-in-a-folder.htm

Should be possible to implement in a workspace using e.g. a PythonCaller.

Userlevel 1
Badge +12

Yes, it certainly is. There ArcGIS Rest Admin API makes it easy. Easiest to use http calls.

I will share a custom transformer that does all of this, but I am out of the office at the moment

Badge

Yes, it certainly is. There ArcGIS Rest Admin API makes it easy. Easiest to use http calls.

I will share a custom transformer that does all of this, but I am out of the office at the moment

It would be great!

 

 

Userlevel 1
Badge +12

Yes, it certainly is. There ArcGIS Rest Admin API makes it easy. Easiest to use http calls.

I will share a custom transformer that does all of this, but I am out of the office at the moment

It isn't the tidiest transformer...nowhere near it...but haven't had a chance to tidy it up. But that doesn't stop it from working. Any issue, feel free to fire them back...arcgisserver-start-stop.fmx

 

 

Badge
It isn't the tidiest transformer...nowhere near it...but haven't had a chance to tidy it up. But that doesn't stop it from working. Any issue, feel free to fire them back...arcgisserver-start-stop.fmx

 

 

Great! It works! Thank you!

 

 

 

I've cleaned up the transformer built by @todd_davis and attached it as a workbench here for anyone hoping to stop, wait, and start a Map Service in Portal for ArcGIS. Hope this is as helpful for others as it was for me! Thanks @todd_davis for getting me started.

Badge

I've cleaned up the transformer built by @todd_davis and attached it as a workbench here for anyone hoping to stop, wait, and start a Map Service in Portal for ArcGIS. Hope this is as helpful for others as it was for me! Thanks @todd_davis for getting me started.

Hi @cheriesouthwick​ I can't seem to find the attached workbench. Would you be able to reshare it? I'm currently using Python scripts to stop/start a Map Service in Portal for ArcGIS and would like to make use of the ArcGIS Rest Admin API.

 

Thank you

Userlevel 1
Badge +12

@jonathan_f_01​ ....just put up the transformer that I have not touched in a few years but probably was updated in the last four years at https://hub.safe.com/publishers/abley-limited/transformers/arcgis_s_token

This works on the Esri Server side, rather than Portal. To make it nicely work with Portal it would need a few other things such as getting the item and then the source_url. Certainly could be setup to utilise an Esri Portal Connection but have not done that yet.

 

We will be putting up a few more transformers that work with ArcGIS Online/Portal over the next few months for those that have to admin that environment, and we have a big range sitting in the backend but due to the investment in developing a wide array of these, we couldn't just let them all out freely.<

Userlevel 1
Badge +12

@jonathan_f_01​ ....just put up the transformer that I have not touched in a few years but probably was updated in the last four years at https://hub.safe.com/publishers/abley-limited/transformers/arcgis_s_token

This works on the Esri Server side, rather than Portal. To make it nicely work with Portal it would need a few other things such as getting the item and then the source_url. Certainly could be setup to utilise an Esri Portal Connection but have not done that yet.

 

We will be putting up a few more transformers that work with ArcGIS Online/Portal over the next few months for those that have to admin that environment, and we have a big range sitting in the backend but due to the investment in developing a wide array of these, we couldn't just let them all out freely.<

@jonathan_f_01​ Sorry, put the wrong one up. Should instead be https://hub.safe.com/publishers/abley-limited/transformers/arcgis_s_startstop

Badge

@todd_davis​ That's brilliant! thanks very much for sharing the transformer, it works perfectly.

@Todd Davis​ Thank you very much for sharing the transformer.

But I'm getting the below error. What could be the reason for it?

I already checked whether the server is enabled for token acquisition through an HTTP request.

"ArcGIS_S_StartStop_HTTPCaller_2 (HTTPFactory): Received HTTP response header: 'HTTP/1.1 401 Unauthorized' from 'https://url/arcgis/admin/generateToken' "

tempsnip

Userlevel 1
Badge +12

Hi,

 

Might want to get rid of that url that it is hyperlinked too!

 

Getting a 401 via Esri is not expected. Esri always gives a 200 and then a json response that contain a 401 message. So it doesn't look like it is Esri doing this.

 

From the url listed, I can see that is using what appears to be http basic over the top of the Esri install. So I believe the way around it, is to put a httpcaller prior to this transformer. That httpcaller can be a GET and pointed at the exact URL. Turn on Authentication in the httpcaller and set as Basic then add relevant username/password.

 

So what I am hoping that does is log you onto that page with the http basic, prior to the transformer trying to do its Esri stuff. That way it should be able to get in and do what it needs to.

 

If that works, can you do something for me? Maybe get the Christchurch Metro Sports Stadium finished this year. We are waiting for those hydroslides!

 

 

Thanks for the response, mate.

I tried your workaround. It seems it's an ICT issue because I'm getting the same 401. I'll let you know how it goes.

I'll let the team knows that you guys are waiting for it 😉

Reply