<?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 Using python SDK to create host in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-python-SDK-to-create-host/m-p/83091#M4767</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to write a script to create a host using the python sdk, but i keep coming across this weird issue.&lt;/P&gt;&lt;P&gt;When i have a list of ip address, and the loop through the list and try to create the host objects like this&lt;/P&gt;&lt;P&gt;api_client.api_call("add-host", {"name": host_name, "ip-address": host_ip})&lt;/P&gt;&lt;P&gt;host_ip being the variable i am using to store the ip address in my loop&lt;/P&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;P&gt;message: Invalid parameter for [ip-address]. Not a valid IPv4 or IPv6 address&lt;BR /&gt;code: generic_err_invalid_parameter&lt;/P&gt;&lt;P&gt;But i take one of the ip address that i get an error with and put it in manually like this&lt;/P&gt;&lt;P&gt;api_client.api_call("add-host", {"name": host_name, "ip-address": "1.1.1.1"})&lt;/P&gt;&lt;P&gt;it works perfect, no errors&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried stripping the data from any extra spaces and converting to string, but still getting the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any one else ever come across this before?&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2020 16:27:51 GMT</pubDate>
    <dc:creator>bhaizlett123</dc:creator>
    <dc:date>2020-04-24T16:27:51Z</dc:date>
    <item>
      <title>Using python SDK to create host</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-python-SDK-to-create-host/m-p/83091#M4767</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to write a script to create a host using the python sdk, but i keep coming across this weird issue.&lt;/P&gt;&lt;P&gt;When i have a list of ip address, and the loop through the list and try to create the host objects like this&lt;/P&gt;&lt;P&gt;api_client.api_call("add-host", {"name": host_name, "ip-address": host_ip})&lt;/P&gt;&lt;P&gt;host_ip being the variable i am using to store the ip address in my loop&lt;/P&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;P&gt;message: Invalid parameter for [ip-address]. Not a valid IPv4 or IPv6 address&lt;BR /&gt;code: generic_err_invalid_parameter&lt;/P&gt;&lt;P&gt;But i take one of the ip address that i get an error with and put it in manually like this&lt;/P&gt;&lt;P&gt;api_client.api_call("add-host", {"name": host_name, "ip-address": "1.1.1.1"})&lt;/P&gt;&lt;P&gt;it works perfect, no errors&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried stripping the data from any extra spaces and converting to string, but still getting the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any one else ever come across this before?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 16:27:51 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-python-SDK-to-create-host/m-p/83091#M4767</guid>
      <dc:creator>bhaizlett123</dc:creator>
      <dc:date>2020-04-24T16:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using python SDK to create host</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-python-SDK-to-create-host/m-p/83179#M4776</link>
      <description>When you print that variable, what does it show?&lt;BR /&gt;The error suggests the variable value is corrupt or in thr wrong format.</description>
      <pubDate>Sun, 26 Apr 2020 02:50:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-python-SDK-to-create-host/m-p/83179#M4776</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-04-26T02:50:11Z</dc:date>
    </item>
  </channel>
</rss>

