Skip to content

Commit

Permalink
Merge pull request #6 from pavel-z1/feature_search_in_section_by_cidr
Browse files Browse the repository at this point in the history
Feature search in section by CIDR
  • Loading branch information
pavel-z1 authored Jun 15, 2022
2 parents 8f7ea86 + d16ccb0 commit 215c42b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controllers/subnets/subnets.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ func (c *Controller) GetSubnetsByCIDR(cidr string) (out []Subnet, err error) {
return
}

func (c *Controller) GetSubnetsByCIDRAndSection(cidr string, section_id int) (out []Subnet, err error) {
err = c.SendRequest("GET", fmt.Sprintf("/subnets/cidr/%s/?filter_by=sectionId\\&filter_value=%d", cidr, section_id), &struct{}{}, &out)
return
}

// GetFirstFreeSubnet GETs the first free child subnet inside subnet with specified mask
func (c *Controller) GetFirstFreeSubnet(id int, mask int) (message string, err error) {
err = c.SendRequest("GET", fmt.Sprintf("/subnets/%d/first_subnet/%d/", id, mask), &struct{}{}, &message)
Expand Down

0 comments on commit 215c42b

Please sign in to comment.