Introducing SOC Insights for BloxOne Threat Defense: Boost your SOC efficiency with AI-driven insights to eliminate manual work and accelerate investigation and response times. Read the blog announcement here.

API Examples

Reply

Assign host ip from next available IP in reserved range

New Member
Posts: 1
192     0

I can currently identify the range by using the <'range?network=192.168.120.0/24'> endpoint. 

I can then find the reserved range based on 'start_addr'. 

let's say range_data['_ref] = 'range/XX5zXmRoX3BfcmXuZ2UkMTkyLjE2OC4xMjAuMjE0LzE5Mi4xNjguMTIwLjIxNy8vLzAv:192.168.120.214/192.168.120.217/default'

I can then get the next available IP using <range_data['_ref'] + '?_function=next_available_ip'>
I want to skip the last step above and both get and reserve the IP in one call (similar to how I currently get an IP from a subnet with no reserved ranges)
endpoint - <"/record:host?_return_fields%2B=name,ipv4addrs">

 
json_body = {
'name': request_hostname.lower(),
'extattrs': {
'REQUEST': {'value': change_number}, 'TYPE': {'value': 'Server'}},
'ipv4addrs': [{
'ipv4addr': {
'_object_function': 'next_available_ip',
'_result_field': 'ips',
'_object': 'network',
'_object_parameters': {
'network': request_subnet
}
}
}]
}
I would think I would just add something like 'range': range_data['_ref'] under '_object_parameters', but this returns AdmConProtoError: Unknown object type
Showing results for 
Search instead for 
Did you mean: 

Recommended for You