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

Support for network and ip allocation #1

Merged
merged 17 commits into from
Feb 28, 2018
Merged

Support for network and ip allocation #1

merged 17 commits into from
Feb 28, 2018

Conversation

saiprasannasastry
Copy link
Contributor

No description provided.

@saiprasannasastry
Copy link
Contributor Author

@jkraj please review

GNUmakefile Outdated
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"

vendor-status:
@govendor status
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not using govendor so remove it

Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("WAPI_VERSION", "2.8"),
Description: "which wapi version ro be used",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write validate function for all supporter wapi versions.

  1. Have a list of wapi_version constants
  2. Check the user passed version available in the list.

func Provider() terraform.ResourceProvider {
return &schema.Provider{
Schema: map[string]*schema.Schema{
"host": &schema.Schema{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete: resourceAllocationRelease,

Schema: map[string]*schema.Schema{
"networkviewname": &schema.Schema{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

network_view_name

macaddr := d.Get("macaddr").(string)
vmID := d.Get("vmid").(string)
connector := m.(*ibclient.Connector)
objMgr := ibclient.NewObjectManager(connector, "terraform", "goclient1")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want this line in all the methods 'objMgr := ibclient.NewObjectManager(connector, "terraform", "goclient1")' try to optimize it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'goclient1' should be replaced by the 'tenant id' which should be provided by user, include this as option parameter in all resource and default value as null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed at all places

Delete: resourceNetworkViewDelete,

Schema: map[string]*schema.Schema{
"networkviewname": &schema.Schema{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

network_view_name

return nil
}
func resourceNetworkViewDelete(d *schema.ResourceData, m interface{}) error {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention why it is not implemented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will put that in the read me

func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: infoblox.Provider })
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new line at the end.

Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("HOST", nil),
Description: "NIOS IP address",
Description: "NIOS IP address. Server IP address",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIOS IP address. Server IP address. Why twice. "NIOS Server IP Address"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

},
"username": &schema.Schema{
Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("USERNAME", nil),
Description: "Grid manager username",
Description: "User to authenticate ",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description looks like incomplete.

please the description and variable as it is from here. https://github.com/sky-uk/terraform-provider-infoblox/blob/master/infoblox/provider.go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

placed the descriptions which ever related to us

Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("net_view_name", nil),
Description: "give the nnetviewname you created",
Description: "give the net_view_name you created",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why description having variable name?

Start the sentence with caps

Read the sentence does it make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("net_address", nil),
Description: "",
Copy link
Collaborator

@jkraj jkraj Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens to the descriptions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Copy link
Collaborator

@jkraj jkraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type: schema.TypeInt,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("POOL_CONNECTIONS", "10"),
Description: "Maximum number of connections to establish to the database. Zero means unlimited.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not database.

Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("PORT", "443"),
Description: "Port number used for connection",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add Infoblox appliance

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to use Server instead of appliances.

Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("USERNAME", nil),
Description: "User to authenticate with Infoblox appliance ",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove space

Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("WAPI_VERSION", "2.8"),
Description: "Infoblox WAPI server version, defaults to v2.8",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WAPI version of Infoblox Appliance

Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("network_view_name", nil),
Description: "Give the network view name you created",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. remove extra space after name
  2. Network view name available in NIOS Appliance ( change the description )
  3. Make it optional
  4. specfiy 'default' in DefaultFunc

Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("network_name", nil),
Description: "The name you want to give to your network",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the Network

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": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: "The network address in IPv4 Address/CIDR format.",
},

Type: schema.TypeString,
Optional:true,
DefaultFunc: schema.EnvDefaultFunc("tennant_id",nil),
Description:"Unique identifier of your instance",
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 instance in the cloud

DefaultFunc: schema.EnvDefaultFunc("network_view_name", nil),
Description: "The name you want to give to your network view",
},
"tennant_id": &schema.Schema{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tenant not tennant
this section have format issue.

Copy link
Collaborator

@jkraj jkraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the README.md with basic steps like to compile/build etc

ResourcesMap: map[string]*schema.Resource{
"infoblox_network": resourceNetwork(),
"infoblox_network_view": resourceNetworkView(),
"infoblox_ip_allocation": resourceAllocation(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change resourceAllocation to resoureIPAddress()

Copy link
Collaborator

@jkraj jkraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change based on my review comments

@@ -0,0 +1,10 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

Copy link
Collaborator

@jkraj jkraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the go vet passed submit the changes

i will prepare the ppt and then figure out a way to optimize.
@jkraj jkraj changed the title Add files via upload Support for network and ip allocation Feb 28, 2018
@jkraj jkraj merged commit 43721b4 into infobloxopen:master Feb 28, 2018
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.

2 participants