Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API Examples

Reply

WAPI: Reset fields to inherited status

Member
Posts: 5
827     0

Hi Forum,

 

I am trying to delete PXE-Boot options (next-server/bootfile) from an existing fixed address by REST-PUT. Does anyone know how to reset these fields, so they go back to the "inherited" (from network) state?

 

{"bootfile": "" "empty" or "null"} will be accepted literally  

{"bootfile": 0, empty or null } are "Bad Requests".

 

Thanks for any hint

Re: WAPI: Reset fields to inherited status

Moderator
Moderator
Posts: 248
827     0

You will also need to use the "use_" field for each attribute.  Here's how to clear out all three PXE options.

 

Before setting, getting the pertenant fields for a specific fixed address:

 

curl -k1 -u admin:infoblox -X GET 'https://192.168.1.6/wapi/v2.11/fixedaddress?ipv4addr=192.168.1.201&_return_fields%2b=bootfile,bootserver,nextserver,use_bootfile,use_bootserver,use_nextserver'                                                                                                                             

returns:

 

 

[
    {
        "_ref": "fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuOS4xNi4yMDEuMC4u:192.168.1.201/default", 
        "bootfile": "boot.bin", 
        "bootserver": "10.10.10.10", 
        "ipv4addr": "192.168.1.201", 
        "network_view": "default", 
        "nextserver": "10.10.10.10", 
        "use_bootfile": true, 
        "use_bootserver": true, 
        "use_nextserver": true
    }
]         

 

 

Then set each value using the _ref for the fixed address:

 

curl -k1 -u admin:infoblox -X PUT 'https://192.168.1.6/wapi/v2.11/fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuOS4xNi4yMDEuMC4u:192.168.1.201/default' \
-H "Content-Type: application/json" -d  \
'{
	"bootfile": "",
	"bootserver": "",
	"nextserver": "",
	"use_bootfile": false,
	"use_bootserver": false,
	"use_nextserver": false
}'

 

 

Review the fields again, after setting:

 

curl -k1 -u admin:infoblox -X GET 'https://192.168.1.6/wapi/v2.11/fixedaddress?ipv4addr=192.168.1.201&_return_fields%2b=bootfile,bootserver,nextserver,use_bootfile,use_bootserver,use_nextserver'

returns:

 

 

[
    {
        "_ref": "fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuOS4xNi4yMDEuMC4u:192.168.1.201/default", 
        "ipv4addr": "192.168.1.201", 
        "network_view": "default", 
        "use_bootfile": false, 
        "use_bootserver": false, 
        "use_nextserver": false
    }
]

 

 

Re: WAPI: Reset fields to inherited status

Member
Posts: 5
827     0

Thank you, this works.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You