-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This commit contains a new resource IPAssociation #10
Conversation
Type: schema.TypeString, | ||
Required: true, | ||
DefaultFunc: schema.EnvDefaultFunc("net_address", nil), | ||
Description: "Give the address in cidr format.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Network block/subnet in cidr format
Type: schema.TypeString, | ||
Optional: true, | ||
DefaultFunc: schema.EnvDefaultFunc("macaddr", nil), | ||
Description: "mac address of your instance in cloud.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instance => virtual machine,
Either use Virtual Machine or instance.
infoblox/resourceIPAssociation.go
Outdated
Type: schema.TypeString, | ||
Optional: true, | ||
DefaultFunc: schema.EnvDefaultFunc("vmid", nil), | ||
Description: "Virtual Machine name.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either use Virtual Machine or instance.
infoblox/resourceIPAssociation.go
Outdated
Type: schema.TypeString, | ||
Required: true, | ||
DefaultFunc: schema.EnvDefaultFunc("tenant_id", nil), | ||
Description: "Unique identifier of your instance in cloud.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unique identifier of your tenant in cloud
connector := m.(*ibclient.Connector) | ||
|
||
objMgr := ibclient.NewObjectManager(connector, "terraform", tenantID) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add detailed comment about logic here
connector := m.(*ibclient.Connector) | ||
|
||
objMgr := ibclient.NewObjectManager(connector, "terraform", tenantID) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add detailed comment about logic here
infoblox/resourceIPAllocation.go
Outdated
tenantID := d.Get("tenant_id").(string) | ||
connector := m.(*ibclient.Connector) | ||
|
||
objMgr := ibclient.NewObjectManager(connector, "terraform", tenantID) | ||
|
||
_, err := objMgr.ReleaseIP(networkViewName, cidr, ipAddr, macAddr) | ||
_, err := objMgr.DeleteHostRecord(d.Id()) | ||
if err != nil { | ||
return fmt.Errorf("Error Releasing IP from network(%s): %s", cidr, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ref instead of cidr which have all the details like n/w view + n/w etc
connector := m.(*ibclient.Connector) | ||
|
||
objMgr := ibclient.NewObjectManager(connector, "terraform", tenantID) | ||
|
||
_, err := objMgr.GetFixedAddress(networkViewName, cidr, ipAddr, macAddr) | ||
_, err := objMgr.GetHostRecord(d.Id()) | ||
if err != nil { | ||
return fmt.Errorf("Error getting IP from network block(%s): %s", cidr, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ref instead of cidr which have all the details like n/w view + n/w etc
use network block or network everywhere
connector := m.(*ibclient.Connector) | ||
|
||
objMgr := ibclient.NewObjectManager(connector, "terraform", tenantID) | ||
|
||
_, err := objMgr.GetFixedAddress(networkViewName, cidr, ipAddr, macAddr) | ||
_, err := objMgr.GetHostRecord(d.Id()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a short description why we are using host record rather than fixed address.
This commit also contains changes in the way IP gets assigned. Previously the IP assigned was of type fixedaddress now it has become host address Necessary changes in other resources have been made to allocate host address
…network_branch Adding DataSource for Network
This commit also contains changes in the way IP gets assigned.
Previously the IP assigned was of type fixedaddress
now it has become host address
Necessary changes in other resources have been made
to allocate host address