<?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: python with ISE in Network Access Control</title>
    <link>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398324#M567151</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1192302"&gt;@Richie20&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;can not ping ISE as well .&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is clearly a networking (Layer 3) issue and not HTTP/S,&amp;nbsp;ERS, or Python.&lt;/P&gt;
&lt;P&gt;Please resolve your network issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1192302"&gt;@Richie20&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Can I use this guest user creation format&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes. Please see &lt;A href="https://community.cisco.com/t5/security-documents/ise-ers-api-examples/ta-p/3622623" target="_self"&gt;&lt;STRONG&gt;ISE ERS API Examples&lt;/STRONG&gt;&lt;/A&gt; and &lt;STRONG&gt;&lt;A href="https://community.cisco.com/docs/DOC-71891" target="_self"&gt;Guest &amp;amp; Sponsor API&lt;/A&gt;&lt;/STRONG&gt; for the &lt;FONT face="courier new,courier"&gt;guestuser&lt;/FONT&gt; resource. I specifically talk about &lt;FONT face="courier new,courier"&gt;guestuser&lt;/FONT&gt; in our &lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk" target="_self"&gt;&lt;STRONG&gt;ISE REST API Webinar&lt;/STRONG&gt;&lt;/A&gt; :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk&amp;amp;t=1254s" target="_blank"&gt;20:54&lt;/A&gt; How to Enable ISE ERS (Extensible RESTful Services)&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk&amp;amp;t=1286s" target="_blank"&gt;21:26&lt;/A&gt; Admin Groups for REST Role-based Access Control (RBAC)&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk&amp;amp;t=1335s" target="_blank"&gt;22:15&lt;/A&gt; &lt;CODE&gt;guestuser&lt;/CODE&gt; must be managed by a sponsor&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2021 16:53:14 GMT</pubDate>
    <dc:creator>thomas</dc:creator>
    <dc:date>2021-05-05T16:53:14Z</dc:date>
    <item>
      <title>python with ISE</title>
      <link>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398111#M567138</link>
      <description>&lt;P&gt;Hi Everyone&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got this error&amp;nbsp; while run this program&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 158, in _new_conn&lt;BR /&gt;conn = connection.create_connection(&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\connection.py", line 80, in create_connection&lt;BR /&gt;raise err&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\connection.py", line 70, in create_connection&lt;BR /&gt;sock.connect(sa)&lt;BR /&gt;TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 597, in urlopen&lt;BR /&gt;httplib_response = self._make_request(conn, method, url,&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request&lt;BR /&gt;self._validate_conn(conn)&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 839, in _validate_conn&lt;BR /&gt;conn.connect()&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 301, in connect&lt;BR /&gt;conn = self._new_conn()&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 167, in _new_conn&lt;BR /&gt;raise NewConnectionError(&lt;BR /&gt;urllib3.exceptions.NewConnectionError: &amp;lt;urllib3.connection.VerifiedHTTPSConnection object at 0x0000025AB6837FD0&amp;gt;: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 439, in send&lt;BR /&gt;resp = conn.urlopen(&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 637, in urlopen&lt;BR /&gt;retries = retries.increment(method, url, error=e, _pool=self,&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\retry.py", line 399, in increment&lt;BR /&gt;raise MaxRetryError(_pool, url, error or ResponseError(cause))&lt;BR /&gt;urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='192.168.1.13', port=9060): Max retries exceeded with url: /ers/config/identitygroup?filter=name.EQ.Employee (Caused by NewConnectionError('&amp;lt;urllib3.connection.VerifiedHTTPSConnection object at 0x0000025AB6837FD0&amp;gt;: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\Scripts\path\to\ise\testing - Copy.py", line 14, in &amp;lt;module&amp;gt;&lt;BR /&gt;ise.get_identity_group(group='Employee')['response']&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\Scripts\path\to\ise\ise.py", line 1085, in get_identity_group&lt;BR /&gt;resp = self.ise.get(&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 555, in get&lt;BR /&gt;return self.request('GET', url, **kwargs)&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 542, in request&lt;BR /&gt;resp = self.send(prep, **send_kwargs)&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 655, in send&lt;BR /&gt;r = adapter.send(request, **kwargs)&lt;BR /&gt;File "C:\Users\ghibuser\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 516, in send&lt;BR /&gt;raise ConnectionError(e, request=request)&lt;BR /&gt;requests.exceptions.ConnectionError: HTTPSConnectionPool(host='192.168.1.13', port=9060): Max retries exceeded with url: /ers/config/identitygroup?filter=name.EQ.Employee (Caused by NewConnectionError('&amp;lt;urllib3.connection.VerifiedHTTPSConnection object at 0x0000025AB6837FD0&amp;gt;: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the code&amp;nbsp;&lt;/P&gt;&lt;P&gt;# This file will be fixed with pytest or unittest.&lt;BR /&gt;# But untill then this will work as a crude non-automagic testbed. // Falk&lt;/P&gt;&lt;P&gt;import sys&lt;BR /&gt;import urllib3&lt;BR /&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;BR /&gt;sys.path.append('/path/to/ise/')&lt;/P&gt;&lt;P&gt;from ise import ERS&lt;BR /&gt;from pprint import pprint&lt;BR /&gt;from config import uri, endpoint, endpoint_group, user, identity_group, device, device_group, trustsec # noqa E402&lt;/P&gt;&lt;P&gt;ise = ERS(ise_node=['192.168.1.13'], ers_user=['ers-admin'], ers_pass=['oFlPRrne4'], verify=False,&lt;BR /&gt;disable_warnings=True, timeout=15, use_csrf=uri['use_csrf'])&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def test_groups():&lt;BR /&gt;groups = ise.get_endpoint_groups()['response']&lt;BR /&gt;pprint(groups)&lt;/P&gt;&lt;P&gt;group = ise.get_endpoint_group('Juniper-Device')['response']&lt;BR /&gt;pprint(group)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_endpoint(endpoint):&lt;BR /&gt;test = ise.add_endpoint(endpoint['name'], endpoint['mac'], endpoint['group-id']) # noqa: E501&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_endpoint » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_endpoints():&lt;BR /&gt;test = ise.get_endpoints(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_endpoints » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_endpoint(endpoint):&lt;BR /&gt;test = ise.get_endpoint(endpoint['mac'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_endpoint » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_endpoint(endpoint):&lt;BR /&gt;test = ise.delete_endpoint(endpoint['mac'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_endpoint » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_endpoint_groups(size):&lt;BR /&gt;test = ise.get_endpoint_groups(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_endpoint_groups » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_endpoint_group(endpoint_group):&lt;BR /&gt;test = ise.get_endpoint_group(endpoint_group['name'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_endpoint_group » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_identity_groups():&lt;BR /&gt;test = ise.get_identity_groups(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_identity_groups » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_identity_group(identity_group):&lt;BR /&gt;test = ise.get_identity_group(identity_group['name'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_identity_group » OK')&lt;/P&gt;&lt;P&gt;identity_group_id = test['response']['id']&lt;/P&gt;&lt;P&gt;return identity_group_id&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_user(user, identity_group_id):&lt;BR /&gt;user = ise.add_user(&lt;BR /&gt;user_id=user['user_id'],&lt;BR /&gt;password=user['password'],&lt;BR /&gt;user_group_oid=identity_group["respone"]["id"],&lt;BR /&gt;enable=user['enable'],&lt;BR /&gt;first_name=user['first_name'],&lt;BR /&gt;last_name=user['last_name']&lt;BR /&gt;)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_user » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_users():&lt;BR /&gt;test = ise.get_users(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_users » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_user(user):&lt;BR /&gt;test = ise.get_user(user['user_id'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_user » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_user(user):&lt;BR /&gt;test = ise.delete_user(user['user_id'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_user » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_device_groups():&lt;BR /&gt;test = ise.get_device_groups(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_device_groups » OK')&lt;BR /&gt;device_group = test['response'][0][1]&lt;/P&gt;&lt;P&gt;return device_group&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_device_group(device_group):&lt;BR /&gt;test = ise.get_device_group(device_group['oid'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_device_group » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_device(device):&lt;BR /&gt;test = ise.add_device(&lt;BR /&gt;name=device['name'],&lt;BR /&gt;ip_address=device['ip_address'],&lt;BR /&gt;radius_key=device['radius_key'],&lt;BR /&gt;snmp_ro=device['snmp_ro'],&lt;BR /&gt;dev_group=device['dev_group'],&lt;BR /&gt;dev_location=device['dev_location'],&lt;BR /&gt;dev_type=device['dev_type'],&lt;BR /&gt;description=device['description'],&lt;BR /&gt;snmp_v=device['snmp_v'],&lt;BR /&gt;dev_profile=device['dev_profile']&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_device » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_devices():&lt;BR /&gt;test_get = ise.get_devices(size=100, page=1)&lt;BR /&gt;if test_get['error']:&lt;BR /&gt;print(test_get['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_devices » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_device(device):&lt;BR /&gt;test = ise.get_device(device['name'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_device » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_device(device):&lt;BR /&gt;test = ise.delete_device(device['name'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_device » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_sgts():&lt;BR /&gt;test_get = ise.get_sgts(size=100, page=1)&lt;BR /&gt;if test_get['error']:&lt;BR /&gt;print(test_get['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_sgts » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_sgt(name):&lt;BR /&gt;test = ise.get_sgt(name)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_sgt » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_sgt(trustsec):&lt;BR /&gt;test = ise.add_sgt(name="Python_Unit_Test", description="Unit Tests", value=trustsec["test_sgt_value"],&lt;BR /&gt;return_object=True)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_sgt » OK')&lt;BR /&gt;return test['response']['id']&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def update_sgt(id, trustsec):&lt;BR /&gt;test = ise.update_sgt(id, name="Test_Unit_Python", description="Python Unit Tests",&lt;BR /&gt;value=trustsec["test_sgt_value"])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('update_sgt » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_sgt(id):&lt;BR /&gt;test = ise.delete_sgt(id)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_sgt » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_sgacls():&lt;BR /&gt;test_get = ise.get_sgacls(size=100, page=1)&lt;BR /&gt;if test_get['error']:&lt;BR /&gt;print(test_get['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_sgacls » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_sgacl(name):&lt;BR /&gt;test = ise.get_sgacl(name)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_sgacl » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_sgacl(trustsec):&lt;BR /&gt;test = ise.add_sgacl(name="Python_Unit_Test", description="Unit Tests", ip_version="IPV4",&lt;BR /&gt;acl_content=["permit ip"], return_object=True)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_sgacl » OK')&lt;BR /&gt;return test['response']['id']&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def update_sgacl(id, trustsec):&lt;BR /&gt;test = ise.update_sgacl(id, name="Test_Unit_Python", description="Python Unit Tests", ip_version="IPV4",&lt;BR /&gt;acl_content=["permit ip"])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('update_sgacl » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_sgacl(id):&lt;BR /&gt;test = ise.delete_sgacl(id)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_sgacl » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_emcs():&lt;BR /&gt;test_get = ise.get_egressmatrixcells(size=100, page=1)&lt;BR /&gt;if test_get['error']:&lt;BR /&gt;print(test_get['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_egressmatrixcells » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_emc(name):&lt;BR /&gt;test = ise.get_egressmatrixcell(name)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_egressmatrixcell » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_emc(trustsec):&lt;BR /&gt;test = ise.add_egressmatrixcell(trustsec["emc_source_sgt"], trustsec["emc_dest_sgt"], "PERMIT_IP",&lt;BR /&gt;return_object=True)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_egressmatrixcell » OK')&lt;BR /&gt;return test['response']['id']&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def update_emc(id, trustsec):&lt;BR /&gt;test = ise.update_egressmatrixcell(id, trustsec["emc_source_sgt"], trustsec["emc_dest_sgt"], "NONE",&lt;BR /&gt;description="Python Unit Tests",&lt;BR /&gt;acls=[trustsec["test_assign_acl"]])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('update_egressmatrixcell » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_emc(id):&lt;BR /&gt;test = ise.delete_egressmatrixcell(id)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_egressmatrixcell » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if __name__ == "__main__":&lt;/P&gt;&lt;P&gt;# Endpoint tests&lt;BR /&gt;add_endpoint(endpoint)&lt;BR /&gt;get_endpoints()&lt;BR /&gt;get_endpoint(endpoint)&lt;BR /&gt;delete_endpoint(endpoint)&lt;/P&gt;&lt;P&gt;# EndpointGroup tests&lt;BR /&gt;get_endpoint_groups(21)&lt;BR /&gt;get_endpoint_group(endpoint_group)&lt;/P&gt;&lt;P&gt;# User tests&lt;BR /&gt;get_identity_groups()&lt;BR /&gt;identity_group_id = ise.get_identity_group(group=identityGroups)&lt;BR /&gt;add_user(user, identity_group_id)&lt;BR /&gt;get_users()&lt;BR /&gt;get_user(user)&lt;BR /&gt;delete_user(user)&lt;/P&gt;&lt;P&gt;# Device tests&lt;BR /&gt;get_device_groups()&lt;BR /&gt;get_device_group(device_group)&lt;BR /&gt;add_device(device)&lt;BR /&gt;get_devices()&lt;BR /&gt;get_device(device)&lt;BR /&gt;delete_device(device)&lt;BR /&gt;# get_object() # TODO&lt;/P&gt;&lt;P&gt;# TrustSec SGT tests&lt;BR /&gt;get_sgts()&lt;BR /&gt;get_sgt("Unknown")&lt;BR /&gt;sgtid = add_sgt(trustsec)&lt;BR /&gt;update_sgt(sgtid, trustsec)&lt;BR /&gt;delete_sgt(sgtid)&lt;/P&gt;&lt;P&gt;# TrustSec SGACL tests&lt;BR /&gt;get_sgacls()&lt;BR /&gt;get_sgacl("Permit IP")&lt;BR /&gt;sgaclid = add_sgacl(trustsec)&lt;BR /&gt;update_sgacl(sgaclid, trustsec)&lt;BR /&gt;delete_sgacl(sgaclid)&lt;/P&gt;&lt;P&gt;# TrustSec Egress Matrix Cell (Policy) tests&lt;BR /&gt;get_emcs()&lt;BR /&gt;get_emc("Default egress rule")&lt;BR /&gt;emcid = add_emc(trustsec)&lt;BR /&gt;update_emc(emcid, trustsec)&lt;BR /&gt;delete_emc(emcid)&lt;/P&gt;&lt;P&gt;# This file will be fixed with pytest or unittest.&lt;BR /&gt;# But untill then this will work as a crude non-automagic testbed. // Falk&lt;/P&gt;&lt;P&gt;import sys&lt;BR /&gt;import urllib3&lt;BR /&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;BR /&gt;sys.path.append('/path/to/ise/')&lt;/P&gt;&lt;P&gt;from ise import ERS&lt;BR /&gt;from pprint import pprint&lt;BR /&gt;from config import uri, endpoint, endpoint_group, user, identity_group, device, device_group, trustsec # noqa E402&lt;/P&gt;&lt;P&gt;ise = ERS(ise_node=['192.168.1.13'], ers_user=['ers-admin'], ers_pass=['oFlPRrne4'], verify=False,&lt;BR /&gt;disable_warnings=True, timeout=15, use_csrf=uri['use_csrf'])&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def test_groups():&lt;BR /&gt;groups = ise.get_endpoint_groups()['response']&lt;BR /&gt;pprint(groups)&lt;/P&gt;&lt;P&gt;group = ise.get_endpoint_group('Juniper-Device')['response']&lt;BR /&gt;pprint(group)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_endpoint(endpoint):&lt;BR /&gt;test = ise.add_endpoint(endpoint['name'], endpoint['mac'], endpoint['group-id']) # noqa: E501&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_endpoint » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_endpoints():&lt;BR /&gt;test = ise.get_endpoints(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_endpoints » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_endpoint(endpoint):&lt;BR /&gt;test = ise.get_endpoint(endpoint['mac'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_endpoint » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_endpoint(endpoint):&lt;BR /&gt;test = ise.delete_endpoint(endpoint['mac'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_endpoint » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_endpoint_groups(size):&lt;BR /&gt;test = ise.get_endpoint_groups(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_endpoint_groups » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_endpoint_group(endpoint_group):&lt;BR /&gt;test = ise.get_endpoint_group(endpoint_group['name'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_endpoint_group » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_identity_groups():&lt;BR /&gt;test = ise.get_identity_groups(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_identity_groups » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_identity_group(identity_group):&lt;BR /&gt;test = ise.get_identity_group(identity_group['name'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_identity_group » OK')&lt;/P&gt;&lt;P&gt;identity_group_id = test['response']['id']&lt;/P&gt;&lt;P&gt;return identity_group_id&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_user(user, identity_group_id):&lt;BR /&gt;user = ise.add_user(&lt;BR /&gt;user_id=user['user_id'],&lt;BR /&gt;password=user['password'],&lt;BR /&gt;user_group_oid=identity_group["respone"]["id"],&lt;BR /&gt;enable=user['enable'],&lt;BR /&gt;first_name=user['first_name'],&lt;BR /&gt;last_name=user['last_name']&lt;BR /&gt;)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_user » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_users():&lt;BR /&gt;test = ise.get_users(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_users » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_user(user):&lt;BR /&gt;test = ise.get_user(user['user_id'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_user » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_user(user):&lt;BR /&gt;test = ise.delete_user(user['user_id'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_user » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_device_groups():&lt;BR /&gt;test = ise.get_device_groups(size=100, page=1)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_device_groups » OK')&lt;BR /&gt;device_group = test['response'][0][1]&lt;/P&gt;&lt;P&gt;return device_group&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_device_group(device_group):&lt;BR /&gt;test = ise.get_device_group(device_group['oid'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_device_group » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_device(device):&lt;BR /&gt;test = ise.add_device(&lt;BR /&gt;name=device['name'],&lt;BR /&gt;ip_address=device['ip_address'],&lt;BR /&gt;radius_key=device['radius_key'],&lt;BR /&gt;snmp_ro=device['snmp_ro'],&lt;BR /&gt;dev_group=device['dev_group'],&lt;BR /&gt;dev_location=device['dev_location'],&lt;BR /&gt;dev_type=device['dev_type'],&lt;BR /&gt;description=device['description'],&lt;BR /&gt;snmp_v=device['snmp_v'],&lt;BR /&gt;dev_profile=device['dev_profile']&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_device » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_devices():&lt;BR /&gt;test_get = ise.get_devices(size=100, page=1)&lt;BR /&gt;if test_get['error']:&lt;BR /&gt;print(test_get['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_devices » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_device(device):&lt;BR /&gt;test = ise.get_device(device['name'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_device » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_device(device):&lt;BR /&gt;test = ise.delete_device(device['name'])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_device » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_sgts():&lt;BR /&gt;test_get = ise.get_sgts(size=100, page=1)&lt;BR /&gt;if test_get['error']:&lt;BR /&gt;print(test_get['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_sgts » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_sgt(name):&lt;BR /&gt;test = ise.get_sgt(name)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_sgt » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_sgt(trustsec):&lt;BR /&gt;test = ise.add_sgt(name="Python_Unit_Test", description="Unit Tests", value=trustsec["test_sgt_value"],&lt;BR /&gt;return_object=True)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_sgt » OK')&lt;BR /&gt;return test['response']['id']&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def update_sgt(id, trustsec):&lt;BR /&gt;test = ise.update_sgt(id, name="Test_Unit_Python", description="Python Unit Tests",&lt;BR /&gt;value=trustsec["test_sgt_value"])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('update_sgt » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_sgt(id):&lt;BR /&gt;test = ise.delete_sgt(id)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_sgt » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_sgacls():&lt;BR /&gt;test_get = ise.get_sgacls(size=100, page=1)&lt;BR /&gt;if test_get['error']:&lt;BR /&gt;print(test_get['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_sgacls » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_sgacl(name):&lt;BR /&gt;test = ise.get_sgacl(name)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_sgacl » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_sgacl(trustsec):&lt;BR /&gt;test = ise.add_sgacl(name="Python_Unit_Test", description="Unit Tests", ip_version="IPV4",&lt;BR /&gt;acl_content=["permit ip"], return_object=True)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_sgacl » OK')&lt;BR /&gt;return test['response']['id']&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def update_sgacl(id, trustsec):&lt;BR /&gt;test = ise.update_sgacl(id, name="Test_Unit_Python", description="Python Unit Tests", ip_version="IPV4",&lt;BR /&gt;acl_content=["permit ip"])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('update_sgacl » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_sgacl(id):&lt;BR /&gt;test = ise.delete_sgacl(id)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_sgacl » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_emcs():&lt;BR /&gt;test_get = ise.get_egressmatrixcells(size=100, page=1)&lt;BR /&gt;if test_get['error']:&lt;BR /&gt;print(test_get['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_egressmatrixcells » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_emc(name):&lt;BR /&gt;test = ise.get_egressmatrixcell(name)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('get_egressmatrixcell » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def add_emc(trustsec):&lt;BR /&gt;test = ise.add_egressmatrixcell(trustsec["emc_source_sgt"], trustsec["emc_dest_sgt"], "PERMIT_IP",&lt;BR /&gt;return_object=True)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('add_egressmatrixcell » OK')&lt;BR /&gt;return test['response']['id']&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def update_emc(id, trustsec):&lt;BR /&gt;test = ise.update_egressmatrixcell(id, trustsec["emc_source_sgt"], trustsec["emc_dest_sgt"], "NONE",&lt;BR /&gt;description="Python Unit Tests",&lt;BR /&gt;acls=[trustsec["test_assign_acl"]])&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('update_egressmatrixcell » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def delete_emc(id):&lt;BR /&gt;test = ise.delete_egressmatrixcell(id)&lt;BR /&gt;if test['error']:&lt;BR /&gt;print(test['response'])&lt;BR /&gt;else:&lt;BR /&gt;print('delete_egressmatrixcell » OK')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if __name__ == "__main__":&lt;/P&gt;&lt;P&gt;# Endpoint tests&lt;BR /&gt;add_endpoint(endpoint)&lt;BR /&gt;get_endpoints()&lt;BR /&gt;get_endpoint(endpoint)&lt;BR /&gt;delete_endpoint(endpoint)&lt;/P&gt;&lt;P&gt;# EndpointGroup tests&lt;BR /&gt;get_endpoint_groups(21)&lt;BR /&gt;get_endpoint_group(endpoint_group)&lt;/P&gt;&lt;P&gt;# User tests&lt;BR /&gt;get_identity_groups()&lt;BR /&gt;identity_group_id = ise.get_identity_group(group=identityGroups)&lt;BR /&gt;add_user(user, identity_group_id)&lt;BR /&gt;get_users()&lt;BR /&gt;get_user(user)&lt;BR /&gt;delete_user(user)&lt;/P&gt;&lt;P&gt;# Device tests&lt;BR /&gt;get_device_groups()&lt;BR /&gt;get_device_group(device_group)&lt;BR /&gt;add_device(device)&lt;BR /&gt;get_devices()&lt;BR /&gt;get_device(device)&lt;BR /&gt;delete_device(device)&lt;BR /&gt;# get_object() # TODO&lt;/P&gt;&lt;P&gt;# TrustSec SGT tests&lt;BR /&gt;get_sgts()&lt;BR /&gt;get_sgt("Unknown")&lt;BR /&gt;sgtid = add_sgt(trustsec)&lt;BR /&gt;update_sgt(sgtid, trustsec)&lt;BR /&gt;delete_sgt(sgtid)&lt;/P&gt;&lt;P&gt;# TrustSec SGACL tests&lt;BR /&gt;get_sgacls()&lt;BR /&gt;get_sgacl("Permit IP")&lt;BR /&gt;sgaclid = add_sgacl(trustsec)&lt;BR /&gt;update_sgacl(sgaclid, trustsec)&lt;BR /&gt;delete_sgacl(sgaclid)&lt;/P&gt;&lt;P&gt;# TrustSec Egress Matrix Cell (Policy) tests&lt;BR /&gt;get_emcs()&lt;BR /&gt;get_emc("Default egress rule")&lt;BR /&gt;emcid = add_emc(trustsec)&lt;BR /&gt;update_emc(emcid, trustsec)&lt;BR /&gt;delete_emc(emcid)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions are welcomed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 12:17:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398111#M567138</guid>
      <dc:creator>Richie20</dc:creator>
      <dc:date>2021-05-05T12:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: python with ISE</title>
      <link>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398185#M567145</link>
      <description>&lt;P&gt;There's a lot going on here.&lt;/P&gt;
&lt;P&gt;1) you pasted the script twice&lt;/P&gt;
&lt;P&gt;2) it's not properly formatted Python for quick copy and paste to try it&lt;/P&gt;
&lt;P&gt;3) you're using custom include paths (&lt;FONT face="courier new,courier"&gt;sys.path.append('/path/to/ise/')&lt;/FONT&gt;) so cannot replicate your environment&lt;/P&gt;
&lt;P&gt;4) Has a version of this code ever run before? If so, what changed? Go back to that, see what changed and narrow down to that. &lt;/P&gt;
&lt;P&gt;5) dumping 373 lines of unformatted code is not necessary when the problem is clearly a Timeout &lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;TimeoutError&lt;/STRONG&gt;: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;6) What have you done to troubleshoot your Timeout issue? can you ping ISE? does a more basic python script talk to ISE and only this one fails?&lt;/P&gt;
&lt;P&gt;7) You dumped 2 versions of this script - one with the CSRF option and one without. Which is it? Have you used CSRF before? Did it work? have you enabled it in ISE? or was it in a script you copied from somewhere?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 13:57:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398185#M567145</guid>
      <dc:creator>thomas</dc:creator>
      <dc:date>2021-05-05T13:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: python with ISE</title>
      <link>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398195#M567146</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/26555"&gt;@thomas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to work with this python&amp;nbsp; program for ISE&amp;nbsp;&lt;A href="https://pypi.org/project/ISE/" target="_blank"&gt;https://pypi.org/project/ISE/&lt;/A&gt;&amp;nbsp;as i found . my ERS is enabled on ISE&amp;nbsp; and&amp;nbsp; can not ping ISE as well .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I use this&amp;nbsp; &amp;nbsp;guest user&amp;nbsp; creation format&amp;nbsp;&lt;A href="https://developer.cisco.com/docs/identity-services-engine/3.0/#!create-guest-user" target="_blank"&gt;https://developer.cisco.com/docs/identity-services-engine/3.0/#!create-guest-user&lt;/A&gt;&amp;nbsp;for creating internal user on ISE as well&amp;nbsp;&amp;nbsp;&lt;A href="https://developer.cisco.com/docs/identity-services-engine/3.0/#!internal-user/create" target="_blank"&gt;https://developer.cisco.com/docs/identity-services-engine/3.0/#!internal-user/create&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 14:12:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398195#M567146</guid>
      <dc:creator>Richie20</dc:creator>
      <dc:date>2021-05-05T14:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: python with ISE</title>
      <link>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398324#M567151</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1192302"&gt;@Richie20&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;can not ping ISE as well .&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is clearly a networking (Layer 3) issue and not HTTP/S,&amp;nbsp;ERS, or Python.&lt;/P&gt;
&lt;P&gt;Please resolve your network issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1192302"&gt;@Richie20&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Can I use this guest user creation format&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes. Please see &lt;A href="https://community.cisco.com/t5/security-documents/ise-ers-api-examples/ta-p/3622623" target="_self"&gt;&lt;STRONG&gt;ISE ERS API Examples&lt;/STRONG&gt;&lt;/A&gt; and &lt;STRONG&gt;&lt;A href="https://community.cisco.com/docs/DOC-71891" target="_self"&gt;Guest &amp;amp; Sponsor API&lt;/A&gt;&lt;/STRONG&gt; for the &lt;FONT face="courier new,courier"&gt;guestuser&lt;/FONT&gt; resource. I specifically talk about &lt;FONT face="courier new,courier"&gt;guestuser&lt;/FONT&gt; in our &lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk" target="_self"&gt;&lt;STRONG&gt;ISE REST API Webinar&lt;/STRONG&gt;&lt;/A&gt; :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk&amp;amp;t=1254s" target="_blank"&gt;20:54&lt;/A&gt; How to Enable ISE ERS (Extensible RESTful Services)&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk&amp;amp;t=1286s" target="_blank"&gt;21:26&lt;/A&gt; Admin Groups for REST Role-based Access Control (RBAC)&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk&amp;amp;t=1335s" target="_blank"&gt;22:15&lt;/A&gt; &lt;CODE&gt;guestuser&lt;/CODE&gt; must be managed by a sponsor&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 16:53:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398324#M567151</guid>
      <dc:creator>thomas</dc:creator>
      <dc:date>2021-05-05T16:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: python with ISE</title>
      <link>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398341#M567153</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/26555"&gt;@thomas&lt;/a&gt;&amp;nbsp; i was trying to create Internal users . I want to know if this script is right or have to change it&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/usr/bin/env python&lt;BR /&gt;import requests&lt;BR /&gt;import json&lt;BR /&gt;import argparse&lt;BR /&gt;import ssl&lt;BR /&gt;import urllib3&lt;/P&gt;&lt;P&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;url = "&lt;A href="https://192.168.10.18/ers/config/internaluser" target="_blank"&gt;https://192.168.10.18/ers/config/internaluser&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;#Input Parameter&lt;BR /&gt;parser = argparse.ArgumentParser()&lt;BR /&gt;subparser = parser.add_subparsers(dest='command')&lt;BR /&gt;login = subparser.add_parser('login')&lt;BR /&gt;register = subparser.add_parser('register')&lt;BR /&gt;login.add_argument('--name', type=str, required=True)&lt;BR /&gt;login.add_argument('--password', type=str, required=True)&lt;BR /&gt;register.add_argument('--firstname', type=str, required=True)&lt;BR /&gt;register.add_argument('--lastname', type=str, required=True)&lt;BR /&gt;register.add_argument('--username', type=str, required=True)&lt;BR /&gt;register.add_argument('--email', type=str, required=True)&lt;BR /&gt;register.add_argument('--password', type=str, required=True)&lt;BR /&gt;register.add_argument('--identityGroups', type=str, required=True)&lt;BR /&gt;register.add_argument('--expiryeDate', type=str, required=True)&lt;BR /&gt;register.add_argument('--enablePasword', type=str, required=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;args = parser.parse_args()&lt;BR /&gt;if args.command == 'login':&lt;BR /&gt;print('Logging in with username:', args.username,&lt;BR /&gt;'and password:', args.password)&lt;BR /&gt;elif args.command == 'register':&lt;BR /&gt;print('Creating username', args.username,&lt;BR /&gt;'for new member', args.firstname, args.lastname,&lt;BR /&gt;'with email:', args.email,&lt;BR /&gt;'with identityGroups:', args.identityGroups,&lt;BR /&gt;'with expiryDate:', args.identityGroups,&lt;BR /&gt;'and enablePassowrd:', args.enablePassword,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;req_body_json = """ {{&lt;/P&gt;&lt;P&gt;"InternalUser" : {&lt;/P&gt;&lt;P&gt;"id" : "{}",&lt;/P&gt;&lt;P&gt;"name" : "{}",&lt;/P&gt;&lt;P&gt;"description" : "{}",&lt;/P&gt;&lt;P&gt;"enabled" : true,&lt;/P&gt;&lt;P&gt;"email" : "{}",&lt;/P&gt;&lt;P&gt;"password" : "{}",&lt;/P&gt;&lt;P&gt;"firstName" : "{}",&lt;/P&gt;&lt;P&gt;"lastName" : "{}",&lt;/P&gt;&lt;P&gt;"changePassword" : true,&lt;/P&gt;&lt;P&gt;"identityGroups" : "{}",&lt;/P&gt;&lt;P&gt;"expiryDateEnabled" : false,&lt;/P&gt;&lt;P&gt;"expiryDate" : "{}",&lt;/P&gt;&lt;P&gt;"enablePassword" : "{}",&lt;/P&gt;&lt;P&gt;"customAttributes" : {&lt;/P&gt;&lt;P&gt;"key1" : "value1",&lt;/P&gt;&lt;P&gt;"key2" : "value3"&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;"passwordIDStore" : "Internal Users"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}}&lt;BR /&gt;""".format(name,description,firstname,lastname,identityGroups,expirydate,enablePassword)&lt;BR /&gt;&lt;BR /&gt;headers = {&lt;BR /&gt;'Content-Type': 'application/json',&lt;BR /&gt;'Accept': 'application/json',&lt;BR /&gt;'Authorization': 'Basic cmFjb2xhdHNlOm9GbFBScm5lNDU='&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;conn.request("POST", "/ers/config/guestuser/", headers=headers, body=req_body_json)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;res = conn.getresponse()&lt;BR /&gt;data = res.read()&lt;/P&gt;&lt;P&gt;print("req_body_json")&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 17:23:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/python-with-ise/m-p/4398341#M567153</guid>
      <dc:creator>Richie20</dc:creator>
      <dc:date>2021-05-05T17:23:55Z</dc:date>
    </item>
  </channel>
</rss>

