Skip to content

Commit 215c42b

Browse files
authored
Merge pull request #6 from pavel-z1/feature_search_in_section_by_cidr
Feature search in section by CIDR
2 parents 8f7ea86 + d16ccb0 commit 215c42b

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)