Hi All
I'm new to using API's so having a few issues figuring out how to use the SWIS API. So far I've been able to get my python script connected, obtaining IP subnet and node data and quickly tested the get next available IP function.
I'm trying to migrate some IP data into our SW IPAM system, but the data is from spreadsheet data is not reliable enough to be used as DNS information. I'd like to add the data I have to the IP node description or comment field. How can I do this this using SWIS? can you run an "Update"?
Below is my function for obtaining the IP Node info.
def get_ip_node_info():
counter = 0
nodeinfo = swis.query("SELECT TOP 500 IpNodeId, SubnetId, IPOrdinal, IPAddress, Alias, Description, Comments FROM IPAM.IPNode'")
#print(nodeinfo)
for node in nodeinfo['results']:
node_id = nodeinfo['results'][counter]['IpNodeId']
node_ip = nodeinfo['results'][counter]['IPAddress']
node_alias = nodeinfo['results'][counter]['Alias']
node_description = nodeinfo['results'][counter]['Description']
node_comments = nodeinfo['results'][counter]['Comments']
print(str(counter) + " *-* " + str(node_id ) + " *-* " + str(node_ip) + " *-* " + str(node_alias) + " *-* " + str(node_description) + " *-* " + str(node_comments))
counter = counter + 1