<?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: Start/Stop Secure Services in 10.6.1 in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646097#M24754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the python code.&amp;nbsp; Can you tell me which lines of code I would need to modify so that the code does not ignore certificate validation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does ArcGIS Server need to be configured based on the following link to properly handle tokens for the code you provided:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://enterprise.arcgis.com/en/server/latest/administer/windows/enable-token-acquisition-through-an-http-get-request.htm" title="http://enterprise.arcgis.com/en/server/latest/administer/windows/enable-token-acquisition-through-an-http-get-request.htm"&gt;Enable token acquisition through an HTTP GET request—ArcGIS Server Administration (Windows) | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example provided in the original post and even in the code that you provided, is there a way to call the service without providing a port?&amp;nbsp; My org has a trusted certificate setup on our load balancer that is separate from the internal load-balancing of ArcGIS Server, but when I tried to input the parameters for the service with the load-balanced URL and no port it was rejected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Mar 2019 17:42:46 GMT</pubDate>
    <dc:creator>MichaelVolz</dc:creator>
    <dc:date>2019-03-25T17:42:46Z</dc:date>
    <item>
      <title>Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646090#M24747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Prior to 10.6.1, I was using the &lt;A href="http://www.arcgis.com/home/item.html?id=12dde73e0e784e47818162b4d41ee340"&gt;ArcGIS Server Admin Toolkit&lt;/A&gt; to stop and start services in bulk. That toolkit has depreciated and does not appear to work in 10.6.1. (It could be that I'm making an error with the parameters, but I don't think I am) Then I found this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://enterprise.arcgis.com/en/server/10.6/administer/windows/example-stop-or-start-all-services-in-a-folder.htm" title="http://enterprise.arcgis.com/en/server/10.6/administer/windows/example-stop-or-start-all-services-in-a-folder.htm"&gt;Example: Stop or start all services in a folder—ArcGIS Server Administration (Windows) | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above script assumes that you are using port 6080, but ours are on 6443. I tried to change the parameter in the same script from 6080 to 6443, but that did not work. Again, I'm not ruling out the possibility that I'm entering the wrong variables, but the error message says that the server is forcibly closing the connection to&amp;nbsp;port 6443 when I run it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In scouring the forums, I've seen comments that suggest that A) you cannot start/stop services using Python if said services are secured (https), and B) the Esri is intentionally not maintaining or developing tools to allow you to batch start/stop services anymore because they want you to do it through Server Manager/Portal/ArcCatalog. I know you can't start/stop services in Pro yet, but that it might be coming in a future version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me fill in the gaps? &lt;STRONG&gt;My ultimate need is to be able to stop all web services at once and then restart them in bulk.&lt;/STRONG&gt; I'm using Enterprise 10.6.1, including Portal. I published all of my services to Server using ArcMap 10.6.1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 19:42:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646090#M24747</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2019-03-21T19:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646091#M24748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Were you able to stop secured services in an earlier version of AGS?&amp;nbsp; I have never gotten the port 6443 and https services to stop without a python error.&amp;nbsp; Did you ever try to modify AGS security to generate tokens as per below link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://enterprise.arcgis.com/en/server/latest/administer/windows/enable-token-acquisition-through-an-http-get-request.htm" title="http://enterprise.arcgis.com/en/server/latest/administer/windows/enable-token-acquisition-through-an-http-get-request.htm"&gt;Enable token acquisition through an HTTP GET request—ArcGIS Server Administration (Windows) | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was testing setting up my AGS environment only to accept https protocol, but then I was no longer able to use the script you allude to to stop/start the AGS https services.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 19:54:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646091#M24748</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-03-21T19:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646092#M24749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the first time that I've had secured services, so I don't have any prior successes to look back on. (*sad trombone*)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After reviewing my workflows that used bulk stops and starts, I guess I don't &lt;EM&gt;have&lt;/EM&gt; to shut down my web services. I can just tell the database to stop accepting connections and kick out anyone who is currently connected. (This happens in the middle of the night via automated task, so that the end user impact is minimal.) The only use I'll really miss is the automated task that restarted all of my web services at 6 am, just to give us a fresh start if something crashed overnight and didn't restart properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 20:05:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646092#M24749</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2019-03-21T20:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646093#M24750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have any geocode services?&amp;nbsp; In order to update the associated address locator you would still need to stop/start the service.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 21:28:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646093#M24750</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-03-21T21:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646094#M24751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good point. I do have one locator so that people can search by intersection. Esri probably wants us to move entirely to string searches within layers, but unless I generate an intersection point layer, I still need that geocoder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 21:47:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646094#M24751</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2019-03-21T21:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646095#M24752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe the security changes in ArcGIS Server 10.7 (only TLS 1.2 compatibility) will require that all AGS services will be administered with https protocol.&amp;nbsp; You might get away with http and port 6080 at 10.6.1, but you will need https syntax to work in 10.7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope someone (most preferably from ESRI) can provide guidance on the configuration needed to get https protocol to work with the link you provided above:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;A class="" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fenterprise.arcgis.com%2Fen%2Fserver%2F10.6%2Fadminister%2Fwindows%2Fexample-stop-or-start-all-services-in-a-folder.htm" rel="nofollow" style="color: #287433; border: 0px; font-weight: inherit; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;Example: Stop or start all services in a folder—ArcGIS Server Administration (Windows) | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2019 15:41:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646095#M24752</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-03-25T15:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646096#M24753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Programmatically interacting with any administrative API is and will continue to be an integral part of the software. HTTPS doesn't necessarily mean they're secured, at least in the same sense that you'd say you need a token to reach them. It simply means that the traffic to reach them is encrypted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to reach an HTTPS endpoint via Python, the certificate used for the endpoint needs to be trusted by Python or an untrusted certificate needs to be ignored. This isn't specific to Esri, ArcGIS Server, arcpy, etc. Server, even at 10.7, can be HTTPS and HTTP, but by default on a new site, it is HTTPS. Ideally, the certificate is already trusted by Python, or with a bit of work, you can configure Python to trust your own certificates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/39356413/how-to-add-a-custom-ca-root-certificate-to-the-ca-store-used-by-pip-in-windows" rel="nofollow noopener noreferrer" target="_blank"&gt;https://stackoverflow.com/questions/39356413/how-to-add-a-custom-ca-root-certificate-to-the-ca-store-used-by-pip-in-windows&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following script uses urllib and urllib2 instead of the httplib library to make web requests and disables certificate validation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;ssl

baseURL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'https://server.domain.com:6443/arcgis'&lt;/SPAN&gt;
username &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'admin'&lt;/SPAN&gt;
password &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'admin'&lt;/SPAN&gt;
whatToDo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"start"&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;openURL&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;url&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;params&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; protocol&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; params&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            params&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dict&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"json"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; dict&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"json"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; protocol&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            encoded_params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;encode&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlencode&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            encoded_params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; encoded_params&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;decode&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"utf-8"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            url &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{0}?{1}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;url&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; encoded_params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            request &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Request&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;url&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="comment token"&gt;#Ignore certificate validation&lt;/SPAN&gt;
            sslContext &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ssl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_create_unverified_context&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            request&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;add_header&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'referer'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;baseURL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            response &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlopen&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;request&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; context&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;sslContext&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            encoded_params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;encode&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlencode&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            request &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Request&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;url&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="comment token"&gt;#Ignore certificate validation&lt;/SPAN&gt;
            sslContext &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ssl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_create_unverified_context&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            request&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;add_header&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'referer'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;baseURL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            response &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlopen&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;request&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;encoded_params&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;context&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;sslContext&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        decodedResponse &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; response&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;read&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;decode&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'utf-8'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        jsonResponse &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;loads&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;decodedResponse&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; jsonResponse
    &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;HTTPError &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; e
    &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;URLError &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; e
    &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; Exception &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;createToken&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;baseURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;username&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;password&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    tokenURL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{}/tokens/generateToken"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;baseURL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"username"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;username&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
              &lt;SPAN class="string token"&gt;"password"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;password&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
              &lt;SPAN class="string token"&gt;"client"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'referer'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
              &lt;SPAN class="string token"&gt;"referer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;baseURL&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
    token &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; openURL&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tokenURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'token'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; token

&lt;SPAN class="string token"&gt;'''Function to stop or start services'''&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;startStopService&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;serviceURL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    serviceName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlparse&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlparse&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;serviceURL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"/"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    resp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; openURL&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{}/{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;serviceURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;whatToDo&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"status"&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; resp &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; resp&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'status'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'success'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Successfully {} {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;msg&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;serviceName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Unable to {} {}.\n {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;whatToDo&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;serviceName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;resp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;    

token &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; createToken&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;baseURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;username&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;password&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"token"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;token&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
servicesURL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'{}/admin/services'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;baseURL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
root &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; openURL&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;servicesURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; whatToDo &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"stop"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    msg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"stopped"&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    msg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"started"&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; service &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; root&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'services'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    serviceURL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'{}/{}.{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;servicesURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;service&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'serviceName'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;service&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'type'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    startStopService&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;serviceURL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; folder &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; root&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'folders'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; folder &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'System'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Utilities'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        folderURL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{}/{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;servicesURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;folder&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        folderServices &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; openURL&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;folderURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; service &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; folderServices&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'services'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            serviceURL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'{}/{}/{}.{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;servicesURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;folder&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;service&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'serviceName'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;service&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'type'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            startStopService&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;serviceURL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-How-to-disable-SSL-certificate-verification/td-p/113697" rel="nofollow noopener noreferrer" target="_blank"&gt;https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-How-to-disable-SSL-certificate-verification/td-p/113697&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do this with the requests module as well:&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/15445981/how-do-i-disable-the-security-certificate-check-in-python-requests" rel="nofollow noopener noreferrer" target="_blank"&gt;https://stackoverflow.com/questions/15445981/how-do-i-disable-the-security-certificate-check-in-python-requests&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll reiterate that the preferred solution isn't disabling certificate validation, though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:25:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646096#M24753</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2021-12-12T03:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646097#M24754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the python code.&amp;nbsp; Can you tell me which lines of code I would need to modify so that the code does not ignore certificate validation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does ArcGIS Server need to be configured based on the following link to properly handle tokens for the code you provided:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://enterprise.arcgis.com/en/server/latest/administer/windows/enable-token-acquisition-through-an-http-get-request.htm" title="http://enterprise.arcgis.com/en/server/latest/administer/windows/enable-token-acquisition-through-an-http-get-request.htm"&gt;Enable token acquisition through an HTTP GET request—ArcGIS Server Administration (Windows) | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example provided in the original post and even in the code that you provided, is there a way to call the service without providing a port?&amp;nbsp; My org has a trusted certificate setup on our load balancer that is separate from the internal load-balancing of ArcGIS Server, but when I tried to input the parameters for the service with the load-balanced URL and no port it was rejected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2019 17:42:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646097#M24754</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-03-25T17:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646098#M24755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The baseURL variable on line 3 is where you define the host and optionally port and context to the Server you want to connect to. It doesn't matter if you go through 443, 80, 6443 or 6080 as long as you can reach the Admin API via that URL. For example, you could use your web adaptor URL, &lt;A href="https://webadaptor.domain.com/server" rel="nofollow noopener noreferrer" target="_blank"&gt;https://webadaptor.domain.com/server&lt;/A&gt;. You need to make sure that the machine you're running the script on has access to the URL you want to use to connect to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To validate certificates, get rid of lines 20 and 27 and update line 22 to be&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;response &lt;SPAN class=""&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class=""&gt;.&lt;/SPAN&gt;urlopen&lt;SPAN class=""&gt;(&lt;/SPAN&gt;request&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and 29 to be:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;response &lt;SPAN class=""&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class=""&gt;.&lt;/SPAN&gt;urlopen&lt;SPAN class=""&gt;(&lt;/SPAN&gt;request&lt;SPAN class=""&gt;,&lt;/SPAN&gt;encoded_params&lt;SPAN class=""&gt;)

You're basically just getting rid of the logic to define the SSL context as "unverified".
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:25:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646098#M24755</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2021-12-12T03:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646099#M24756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working w/ Mike to revise and test our code, and I've gotten the above to work when&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;bypassing&lt;/STRONG&gt;&lt;/EM&gt; the certificate verification. However, when I comment out and alter the code as you've indicated above, I receive the following Python error (ignore line numbers, as they differ from your raw script above):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; File "Stop_GeocodeService_Cert.py", line 148, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; token = createToken(baseURL,username,password)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; File "Stop_GeocodeService_Cert.py", line 118, in createToken&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; token = openURL(tokenURL,params)['token']&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;TypeError: sequence index must be integer, not 'str'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For whatever reason, it appears to no longer like the ['token'] parameter... Any ideas why this might be?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gavin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2019 19:24:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646099#M24756</guid>
      <dc:creator>GavinMcDade</dc:creator>
      <dc:date>2019-03-29T19:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646100#M24757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hm, openURL isn't return JSON or a dictionary, but a string or array of some sort. It's probably not a good idea for the token request to assume the response will have the token in it, so in my original example, line 46 should be something like:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;resp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; openURL&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tokenURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"token"&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; resp&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; resp&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'token'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;raise&lt;/SPAN&gt; Exception&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Can't get token: {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;resp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;If you check whether the response as the token property in it, then you can get the token from the response. Otherwise, the script needs to let you know there was an issue with the token request.&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:25:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646100#M24757</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2021-12-12T03:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646101#M24758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, thanks - I'll give this a try. One question, though: I'm assuming that the &lt;SPAN style="font-family: 'courier new', courier, monospace; color: #808080;"&gt;return resp['token']&lt;/SPAN&gt; line will simply pass the value just the same as the original &lt;SPAN style="color: #808080;"&gt;return token&lt;/SPAN&gt;&amp;nbsp;(even though it's setting/using a different variable name)? In other words, the &lt;SPAN style="color: #808080;"&gt;token = createToken(baseURL,username,password)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;line simply receives the returned value from the function regardless of what it's called?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gavin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2019 14:50:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646101#M24758</guid>
      <dc:creator>GavinMcDade</dc:creator>
      <dc:date>2019-04-01T14:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646102#M24759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, they're functionally the same. You're getting a dictionary back, ({"token":XXXXX","expires":"YYYY"}), so you just need to extract the "token" variable, however you want to do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2019 15:42:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646102#M24759</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2019-04-02T15:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646103#M24760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking into this I have the same problem as &lt;A href="https://community.esri.com/migrated-users/109847"&gt;Amy Roust&lt;/A&gt;‌ has.&amp;nbsp; I&amp;nbsp;am looking&amp;nbsp;to bulk stop my services to free up my webmap SDE, or I can just stop the AGS windows service or as Amy mentions kick people out of the SDE, but I'd like the ability to shut down a folder's worth of services or all services in AGS via python as I feel it's the more elegant way to do it (could be wrong!).&amp;nbsp; We have a federated server/portal and are running on https for the whole setup.&amp;nbsp; Trying a http URL for the generateToken request site manually results in a TLS error message, whereas trying with https gets me there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After discussion with my network/server IT admin he is not keen to disable certificate verification and we both agree the solution should not involve that.&amp;nbsp; I see above that you have mentioned configuring to get python to trust your certificates&amp;nbsp;and am not presently sure if I need to, i.e. if python trusts our certificate(s).&amp;nbsp; It looks pretty involved as SSL always does.&amp;nbsp; Is it possible to post example start/stop code &lt;EM&gt;with&lt;/EM&gt; certificate verification? It looks like &lt;A href="https://community.esri.com/migrated-users/8066"&gt;Michael Volz&lt;/A&gt;‌ was working on that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My services are all published via ArcGIS Pro 2.3 at present, but we are still running on python 2.7 and have not yet ported to python 3.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2019 04:33:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646103#M24760</guid>
      <dc:creator>KDCGIS</dc:creator>
      <dc:date>2019-07-02T04:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646104#M24761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do not need to disable certificate verification as you can comment out the line of code that ignores the certificate and it will run if you have a legit certificate in place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just comment out line 27&lt;/P&gt;&lt;P&gt;sslContext = ssl._create_unverified_context()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code was reformatted at my org for more granular stopping and starting of individual services (mostly geocode services that need to be stopped to rebuild address locators), but I think the original code provided by Jonathan Quinn should allow you to stop all services.&amp;nbsp; I also do not have a&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;federated server/portal&lt;SPAN&gt;&amp;nbsp;so I'm not sure if that would impact whether the above code from Jonathan would work.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2019 15:20:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646104#M24761</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-07-02T15:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646105#M24762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you're working with certificates and Python, I think there are three options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Use a certificate from a trusted root certificate authority, (Digicert, Verisign, etc), that Python trusts by default&lt;/P&gt;&lt;P&gt;2) Configure Python to trust your certificates&lt;/P&gt;&lt;P&gt;3) Disable certificate verification&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to disable certificate verification, then you need to make sure you're following either 1 or 2, and then as &lt;A href="https://community.esri.com/migrated-users/8066"&gt;Michael Volz&lt;/A&gt;‌ suggested, comment line 20 and 27 but also be sure to remove &lt;EM&gt;context=sslContext &lt;/EM&gt;from lines 22 and 29.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2019 16:31:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646105#M24762</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2019-07-02T16:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646106#M24763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks guys, I pretty much arrived at the conclusion after reading all of this that #1 or #2 from your list Jonathan are the ways to go.&amp;nbsp; #3 you have already mentioned is risky.&amp;nbsp; So it seems configuring the certificate side of it is necessary, it adds a chunk of work to the scripting process but should just be a one-time job.&amp;nbsp; I'll look into #1 or #2 with my IT admin.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2019 23:30:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646106#M24763</guid>
      <dc:creator>KDCGIS</dc:creator>
      <dc:date>2019-07-02T23:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646107#M24764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would this script need some major changes when run with python 3.x that is bundled with Pro as opposed to the current script that is run with python 2.7 that is bundled with ArcMap?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears that modules have been renamed and after renaming the modules, it seems like functions from the renamed modules have also been renamed but the documentation I have found on the renamed modules has not specified the function names that can be called.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2020 19:55:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646107#M24764</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2020-05-18T19:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646108#M24765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the urllib libraries have changed between versions. You can write your script to support both:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;version_info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;major &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;request&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;error&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;parse
    urlEncode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;parse&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlencode
    urlParse &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;parse&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlparse
    urlRequest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;request&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Request
    urlOpen &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;request&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlopen
    httpError &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;error&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;HTTPError
    urlError &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;error&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;URLError
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; shlex&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; urlparse
    urlEncode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlencode
    urlRequest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Request
    urlOpen &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlopen
    httpError &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;HTTPError
    urlError &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;URLError
    urlParse &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urlparse&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlparse‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, replace all occurrences of each function with the respective variables. You'd then be able to use the script with Python 3.x or 2.x.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:25:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646108#M24765</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2021-12-12T03:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Start/Stop Secure Services in 10.6.1</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646109#M24766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice to know. I just rewrote my own stop/start scripts&amp;nbsp;from Python 2 to Python 3 and then bumped into this thread &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2020 09:08:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/m-p/646109#M24766</guid>
      <dc:creator>jorisfrenkel</dc:creator>
      <dc:date>2020-06-30T09:08:42Z</dc:date>
    </item>
  </channel>
</rss>

