<?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: Building a policy package with empty installation targets? in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133651#M6424</link>
    <description>&lt;P&gt;That worked. Thanks!&lt;/P&gt;
&lt;P&gt;Separately, the properties in 'show generic-object' are camelCase, which is incredibly nice. I don't recall seeing anything about this in the API documentation, but it's possible I've been looking in the wrong places. This could make my life significantly easier.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Nov 2021 18:53:11 GMT</pubDate>
    <dc:creator>Bob_Zimmerman</dc:creator>
    <dc:date>2021-11-09T18:53:11Z</dc:date>
    <item>
      <title>Building a policy package with empty installation targets?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133399#M6417</link>
      <description>&lt;P&gt;To test the ability of my code to deal properly with policy packages with empty installation targets, I'm trying to build such a policy package. It's easy in SmartConsole, but I'm not sure how to do it via the API.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true installation-targets "none"
code: "generic_err_object_not_found"
message: "Requested object [none] not found"

[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true installation-targets ""
code: "generic_err_object_not_found"
message: "Requested object [] not found"

[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true installation-targets "[]"
[Expert@TestSC:0]# mgmt_cli -f json -s session.txt show package name "Installed_Nowhere" details-level full | jq '."installation-targets"'
"all"
[Expert@TestSC:0]# mgmt_cli -s session.txt discard
number-of-discarded-changes: 1
message: "OK"

[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true
[Expert@TestSC:0]# mgmt_cli -f json -s session.txt show package name "Installed_Nowhere" details-level full | jq '."installation-targets"'
"all"
[Expert@TestSC:0]# mgmt_cli -s session.txt set package name "Installed_Nowhere" installation-targets.remove "all"
code: "generic_err_object_not_found"
message: "Requested object [all] not found"&lt;/LI-CODE&gt;
&lt;P&gt;Meanwhile, on a real box I have with a policy I built in SmartConsole:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Expert@StandingLab:0]# mgmt_cli -f json -r true show package name "Installed_Nowhere" details-level full | jq '."installation-targets"'
[]
&lt;/LI-CODE&gt;
&lt;P&gt;Is there a special value I can pass to 'add package' to get it to build a package with an empty installation targets list?&lt;/P&gt;
&lt;P&gt;Separately, I have tried building it with a single installation target, then removing that target. That causes the property to change to "all" rather than to an empty list. That seems&amp;nbsp;&lt;EM&gt;very unlikely&lt;/EM&gt; to be expected behavior.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 15:06:56 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133399#M6417</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2021-11-07T15:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Building a policy package with empty installation targets?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133401#M6418</link>
      <description>&lt;P&gt;If None (notice the caps) doesn’t work, maybe&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/37502"&gt;@Omer_Kleinstern&lt;/a&gt;&amp;nbsp;knows.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 17:03:06 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133401#M6418</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-11-07T17:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Building a policy package with empty installation targets?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133402#M6419</link>
      <description>&lt;P&gt;I thought I had tried that, but I had not. Sadly, I get the same result:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true installation-targets "None"
code: "generic_err_object_not_found"
message: "Requested object [None] not found"
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 17:34:55 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133402#M6419</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2021-11-07T17:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Building a policy package with empty installation targets?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133536#M6420</link>
      <description>&lt;P&gt;try this out (but be wary when using generic-object, I suspect you can do this with the REST API interface more easily but can't get at it right now in my lab).&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;mgmt_cli -r true set generic-object uid &amp;lt;UID for your policy package here&amp;gt; installationTargets
"SPECIFIC_GATEWAYS"&lt;/LI-CODE&gt;
&lt;P&gt;The equivalent setting for the default of all gateways is ALL_INTERNAL_GATEWAYS&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 09:53:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133536#M6420</guid>
      <dc:creator>StuartGreen</dc:creator>
      <dc:date>2021-11-09T09:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Building a policy package with empty installation targets?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133651#M6424</link>
      <description>&lt;P&gt;That worked. Thanks!&lt;/P&gt;
&lt;P&gt;Separately, the properties in 'show generic-object' are camelCase, which is incredibly nice. I don't recall seeing anything about this in the API documentation, but it's possible I've been looking in the wrong places. This could make my life significantly easier.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 18:53:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Building-a-policy-package-with-empty-installation-targets/m-p/133651#M6424</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2021-11-09T18:53:11Z</dc:date>
    </item>
  </channel>
</rss>

