2 Replies Latest reply on Jul 19, 2019 3:54 AM by Ivan Marco Di Bari

    ADDM 11: csv API and Python Script

    Ivan Marco Di Bari
      Share This:


      I have to do a script in Python that saves query api in the CSV file, but in this example :


      import urllib

      def runQuery():

        # Successful output

        query = "http://appliance/ui/api/CsvApi?query=SEARCH%20Host&username=apiuser&password=password"

        f = urllib.urlopen(query)

        print f.read()



      I save output on the screen!


      How can I save the output on CSV file?


      Thanks in advance