Reply
Highlighted

Add a comment while adding the host?

kxwb400
Techie
Posts: 1
5044     0

Hi

 

im writing a powershell script that is going to open a CSV file, the file contains 2 columns.

FQDN, Network
pc1.company.local, 10.123.123.0/24

 

and create the host in that network and use the first available ip address.

 

I wounder if it is possible to add a comment at the same time, any one that knows?

I use a json body like this one.

{  
   "name":"wapi.info.com",
   "ipv4addrs":[  
      {  
         "ipv4addr":{  
            "_object_function":"next_available_ip",
            "_parameters":{  
               "exclude":[  
                  "10.10.10.1",
                  "10.10.10.2"
               ]
            },
            "_result_field":"ips",
            "_object":"network",
            "_object_parameters":{  
               "network":"10.10.10.0/24"
            }
         }
      }
   ]
}

Re: Add a comment while adding the host?

Adviser
Posts: 66
5045     0

Hi,

 

You can use the "comment" parameter to add a comment, like below.

{  
   "name":"wapi.info.com",
   "comment":"Test Comment",
   "ipv4addrs":[  
      {  
         "ipv4addr":{  
            "_object_function":"next_available_ip",
            "_parameters":{  
               "exclude":[  
                  "10.10.10.1",
                  "10.10.10.2"
               ]
            },
            "_result_field":"ips",
            "_object":"network",
            "_object_parameters":{  
               "network":"10.10.10.0/24"
            }
         }
      }
   ]
}

Hope this works,

Krishna

Showing results for 
Search instead for 
Do you mean 

Recommended for You