<?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: Creation of multiple rules at once in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93652#M5079</link>
    <description>&lt;P&gt;Yes, you add one rule at a time.&lt;BR /&gt;Thats precisely how the API works.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Aug 2020 14:37:27 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2020-08-07T14:37:27Z</dc:date>
    <item>
      <title>Creation of multiple rules at once</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93579#M5075</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I am in the process of creating a new policy package, where I have to add ~140 rules and would like to do it via API.&lt;/P&gt;&lt;P&gt;I have managed to create the correct format of the API call that add a access rule, but cannot figure out, how to add multiple rules at once. I can only do, one by one. ( ignore the hosts/service names, those exist on the domain )&lt;/P&gt;&lt;P&gt;rule no 1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
"layer" : "Standard Network",
"position" : "top",
"source": ["Host1-A"],
"destination": ["Host1-B"],
"service" : ["ghttp", "ghttps", "gFileShare"],
"action" : "Accept",
"track" : {
     "type": "log"
     }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rule no 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
"layer" : "Standard Network",
"position" : "bottom",
"source": ["Host2-A", "Host1-C"],
"destination": ["Host2-A", "Host2-C"],
"service" : ["gsmtp", "gssh", "ghttps", "ghttp"],
"action" : "Accept",
"track" : {
     "type": "log"
     }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rule no 3:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
"layer" : "Standard Network",
"position" : "bottom",
"source": ["Host1-D"],
"destination": ["Host2-D"],
"service" : ["gicmp", "ghttps"],
"action" : "Accept",
"track" : {
     "type": "log"
     }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If i add them like this, i don't get them all after the publish, and I think it's because of the position argument which is required and i have bottom on 2 rules.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
rule no1
},
{
rule no2 
},
{
rule no3
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;BR,&lt;BR /&gt;Paul&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 15:41:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93579#M5075</guid>
      <dc:creator>funkylicious</dc:creator>
      <dc:date>2020-08-06T15:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of multiple rules at once</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93583#M5076</link>
      <description>&lt;P&gt;I'm sorry, I've overseen the value for position :&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;integer&lt;/STRONG&gt; (&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="grey"&gt;Description:&amp;nbsp;&lt;/SPAN&gt;Add rule at the specific position ) ...&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 16:48:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93583#M5076</guid>
      <dc:creator>funkylicious</dc:creator>
      <dc:date>2020-08-06T16:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of multiple rules at once</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93623#M5077</link>
      <description>&lt;P&gt;I've implemented for each rule a position number, which is unique, starts with 1 and increments until the last rule is generated, so no overlap.&lt;/P&gt;&lt;P&gt;Cannot seem to add multiple rules at once, only 1 by 1. Is this how is supposed to work? I know that the API call states, add-access-rule and not add-access-rules, but still... I was expecting to be able to bulk add my rules.&lt;BR /&gt;Any ideas if the posibility of adding multiple rules via API is something that will be available in the future ?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 05:22:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93623#M5077</guid>
      <dc:creator>funkylicious</dc:creator>
      <dc:date>2020-08-07T05:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of multiple rules at once</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93624#M5078</link>
      <description>&lt;P&gt;This is the way it works in programming language - you have to repeat adding an object to add more than one object&amp;nbsp;8)&lt;/img&gt;. But you can write a function that takes a list of rules to bulk add and perform it (one by one)...&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 07:09:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93624#M5078</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2020-08-07T07:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of multiple rules at once</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93652#M5079</link>
      <description>&lt;P&gt;Yes, you add one rule at a time.&lt;BR /&gt;Thats precisely how the API works.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 14:37:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Creation-of-multiple-rules-at-once/m-p/93652#M5079</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-08-07T14:37:27Z</dc:date>
    </item>
  </channel>
</rss>

