<?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: Get  ArcGIS Server Licenses List using REST and ArcPy in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/get-arcgis-server-licenses-list-using-rest-and/m-p/85551#M386</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm glad the code helped you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Dec 2018 07:58:41 GMT</pubDate>
    <dc:creator>PanagiotisPapadopoulos</dc:creator>
    <dc:date>2018-12-05T07:58:41Z</dc:date>
    <item>
      <title>Get  ArcGIS Server Licenses List using REST and ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/get-arcgis-server-licenses-list-using-rest-and/m-p/85548#M383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found following link to get ArcGIS server and extension list with their expiry details using REST:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/rest/enterprise-administration/server/licenses.htm" title="https://developers.arcgis.com/rest/enterprise-administration/server/licenses.htm"&gt;Licenses—ArcGIS REST API: Administer your server | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with ArcGIS server 10.4.1 and python 2.7.1(32 bit)&lt;/P&gt;&lt;P&gt;If I navigate to the URL mentioned in documentation, it is not working.&lt;/P&gt;&lt;P&gt;Instead,Corrected URL:&amp;nbsp;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fserver%3Aport%2Farcgis%2Fadmin%2F" rel="nofollow" target="_blank"&gt;http://server:port/arcgis/admin/&lt;/A&gt;&lt;STRONG&gt;System&lt;/STRONG&gt;/licenses&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;&lt;SPAN&gt;I want to get the license list using Arcpy and trying to hit same URL but getting 302 as response code. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;&lt;SPAN&gt;Is there any constraint on this URL ?just I am trying to use resource listed under 'system' folder? or If I am trying to get license using wrong way?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;&lt;SPAN&gt;Thanks for your help!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;&lt;SPAN&gt;Amruta&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2018 07:31:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/get-arcgis-server-licenses-list-using-rest-and/m-p/85548#M383</guid>
      <dc:creator>AmrutaBildikar</dc:creator>
      <dc:date>2018-12-03T07:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get  ArcGIS Server Licenses List using REST and ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/get-arcgis-server-licenses-list-using-rest-and/m-p/85549#M384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This python script may helps you. In my case the arcgis server rest end point is through webadaptor and I have the admin option enabled. If you try to access the rest through port 6443 then you have to configure the certificate on ArcGIS Server because a SSL certificate error will arise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;import requests&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;import json&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;print("Start -----")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;UserName = '&amp;lt;user name&amp;gt;'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;PassWord = '&amp;lt;password&amp;gt;'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;### GET A TOKEN&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;print("Getting token")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;token_URL = "&lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/https:" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;domain name&amp;gt;/portal/sharing/generateToken"&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;token_params = {"username":UserName,"password": PassWord,"referer": "&lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/https:" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;domain name&amp;gt;","f":"json","expiration":60}&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;r = requests.post(token_URL,token_params)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;token_obj= r.json()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;token = token_obj["token"]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;### SET THE PARAMETERS&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;print("Creating parameters")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;newParams = {'f':'json'}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;url='&lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/https:" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;domain name&amp;gt;/server/admin/system/licenses?&amp;amp;token={}'.format(token)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;### SEND THE REQUEST&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;print("Sending request")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;r = requests.post(url,newParams)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;print(r.json())&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;print("Script complete")&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2018 08:31:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/get-arcgis-server-licenses-list-using-rest-and/m-p/85549#M384</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2018-12-03T08:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get  ArcGIS Server Licenses List using REST and ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/get-arcgis-server-licenses-list-using-rest-and/m-p/85550#M385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you so much for the prompt response. I am able to get the response successfully!&lt;/P&gt;&lt;P&gt;One thing I will check now is&amp;nbsp;response coming in HTML and not JSON and I am not working with requests, but working with 'HttpLib' But thanks Anyway for the code snippet!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amruta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2018 10:21:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/get-arcgis-server-licenses-list-using-rest-and/m-p/85550#M385</guid>
      <dc:creator>AmrutaBildikar</dc:creator>
      <dc:date>2018-12-04T10:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get  ArcGIS Server Licenses List using REST and ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/get-arcgis-server-licenses-list-using-rest-and/m-p/85551#M386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm glad the code helped you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2018 07:58:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/get-arcgis-server-licenses-list-using-rest-and/m-p/85551#M386</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2018-12-05T07:58:41Z</dc:date>
    </item>
  </channel>
</rss>

