func defaultSubnet() gomaasapi.CreateSubnet { var s gomaasapi.CreateSubnet s.DNSServers = []string{"192.168.1.2"} s.Name = "maas-eth0" s.Space = "space-0" s.GatewayIP = "192.168.1.1" s.CIDR = "192.168.1.0/24" s.ID = 1 return s }
func (s *instanceTest) newSubnet(cidr, space string, id uint) *bytes.Buffer { var sub gomaasapi.CreateSubnet sub.DNSServers = []string{"192.168.1.2"} sub.Name = cidr sub.Space = space sub.GatewayIP = "192.168.1.1" sub.CIDR = cidr sub.ID = id return s.subnetJSON(sub) }
func createSubnet(ipRange, spaceAndNICID uint) gomaasapi.CreateSubnet { var s gomaasapi.CreateSubnet s.DNSServers = []string{"192.168.1.2"} s.Name = fmt.Sprintf("maas-eth%d", spaceAndNICID) s.Space = fmt.Sprintf("Space %d", spaceAndNICID) s.GatewayIP = fmt.Sprintf("192.168.%v.1", ipRange) s.CIDR = fmt.Sprintf("192.168.%v.0/24", ipRange) return s }