<?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 OpenVuln API Python Library with Filtering in Services Discussions</title>
    <link>https://community.cisco.com/t5/services-discussions/openvuln-api-python-library-with-filtering/m-p/3829110#M448</link>
    <description>&lt;P&gt;I'm trying to build a script using the Python Library using the filtering example provided on Github, but I'm getting errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; from openVulnQuery import query_client
&amp;gt;&amp;gt;&amp;gt; client = query_client.OpenVulnQueryClient(id, secret)

&amp;gt;&amp;gt;&amp;gt; advisories = client.get_by_all(adv_format='cvrf', all_adv='all', LastUpdate(2019-03-01, 2019-03-28))
File "&amp;lt;stdin&amp;gt;", line 1
advisories = client.get_by_all(adv_format='cvrf', all_adv='all', LastUpdate(2019-03-01, 2019-03-28))
^
SyntaxError: invalid token

&amp;gt;&amp;gt;&amp;gt; adv = client.get_by_severity(adv_format='cvrf', severity='high', LastUpdate(2019-03-01, 2019-03-28))
File "&amp;lt;stdin&amp;gt;", line 1
adv = client.get_by_severity(adv_format='cvrf', severity='high', LastUpdate(2019-03-01, 2019-03-28))
^
SyntaxError: invalid token
&amp;gt;&amp;gt;&amp;gt; filter = client.LastUpdate(2019-03-01, 2019-03-28)
File "&amp;lt;stdin&amp;gt;", line 1
filter = client.LastUpdate(2019-03-01, 2019-03-28)
^
SyntaxError: invalid token
&amp;gt;&amp;gt;&amp;gt; adv = client.get_by_severity(adv_format='cvrf', severity='high', LastUpdate('2019-03-01', '2019-03-28'))
File "&amp;lt;stdin&amp;gt;", line 1
SyntaxError: positional argument follows keyword argument
&amp;gt;&amp;gt;&amp;gt; filter = client.LastUpdate('2019-03-01', '2019-03-28')
Traceback (most recent call last):
File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
AttributeError: 'OpenVulnQueryClient' object has no attribute 'LastUpdate'&lt;/PRE&gt;</description>
    <pubDate>Fri, 29 Mar 2019 20:17:17 GMT</pubDate>
    <dc:creator>ryansharpe</dc:creator>
    <dc:date>2019-03-29T20:17:17Z</dc:date>
    <item>
      <title>OpenVuln API Python Library with Filtering</title>
      <link>https://community.cisco.com/t5/services-discussions/openvuln-api-python-library-with-filtering/m-p/3829110#M448</link>
      <description>&lt;P&gt;I'm trying to build a script using the Python Library using the filtering example provided on Github, but I'm getting errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; from openVulnQuery import query_client
&amp;gt;&amp;gt;&amp;gt; client = query_client.OpenVulnQueryClient(id, secret)

&amp;gt;&amp;gt;&amp;gt; advisories = client.get_by_all(adv_format='cvrf', all_adv='all', LastUpdate(2019-03-01, 2019-03-28))
File "&amp;lt;stdin&amp;gt;", line 1
advisories = client.get_by_all(adv_format='cvrf', all_adv='all', LastUpdate(2019-03-01, 2019-03-28))
^
SyntaxError: invalid token

&amp;gt;&amp;gt;&amp;gt; adv = client.get_by_severity(adv_format='cvrf', severity='high', LastUpdate(2019-03-01, 2019-03-28))
File "&amp;lt;stdin&amp;gt;", line 1
adv = client.get_by_severity(adv_format='cvrf', severity='high', LastUpdate(2019-03-01, 2019-03-28))
^
SyntaxError: invalid token
&amp;gt;&amp;gt;&amp;gt; filter = client.LastUpdate(2019-03-01, 2019-03-28)
File "&amp;lt;stdin&amp;gt;", line 1
filter = client.LastUpdate(2019-03-01, 2019-03-28)
^
SyntaxError: invalid token
&amp;gt;&amp;gt;&amp;gt; adv = client.get_by_severity(adv_format='cvrf', severity='high', LastUpdate('2019-03-01', '2019-03-28'))
File "&amp;lt;stdin&amp;gt;", line 1
SyntaxError: positional argument follows keyword argument
&amp;gt;&amp;gt;&amp;gt; filter = client.LastUpdate('2019-03-01', '2019-03-28')
Traceback (most recent call last):
File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
AttributeError: 'OpenVulnQueryClient' object has no attribute 'LastUpdate'&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Mar 2019 20:17:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/services-discussions/openvuln-api-python-library-with-filtering/m-p/3829110#M448</guid>
      <dc:creator>ryansharpe</dc:creator>
      <dc:date>2019-03-29T20:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVuln API Python Library with Filtering</title>
      <link>https://community.cisco.com/t5/services-discussions/openvuln-api-python-library-with-filtering/m-p/3829137#M449</link>
      <description>&lt;P&gt;Here is the correct way to apply filters:&lt;/P&gt;&lt;PRE&gt;client = query_client.OpenVulnQueryClient(client_id=creds.cisco_id, client_secret=creds.cisco_secret)
filter = query_client.TemporalFilter(query_client.PUBLISHED_LAST, '2019-03-01', '2019-03-28')
cisco_advisories = client.get_by_all(adv_format='default', all_adv='all', a_filter=filter)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Someone should update the github documentation.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 21:31:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/services-discussions/openvuln-api-python-library-with-filtering/m-p/3829137#M449</guid>
      <dc:creator>ryansharpe</dc:creator>
      <dc:date>2019-03-29T21:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVuln API Python Library with Filtering</title>
      <link>https://community.cisco.com/t5/services-discussions/openvuln-api-python-library-with-filtering/m-p/4087920#M699</link>
      <description>&lt;P&gt;Can you check if the filter is working for the get by product API call?&lt;/P&gt;&lt;P&gt;get_by_all works fine. But the filter doesn't work well for get_by_product. It fetches all the advisories for that product but not by the given time duration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please assist.&lt;/P&gt;&lt;PRE&gt;a = '2020-05-15'
b = '2020-05-18'
filter = query_client.TemporalFilter(query_client.PUBLISHED_LAST, a, b)
#cisco_advisories = client.get_by_all(adv_format='default', all_adv='all', a_filter=filter)
cisco_advisories_product = client.get_by_product(adv_format='default', product_name='iso', a_filter=filter)&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 May 2020 15:02:04 GMT</pubDate>
      <guid>https://community.cisco.com/t5/services-discussions/openvuln-api-python-library-with-filtering/m-p/4087920#M699</guid>
      <dc:creator>prashasth1994</dc:creator>
      <dc:date>2020-05-18T15:02:04Z</dc:date>
    </item>
  </channel>
</rss>

