Assign Layer-3 IP address to a virtual server
-
Hello,
I'm using i-doit api to develop an internal tool in my company. Is there a way to assign an ip address using the api ? Up to now I managed to get the list of used ip in a Layer-3 Object and then calculate the remaining free addresses, I'm struggling to find a way to assign one of the free ip to my objects using the "C__CATG__IP" category.
-
Your question is pretty generic, which makes it difficult to give good advice. It has been some time since I worked on this, so I'm not sure about the details and what is strictly neccessary to get it working. The following python snippet shows what goes into a C__CATG__IP entry in our scripts:
data = { 'ipv4_address': str(ip_addr.ipv4), #dotted quad 'hostname': ip_addr.hostname, 'description': ip_addr.description, 'net': ip_addr.subnet_id, # if unset, the global v4 net is used 'assigned_port': ip_addr.port_id, # probably not neccessary 'net_type': 1, # IPv4 (required for ipv4_assignment) 'ipv4_assignment': 1000 # DHCP reserved (sensible default for us) } -
@franknagel said in Assign Layer-3 IP address to a virtual server:
'ipv4_assignment': 1000
Thank you for the reply ! It's exactly what I needed.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login