<?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 [Solved] add installation targets to policy in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Solved-add-installation-targets-to-policy/m-p/122898#M5978</link>
    <description>&lt;P&gt;Hello CP users,&lt;/P&gt;&lt;P&gt;I am in the process of testing the API and can't seem to find the command to add a newly created cluster to a policy's installation targets. I was able to blow away all targets for a policy and replacing it with a single gateway using the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;mgmt_cli set package name "MyPolicyName" installation-targets "MyFWCluster"&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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously the above is not what I want.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&amp;nbsp;&lt;SPAN&gt;The API documentation makes reference to the "add" parameter but I get an error about pairs (key and value).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="SET PACKAGE INSTALLATION-TARGET" href="https://sc1.checkpoint.com/documents/latest/APIs/index.html?#cli/set-package~v1.6.1%20" target="_blank" rel="noopener"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html?#cli/set-package~v1.6.1%20&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I see when using the add entry:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# mgmt_cli set package name "MyPolicyName" installation-targets add "MyFWCluster" -s id.txt --format json
Error: The parameters of set-package command should be provided in pairs (key and value). You have provided an odd number of parameters which suggests that you are probably missing a parameter.&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;&lt;/P&gt;&lt;P&gt;API version = 1.6.1 R80.40 GA Take 102&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated. Thanks in advance everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;***UPDATE***&lt;/P&gt;&lt;P&gt;Beat the community to the solution. Trial and error lead me to find the solution.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mgmt_cli set package name "MyPolicyName" installation-targets.add "MyFWCluster" -s id.txt --format json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 04 Jul 2021 08:25:00 GMT</pubDate>
    <dc:creator>a3498881-aa5d-4</dc:creator>
    <dc:date>2021-07-04T08:25:00Z</dc:date>
    <item>
      <title>[Solved] add installation targets to policy</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Solved-add-installation-targets-to-policy/m-p/122898#M5978</link>
      <description>&lt;P&gt;Hello CP users,&lt;/P&gt;&lt;P&gt;I am in the process of testing the API and can't seem to find the command to add a newly created cluster to a policy's installation targets. I was able to blow away all targets for a policy and replacing it with a single gateway using the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;mgmt_cli set package name "MyPolicyName" installation-targets "MyFWCluster"&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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously the above is not what I want.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&amp;nbsp;&lt;SPAN&gt;The API documentation makes reference to the "add" parameter but I get an error about pairs (key and value).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="SET PACKAGE INSTALLATION-TARGET" href="https://sc1.checkpoint.com/documents/latest/APIs/index.html?#cli/set-package~v1.6.1%20" target="_blank" rel="noopener"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html?#cli/set-package~v1.6.1%20&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I see when using the add entry:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# mgmt_cli set package name "MyPolicyName" installation-targets add "MyFWCluster" -s id.txt --format json
Error: The parameters of set-package command should be provided in pairs (key and value). You have provided an odd number of parameters which suggests that you are probably missing a parameter.&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;&lt;/P&gt;&lt;P&gt;API version = 1.6.1 R80.40 GA Take 102&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated. Thanks in advance everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;***UPDATE***&lt;/P&gt;&lt;P&gt;Beat the community to the solution. Trial and error lead me to find the solution.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mgmt_cli set package name "MyPolicyName" installation-targets.add "MyFWCluster" -s id.txt --format json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 08:25:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Solved-add-installation-targets-to-policy/m-p/122898#M5978</guid>
      <dc:creator>a3498881-aa5d-4</dc:creator>
      <dc:date>2021-07-04T08:25:00Z</dc:date>
    </item>
  </channel>
</rss>

