Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mathisve/ec2ifupifdown
https://github.com/mathisve/ec2ifupifdown
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mathisve/ec2ifupifdown
- Owner: mathisve
- License: mit
- Created: 2021-11-27T13:19:21.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-14T19:45:34.000Z (about 2 years ago)
- Last Synced: 2023-07-28T12:57:37.786Z (over 1 year ago)
- Language: Go
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ec2ifupifdown
go package to control network interfaces on ec2 instances, among other things.
## Example
```go
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
```go
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
}
```