Skip to content

Commit d16ccb0

Browse files
committed
Added search Subnet by CIDR and SectionID
1 parent 8f7ea86 commit d16ccb0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

controllers/subnets/subnets.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ func (c *Controller) GetSubnetsByCIDR(cidr string) (out []Subnet, err error) {
144144
return
145145
}
146146

147+
func (c *Controller) GetSubnetsByCIDRAndSection(cidr string, section_id int) (out []Subnet, err error) {
148+
err = c.SendRequest("GET", fmt.Sprintf("/subnets/cidr/%s/?filter_by=sectionId\\&filter_value=%d", cidr, section_id), &struct{}{}, &out)
149+
return
150+
}
151+
147152
// GetFirstFreeSubnet GETs the first free child subnet inside subnet with specified mask
148153
func (c *Controller) GetFirstFreeSubnet(id int, mask int) (message string, err error) {
149154
err = c.SendRequest("GET", fmt.Sprintf("/subnets/%d/first_subnet/%d/", id, mask), &struct{}{}, &message)

0 commit comments

Comments
 (0)