<?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: Updating metadata for image services in ArcGIS Image Server Questions</title>
    <link>https://community.esri.com/t5/arcgis-image-server-questions/updating-metadata-for-image-services/m-p/1344766#M1688</link>
    <description>&lt;P&gt;In the end, we just edit the xml of the draft service definition to add in the content we want before staging the final service definition.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a pretty powerful back door, if you get the xml elements right. This allowed us to add metadata, enable WMS for image services, and a number of other functions that aren't included in the programmatic publishing tools.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Nov 2023 22:58:23 GMT</pubDate>
    <dc:creator>Heidi_Kristenson</dc:creator>
    <dc:date>2023-11-01T22:58:23Z</dc:date>
    <item>
      <title>Updating metadata for image services</title>
      <link>https://community.esri.com/t5/arcgis-image-server-questions/updating-metadata-for-image-services/m-p/1258770#M1660</link>
      <description>&lt;P&gt;When we publish image services programmatically, only a few of the metadata fields can be populated during the creation of a service definition. We would like to have a programmatic approach for updating the rest of the metadata fields (it appears that only description and tags can be populated in the CreateImageSDDraft command).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the arcpy metadata module, but it seems to treat the item as read-only. I am able to manually edit the metadata fields in the Server Manager in the Item Description section of the service, and also to edit it in ArcGIS Pro via an ags connection in the Catalog pane without any problems. Is this just not supported in the metadata module, or am I doing something wrong?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I tried a few different paths, and both of the URL-based options returned the expected service description (I added a few test print statements before the conditional). The path using the ags returned 'None', so that option may not have been hitting the right target. I thought this might be the best option, as the ags file contains credentials, but that doesn't help if it doesn't find the right target.&lt;/P&gt;&lt;P&gt;I tried setting the service to allow "Edit" functionality, but I expect that's not really referencing the metadata. Is there another setting somewhere that needs to be adjusted?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suspect this might have to do with credentials. I tried running the script directly from the server, and got the same result, but maybe even there I'd need to provide some sort of credential. Any ideas where I'd add that in, or if that's truly the issue?&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;arcpy&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;arcpy &lt;SPAN&gt;import &lt;/SPAN&gt;metadata &lt;SPAN&gt;as &lt;/SPAN&gt;md&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Create a new Metadata object and add some content to it&lt;BR /&gt;&lt;/SPAN&gt;new_md = md.Metadata()&lt;BR /&gt;new_md.title = &lt;SPAN&gt;'My new title'&lt;BR /&gt;&lt;/SPAN&gt;new_md.tags = &lt;SPAN&gt;'tag1, tag2'&lt;BR /&gt;&lt;/SPAN&gt;new_md.summary = &lt;SPAN&gt;'summary language'&lt;BR /&gt;&lt;/SPAN&gt;new_md.description = &lt;SPAN&gt;'description language'&lt;BR /&gt;&lt;/SPAN&gt;new_md.credits = &lt;SPAN&gt;'credit statement'&lt;BR /&gt;&lt;/SPAN&gt;new_md.accessConstraints = &lt;SPAN&gt;'under construction'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# Assign the Metadata object's content to a target item&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# hand_path = r'C:\Users\__\Documents\ImageServer\ImageServices\arcgis on gis-test.xxx.xxx.ags\Folder\ServiceName' # this path doesn't return expected description&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# hand_path = r'https://gis-test.xxx.xxx/arcgis/rest/services/Folder/ServiceName/ImageServer/info/metadata' # this path returns expected description&lt;BR /&gt;&lt;/SPAN&gt;hand_path = &lt;SPAN&gt;r'https://gis-test.xxx.xxx/arcgis/rest/services/Folder/ServiceName/ImageServer' &lt;/SPAN&gt;&lt;SPAN&gt;# this path also returns expected description&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;tgt_item_md = md.Metadata(hand_path)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;'is read only: %s' &lt;/SPAN&gt;% tgt_item_md.isReadOnly)  &lt;SPAN&gt;# verify that the target is, indeed, read only&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(tgt_item_md.description)  &lt;SPAN&gt;# verify that it's hitting the right target&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;if not &lt;/SPAN&gt;tgt_item_md.isReadOnly:&lt;BR /&gt;    tgt_item_md.copy(new_md)&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;'copied new metadata'&lt;/SPAN&gt;)&lt;BR /&gt;    tgt_item_md.save()&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;'new metadata saved'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;:&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;'item is read only'&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;This is what I see as output when running the script:&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;is read only: True&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Expected existing description for the image service&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;item is read only&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Process finished with exit code 0&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Feb 2023 03:32:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-server-questions/updating-metadata-for-image-services/m-p/1258770#M1660</guid>
      <dc:creator>Heidi_Kristenson</dc:creator>
      <dc:date>2023-02-16T03:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Updating metadata for image services</title>
      <link>https://community.esri.com/t5/arcgis-image-server-questions/updating-metadata-for-image-services/m-p/1258771#M1661</link>
      <description>&lt;P&gt;I looked into the credentials issue a bit more, and tried this approach prior to running the script, but got the same result:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;arcgis.gis.server &lt;SPAN&gt;import &lt;/SPAN&gt;Server&lt;BR /&gt;server_base_url = &lt;SPAN&gt;"https://gis-test.xxx.xxx/"&lt;BR /&gt;&lt;/SPAN&gt;server = Server(&lt;BR /&gt;    &lt;SPAN&gt;url&lt;/SPAN&gt;=&lt;SPAN&gt;"{}:6443/arcgis/admin"&lt;/SPAN&gt;.format(server_base_url)&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;tokenurl&lt;/SPAN&gt;=&lt;SPAN&gt;"{}:6443/arcgis/rest/generateToken"&lt;/SPAN&gt;.format(server_base_url)&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;username&lt;/SPAN&gt;=&lt;SPAN&gt;"&amp;lt;username&amp;gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;password&lt;/SPAN&gt;=&lt;SPAN&gt;"&amp;lt;password&amp;gt;"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Feb 2023 03:39:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-server-questions/updating-metadata-for-image-services/m-p/1258771#M1661</guid>
      <dc:creator>Heidi_Kristenson</dc:creator>
      <dc:date>2023-02-16T03:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Updating metadata for image services</title>
      <link>https://community.esri.com/t5/arcgis-image-server-questions/updating-metadata-for-image-services/m-p/1259115#M1662</link>
      <description>&lt;P&gt;I wasn't convinced by the port number, and ended up amending the token script as follows:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;server_base_url = &lt;SPAN&gt;"https://gis-test.asf.alaska.edu/"&lt;BR /&gt;&lt;/SPAN&gt;server = Server(&lt;BR /&gt;    &lt;SPAN&gt;url&lt;/SPAN&gt;=&lt;SPAN&gt;"{}arcgis/admin"&lt;/SPAN&gt;.format(server_base_url)&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;tokenurl&lt;/SPAN&gt;=&lt;SPAN&gt;"{}arcgis/rest/generateToken"&lt;/SPAN&gt;.format(server_base_url)&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;It now actually hits the place on our server where one could request a token, but I still get the same Read Only result.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 21:08:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-server-questions/updating-metadata-for-image-services/m-p/1259115#M1662</guid>
      <dc:creator>Heidi_Kristenson</dc:creator>
      <dc:date>2023-02-16T21:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Updating metadata for image services</title>
      <link>https://community.esri.com/t5/arcgis-image-server-questions/updating-metadata-for-image-services/m-p/1344766#M1688</link>
      <description>&lt;P&gt;In the end, we just edit the xml of the draft service definition to add in the content we want before staging the final service definition.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a pretty powerful back door, if you get the xml elements right. This allowed us to add metadata, enable WMS for image services, and a number of other functions that aren't included in the programmatic publishing tools.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 22:58:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-server-questions/updating-metadata-for-image-services/m-p/1344766#M1688</guid>
      <dc:creator>Heidi_Kristenson</dc:creator>
      <dc:date>2023-11-01T22:58:23Z</dc:date>
    </item>
  </channel>
</rss>

