<?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: Cisco ISE with python in Network Access Control</title>
    <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395726#M566998</link>
    <description>&lt;P&gt;Can I use curl on windows 10&amp;nbsp; pc ?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Apr 2021 21:46:58 GMT</pubDate>
    <dc:creator>RichardAcolatse8417</dc:creator>
    <dc:date>2021-04-29T21:46:58Z</dc:date>
    <item>
      <title>Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395241#M566955</link>
      <description>&lt;P&gt;I got an error while try to run the python script in the attachment&amp;nbsp; . Can anyone help me solve this&amp;nbsp; error in the attachment&amp;nbsp; ?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 07:01:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395241#M566955</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-04-29T07:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395249#M566956</link>
      <description>&lt;P&gt;Mostly the connection issue, since we are not sure what is that lines of errors so hard to say, can you attached python script&lt;/P&gt;
&lt;P&gt;also give us what ISE version, did you enable REST API ? what are you trying to achieve with these scripts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 07:11:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395249#M566956</guid>
      <dc:creator>balaji.bandi</dc:creator>
      <dc:date>2021-04-29T07:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395261#M566958</link>
      <description>&lt;P&gt;this is the ISE&amp;nbsp; version I am using&amp;nbsp;&lt;SPAN&gt;2.7.0.356 . Yes I did enable REST API&amp;nbsp; and this python scripts which am&amp;nbsp; i am using .for ISE&amp;nbsp; I want to also know how you implement&amp;nbsp;it from a windows 10&amp;nbsp; computer&amp;nbsp; . I am trying to create Internal users with the python scripts&amp;nbsp; as well . I want to how to connect python scripts&amp;nbsp; to Cisco ISE through VPN as well .&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 10:45:13 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395261#M566958</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-04-29T10:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395402#M566976</link>
      <description>&lt;P&gt;My recommendation is always to start small, then slowly build from there.&amp;nbsp; A tool I always recommend to other engineers to utilize when getting a feel for APIs in general is curl.&amp;nbsp; Curl will let you quickly attempt to consume APIs and has helped me in the past for many reasons.&amp;nbsp; Quick example:&lt;/P&gt;
&lt;P&gt;1: GET endpoint ID by filter on MAC:&lt;/P&gt;
&lt;P&gt;curl -k --include --header 'Content-Type:application/json' --header 'Accept: application/json' --user &amp;lt;user&amp;gt;:&amp;lt;pass&amp;gt; --request GET &lt;A href="https://ise" target="_blank"&gt;https://ise&lt;/A&gt;&amp;nbsp;pan ip:9060/ers/config/endpoint?filter=mac.EQ.54:XX:XX:35:AD&lt;/P&gt;
&lt;P&gt;Additional curl info:&amp;nbsp;&lt;A href="https://www.tutorialspoint.com/unix_commands/curl.htm" target="_blank"&gt;curl - Unix, Linux Command - Tutorialspoint&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Brief overview of ISE Rest API filters:&lt;/P&gt;
&lt;P&gt;--Cisco ISE REST API filters--&lt;BR /&gt;EQ: Equals&lt;BR /&gt;NEQ: Not Equals&lt;BR /&gt;GT: Greater Than&lt;BR /&gt;LT: Less Then&lt;BR /&gt;STARTW: Starts With&lt;BR /&gt;NSTARTSW: Not Starts With&lt;BR /&gt;ENDSW: Ends With&lt;BR /&gt;NENDSW: Not Ends With&lt;BR /&gt;CONTAINS: Contains&lt;BR /&gt;NCONTAINS: Not Contains&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quick python script example I have used in the past to view two different endpoint groups' members (MACs) &amp;amp; print to screen + CSV file.&amp;nbsp; Maybe it will help shed some tshooting light:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#!/usr/bin/python
import json
import requests
import warnings
import sys
import csv

#ignore invalid cert warnings
warnings.filterwarnings("ignore")

groupID = ("")
temp = ("")
temp1 = ("")
temp2 = ("")

USR_CHOICE = raw_input ("Do you want to see MACs in Hard Quarantine (1) or Soft Quarantine group(2)? ")
while USR_CHOICE not in ('1','2'):
    print "************************************"
    print "Error! You must enter 1 (Hard) or 2 (Soft)"
    print "************************************"
    sys.exit()
if USR_CHOICE == '1':
    groupID = '4bfdafa0-XXXXX-123340ab3cd6'
    temp = 'Hard Q'
else:
    groupID = 'aa000c30XXXXXX5400b48521'
    temp = 'Soft Q'

API_DEVICE = "https://ISE_PAN_IP:9060/ers/config/endpoint?filter=groupId.EQ." + groupID + "&amp;amp;size=100"
API_ERS_USER = "USER","PASS"
HEADERS = {
        'Accept': "application/json",
        'Content-Type': "application/json",
}

r = requests.get(url=API_DEVICE, auth=API_ERS_USER, headers=HEADERS, verify=True)

#print r.text
data = r.text

endPoints = json.loads(data)
print "Total Number of Endpoints in " + temp + " Group:",endPoints['SearchResult']['total']
print "---------------------------------------"

f = open ('Grp_Macs.csv','w')
w = csv.DictWriter(f, fieldnames = ['MAC Address','Description'])
w.writeheader()
f.close()

for MAC in endPoints ["SearchResult"]["resources"]:
    temp1 = MAC['name']
    with open ('Grp_Macs.csv','a') as csvfile:
        w = csv.writer(csvfile)
        try:
            temp2 = MAC['description']
            w.writerow([temp1, temp2])
            print "MAC Address:", temp1, "||", "Description:", temp2
        except KeyError:
            w.writerow([temp1, temp2])
            print "MAC Address:", temp1, "||", "Description:"""
            continue
with open ('Grp_Macs.csv','a') as csvfile:
    w = csv.writer(csvfile)
    TOTAL = endPoints['SearchResult']['total']
    w.writerow(['Total Endpoints:', TOTAL])

sys.exit()&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 12:20:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395402#M566976</guid>
      <dc:creator>Mike.Cifelli</dc:creator>
      <dc:date>2021-04-29T12:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395412#M566978</link>
      <description>&lt;P&gt;Thank you for assistance . can i use to create internal users on cisco ISE with python scripts as well on windows 10 OS .&amp;nbsp; how did you access the online ISE SDK on your computer ?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 12:29:27 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395412#M566978</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-04-29T12:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395475#M566984</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;can i use to create internal users on cisco ISE with python scripts as well on windows 10 OS .&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-Yes.&amp;nbsp; I would recommend youtube &amp;amp; take a look at this:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/windows/python/beginners" target="_blank"&gt;Python on Windows 10 for beginners | Microsoft Docs&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;how did you access the online ISE SDK on your computer ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;-Open browser, navigate to: &lt;A href="https://&amp;lt;YOUR" target="_blank"&gt;https://&amp;lt;YOUR&lt;/A&gt;&amp;nbsp;ISE PAN IP ADDRESS&amp;gt;:9060/ers/sdk#&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 13:33:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395475#M566984</guid>
      <dc:creator>Mike.Cifelli</dc:creator>
      <dc:date>2021-04-29T13:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395505#M566989</link>
      <description>&lt;P&gt;Thank you . can I access cisco ISE on VPN from a remote locate with a python scripts ?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 14:15:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395505#M566989</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-04-29T14:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395726#M566998</link>
      <description>&lt;P&gt;Can I use curl on windows 10&amp;nbsp; pc ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 21:46:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4395726#M566998</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-04-29T21:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4396121#M567020</link>
      <description>&lt;P&gt;I typically use a linux host, but try taking a look here:&amp;nbsp;&lt;A href="https://www.addictivetips.com/windows-tips/use-curl-on-windows-10/" target="_blank"&gt;How To Use cURL On Windows 10 (addictivetips.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 13:09:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4396121#M567020</guid>
      <dc:creator>Mike.Cifelli</dc:creator>
      <dc:date>2021-04-30T13:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4396257#M567022</link>
      <description>&lt;P&gt;Thank you for your assistance&amp;nbsp; . I started write this python&amp;nbsp; program for creating internal user on cisco ISE and I&amp;nbsp; find it difficult to execute it&amp;nbsp; . can you help me out with the problem ?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 18:10:24 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4396257#M567022</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-04-30T18:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE with python</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4505561#M571146</link>
      <description>&lt;P&gt;Hi, how are you? I hope you´re well.&lt;/P&gt;&lt;P&gt;Have you got any quick example: how can i export full endpoint database from a script in python, curl or postman? And how can i schedule dialy to make a report. I know there are some options: from gui, export full database, from cli.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 13:12:13 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-with-python/m-p/4505561#M571146</guid>
      <dc:creator>ggmeza1983</dc:creator>
      <dc:date>2021-11-19T13:12:13Z</dc:date>
    </item>
  </channel>
</rss>

