<?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: How to Register Geodatabases with ArcGIS Server using REST Server Admin API in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693138#M26578</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is that toolset exposed in ArcCatalog? I seem to recall that it is only available as python tools.&lt;BR /&gt;but if it were a tool in ArcCatalog you could run it from there and see the python being cranked out.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tried that trick for some other tasks but I can't find a tool to register a geodatabase with an ArcGIS Server.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Oct 2012 15:01:37 GMT</pubDate>
    <dc:creator>RobertWard</dc:creator>
    <dc:date>2012-10-01T15:01:37Z</dc:date>
    <item>
      <title>How to Register Geodatabases with ArcGIS Server using REST Server Admin API</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693136#M26576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to register a geodatabase with an ArcGIS server using a Python script but there is very little documentation on how to do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script I have at the moment is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Function to register a geodatabase with an ArcGIS Server
def registerGeodatabase(server, port, geodatabase, adminUser, adminPass, token=None):
&amp;nbsp;&amp;nbsp;&amp;nbsp; addCustMsg("Registering geodatabase : " + geodatabase)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get and set the token
&amp;nbsp;&amp;nbsp;&amp;nbsp; if token is None:&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; token = gentoken(server, port, adminUser, adminPass)&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; prop_dict = { "type": "egdb",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "path": "/enterpriseDatabases/" + geodatabase,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "id": "",
&amp;nbsp;&amp;nbsp; "clientPath": ""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; wrapper_dict = { "item": prop_dict }
&amp;nbsp;&amp;nbsp;&amp;nbsp; wrapper_encode = urllib.urlencode(wrapper_dict)

&amp;nbsp;&amp;nbsp;&amp;nbsp; print wrapper_encode
&amp;nbsp;&amp;nbsp;&amp;nbsp; create = "http://{}:{}/arcgis/admin/data/registerItem?token={}&amp;amp;f=json".format(server, port, token)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; status = urllib2.urlopen(create, wrapper_encode).read()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if 'success' in status:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SetParameter(6, True)
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SetParameter(6, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError(status)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From registering a geodatabase to the ArcGIS server using the ArcGIS manager I have worked out I need to upload the database connection file using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Register Item - http://server:port/arcgis/admin/uploads/register
Upload Part - http://server:port/arcgis/admin/uploads/&amp;lt;itemID&amp;gt;/uploadPart
Commit Item - http://server:port/arcgis/admin/uploads/&amp;lt;itemID&amp;gt;/commit&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The database connection file will have an itemID to uniquely identify it, how to I reference the database connection file in the RegisterDataItem REST call:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;http://server:port/arcgis/admin/data/registerItem
 item={
&amp;nbsp; "path": "&amp;lt;path&amp;gt;",
&amp;nbsp; "type": "&amp;lt;datadir|folder|fgdb|egdb|dataset&amp;gt;",
&amp;nbsp; "id": "&amp;lt;id&amp;gt;",
&amp;nbsp; "clientPath": "&amp;lt;client-path&amp;gt;"
 }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the ArcGIS Manager to register the geodatabase suggests it extracts the contents of the uploaded database connection file into a string but I can't find how this is done.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 08:21:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693136#M26576</guid>
      <dc:creator>RobertWard</dc:creator>
      <dc:date>2012-10-01T08:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Register Geodatabases with ArcGIS Server using REST Server Admin API</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693137#M26577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is that toolset exposed in ArcCatalog? I seem to recall that it is only available as python tools.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but if it were a tool in ArcCatalog you could run it from there and see the python being cranked out.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 12:06:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693137#M26577</guid>
      <dc:creator>KevinGooss</dc:creator>
      <dc:date>2012-10-01T12:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to Register Geodatabases with ArcGIS Server using REST Server Admin API</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693138#M26578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is that toolset exposed in ArcCatalog? I seem to recall that it is only available as python tools.&lt;BR /&gt;but if it were a tool in ArcCatalog you could run it from there and see the python being cranked out.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tried that trick for some other tasks but I can't find a tool to register a geodatabase with an ArcGIS Server.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 15:01:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693138#M26578</guid>
      <dc:creator>RobertWard</dc:creator>
      <dc:date>2012-10-01T15:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Register Geodatabases with ArcGIS Server using REST Server Admin API</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693139#M26579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is a System GeoProcessor that aim to get the connectionstring from the .sde file, and permit to register by script the database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1 - upload the .sde file using uploads admin rest endpoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 - use the /"Get Database ConnectionString" Geoprocessing function of the PublishingTools 's System folder&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; using fiddler you can trace the parameters and calls from the manager.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3 - Register the database with proper JSON String using /registerItem&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2012 15:25:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693139#M26579</guid>
      <dc:creator>PatriceFREYDIERE</dc:creator>
      <dc:date>2012-11-06T15:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to Register Geodatabases with ArcGIS Server using REST Server Admin API</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693140#M26580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know the question asks specifically how to use the REST Admin to register a data source - &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However at 10.1 SP1 we added the following to arcpy:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/AddDataStoreItem/018v00000090000000/"&gt;AddDataStoreItem&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/ListDataStoreItems/018v00000092000000/"&gt;ListDataStoreItems&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/RemoveDataStoreItem/018v00000091000000/"&gt;RemoveDataStoreItem&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/ValidateDataStoreItem/018v00000093000000/"&gt;ValidateDataStoreItem&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully you find these as an easier and more straight forward approach to adding items to the data store.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2012 16:32:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-register-geodatabases-with-arcgis-server/m-p/693140#M26580</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-11-06T16:32:00Z</dc:date>
    </item>
  </channel>
</rss>

