Skip to content

mathisve/ec2ifupifdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ec2ifupifdown

go package to control network interfaces on ec2 instances, among other things.

Example

interfaces, err := ec2ifupifdown.GetInterfaces()
if err != nil {
    log.Panic(err)
}

for _, interf := range interfaces {
    log.Println(interf)

    interf.Ifdown()
    log.Printf("interface %s is down", interf.InterfaceId)

    interf.Ifup()
    log.Printf("interface %s is up again", interf.InterfaceId)
}

Interface struct

type Interf struct {
	DeviceNumber        int
	InterfaceId         string
	LocalHostname       string
	LocalIpv4s          []string
	Mac                 string
	OwnerId             string
	SecurityGroupIds    []string
	SecurityGroups      []string
	SubnetId            string
	SubnetIpv4CidrBlock string
	VpcId               string
	VpcIpv4CidrBlock    string
	VpcIpv4CidrBlocks   []string
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages