Skip to content
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

Merged
merged 1 commit into from
Apr 24, 2018
Merged

This commit contains a new resource IPAssociation #10

merged 1 commit into from
Apr 24, 2018

Conversation

saiprasannasastry
Copy link
Contributor

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

Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("net_address", nil),
Description: "Give the address in cidr format.",
Copy link
Collaborator

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.",
Copy link
Collaborator

@jkraj jkraj Apr 24, 2018

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.

Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("vmid", nil),
Description: "Virtual Machine name.",
Copy link
Collaborator

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.

Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("tenant_id", nil),
Description: "Unique identifier of your instance in cloud.",
Copy link
Collaborator

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)

Copy link
Collaborator

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)

Copy link
Collaborator

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

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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())
Copy link
Collaborator

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
@jkraj jkraj merged commit ac20bdc into infobloxopen:master Apr 24, 2018
AvRajath added a commit that referenced this pull request Dec 16, 2020
…network_branch

Adding DataSource for Network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants