Skip to main content
Flexible Top Header
Answer

replicate in API v2 the behaviour of 'excludeDHCPRange=false' from v1 API

  • August 19, 2025
  • 2 replies
  • 53 views

massodec

Hello,

We are migrating our "legacy" v1 API scripts for BAM 9.6.1 to v2 API.

In one of those tools, we use v1 "POST /Services/REST/v1/assignNextAvailableIP4Address" to look for a free static IP address. This endpoint provides parameter 'excludeDHCPRange=false' to easily avoid assigning static IP addresses from DHCP Ranges.

To achieve the same outcome in v2 API, we should use v2 "POST /api/v2/networks/{collectionId}/addresses" with the 'x-bcn-excluded-addresses' header.
But that header is not a Boolean but a list of IPRanges.

We're thinking on populating that 'x-bcn-excluded-addresses' header with the output of another API call to "GET /api/v2/networks/{collectionId}/ranges".

But even this approach is pretty straight-forward, it feels we are over complicating the process.

Are we missing something? Is there any easier way to achieve in v2 API the same behaviour from v1 'excludeDHCPRange=false' ?

Thank you very much.

Best answer by tmaestas

As far as I know, there’s not a simpler way to do this.  Perhaps ​@bshorland  can confirm.

2 replies

Forum|alt.badge.img+2
  • Verified Resolver
  • Answer
  • August 19, 2025

As far as I know, there’s not a simpler way to do this.  Perhaps ​@bshorland  can confirm.


massodec
  • Author
  • Provisioned Rookie
  • August 21, 2025

Thanks ​@tmaestas for your answer.

I have created a RFE through Care.