AnsweredAssumed Answered

How can I create a service in a folder other than root.

Question asked by k.steinickeesri-de-esridist Employee on Apr 17, 2018

Hi,

 

 When I create a service it always gets created in the root directory.

target_server = arcgis.gis.server.Server(server_url, username=username, password=password)
result = target_server.services.create_service(json.dumps(service_dict))

 

This actually works, but uses "_con" attribute.

folder_service_manager = arcgis.gis.server.ServiceManager(target_server.services.url+'/'+service_folder,
gis=target_server._con)
result = folder_service_manager.create_service(json.dumps(service_dict))

 

Is there a better way to do this, like changing the current folder?

 

Thanks,

Kai

Outcomes