Hi,
When I create a service it always gets created in the root directory.
target_server <SPAN class="operator token">=</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis<SPAN class="punctuation token">.</SPAN>server<SPAN class="punctuation token">.</SPAN>Server<SPAN class="punctuation token">(</SPAN>server_url<SPAN class="punctuation token">,</SPAN> username<SPAN class="operator token">=</SPAN>username<SPAN class="punctuation token">,</SPAN> password<SPAN class="operator token">=</SPAN>password<SPAN class="punctuation token">)</SPAN>
result <SPAN class="operator token">=</SPAN> target_server<SPAN class="punctuation token">.</SPAN>services<SPAN class="punctuation token">.</SPAN>create_service<SPAN class="punctuation token">(</SPAN>json<SPAN class="punctuation token">.</SPAN>dumps<SPAN class="punctuation token">(</SPAN>service_dict<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
This actually works, but uses "_con" attribute.
folder_service_manager <SPAN class="operator token">=</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis<SPAN class="punctuation token">.</SPAN>server<SPAN class="punctuation token">.</SPAN>ServiceManager<SPAN class="punctuation token">(</SPAN>target_server<SPAN class="punctuation token">.</SPAN>services<SPAN class="punctuation token">.</SPAN>url<SPAN class="operator token">+</SPAN><SPAN class="string token">'/'</SPAN><SPAN class="operator token">+</SPAN>service_folder<SPAN class="punctuation token">,</SPAN>
gis<SPAN class="operator token">=</SPAN>target_server<SPAN class="punctuation token">.</SPAN>_con<SPAN class="punctuation token">)</SPAN>
result <SPAN class="operator token">=</SPAN> folder_service_manager<SPAN class="punctuation token">.</SPAN>create_service<SPAN class="punctuation token">(</SPAN>json<SPAN class="punctuation token">.</SPAN>dumps<SPAN class="punctuation token">(</SPAN>service_dict<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Is there a better way to do this, like changing the current folder?
Thanks,
Kai