<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Edit Service in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-service/m-p/1480038#M10077</link>
    <description>&lt;P&gt;This seems to solve the esri bug.&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;jprops = json.dumps&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;dict&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;props&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;service.edit&lt;SPAN&gt;(&lt;/SPAN&gt;jprops&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 29 May 2024 09:56:55 GMT</pubDate>
    <dc:creator>WoutervanderHulst</dc:creator>
    <dc:date>2024-05-29T09:56:55Z</dc:date>
    <item>
      <title>Edit Service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-service/m-p/823645#M2911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I would like to adapt the min- and max instance per node for my service with the python api. I would like to do that with the following API&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/api-reference/arcgis.gis.server.html#arcgis.gis.server.Service.edit" title="https://developers.arcgis.com/python/api-reference/arcgis.gis.server.html#arcgis.gis.server.Service.edit" rel="nofollow noopener noreferrer" target="_blank"&gt;arcgis.gis.server module — arcgis 1.8.0 documentation&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;I'm not able to edit the service, since I have no idea what the functions exactly expects. It's written that it needs "&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;Required dict. The service JSON as a dictionary."&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;So I grabed from the service the properties, edited the two properties and tried to pass the properties to the edit function.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;import arcgis
from arcgis import *
from arcgis.gis import server
import json&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;s = server.Server("https://mystandalongeserver/site/admin",username='myuser',password='mypassword')
&lt;/SPAN&gt;&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;service3 = s.services.list(folder='MyFolder',refresh=True)[3]
props = service3.properties
&lt;/SPAN&gt;&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;props['minInstancesPerNode'] = 2
props['maxInstancesPerNode'] = 4
service3.edit(props)

&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/495312_pastedImage_8.png" /&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;What exactly is needed to update the service? Unfortunately there's no example and the documentation doesn't say much.&lt;/P&gt;&lt;P&gt;Any help appreciated, thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:47:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-service/m-p/823645#M2911</guid>
      <dc:creator>LorenzMeyer1</dc:creator>
      <dc:date>2021-12-12T09:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-service/m-p/823646#M2912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem seems to be the returned json from:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;service3.properties

&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{   "serviceName": "MyService",   "type": "MapServer",   "description": "Some description.",   "capabilities": "Map,Query,Data",   "provider": "ArcObjects",   "clusterName": "default",   "minInstancesPerNode": 2,   "maxInstancesPerNode": 4,   "instancesPerContainer": 1,   "maxWaitTime": 60,   "maxStartupTime": 300,   "maxIdleTime": 180,   "maxUsageTime": 600,   "loadBalancing": "ROUND_ROBIN",   "isolationLevel": "HIGH",   "configuredState": "STARTED",   "recycleInterval": 24,   "recycleStartTime": "04:00",   "keepAliveInterval": 1800,&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;  "private": false,   "isDefault": false,&lt;/STRONG&gt;&lt;/SPAN&gt;  "maxUploadFileSize": 0,   "allowedUploadFileTypes": "",   "properties": {....}
...
}&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;The properties "private" and "isDefault" use the false-value without quotes??!!!! If I add some quotes to those values, I can hand over the properties to edit the service.&lt;/P&gt;&lt;P&gt;Bug?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use pyhton api for arcgis 1.7.1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:47:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-service/m-p/823646#M2912</guid>
      <dc:creator>LorenzMeyer1</dc:creator>
      <dc:date>2021-12-12T09:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-service/m-p/823647#M2913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: #080707; background: white;"&gt;From Esri support:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: #080707; background: white;"&gt;BUG-000091846: Boolean values in a JSON representation of a map service are not enclosed with double quotes.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 11:22:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-service/m-p/823647#M2913</guid>
      <dc:creator>LorenzMeyer1</dc:creator>
      <dc:date>2020-06-08T11:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-service/m-p/1480038#M10077</link>
      <description>&lt;P&gt;This seems to solve the esri bug.&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;jprops = json.dumps&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;dict&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;props&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;service.edit&lt;SPAN&gt;(&lt;/SPAN&gt;jprops&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 May 2024 09:56:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/edit-service/m-p/1480038#M10077</guid>
      <dc:creator>WoutervanderHulst</dc:creator>
      <dc:date>2024-05-29T09:56:55Z</dc:date>
    </item>
  </channel>
</rss>

