infoblox-go-client icon indicating copy to clipboard operation
infoblox-go-client copied to clipboard

extra parameters when creating record using nextavailableip function

Open tsubus opened this issue 11 months ago • 0 comments

with a regular API request, I can do the following operation in order to create a new A record with the next available ip in a specific network while excluding some IPs:

endpoint: {baseURL}/wapi/v2.13/record:a

body:

{
    "comment": "record added by API request",
    "ipv4addr": {
        "_object_function": "next_available_ip",
        "_parameters": {
            "exclude": ["10.127.24.1", "10.127.24.2"],
            "num": 1
        },
        "_result_field": "ips",
        "_object": "network",
        "_object_parameters": {
            "network": "10.127.24.0/21"
        }
    },
    "name": "test.example.com",
    "ttl": 3600,
    "use_ttl": true
}

Is there a way to do this same thing using the Go client? I know I can use the string "func:nextavailable:10.127.24.0/21" as the "ipv4addr" parameter, but this does not allow exclusions of IPs (that I know of, at least). I can't seem to find a way do this with the Go client, since it expects a *string as input.

tsubus avatar Mar 15 '24 09:03 tsubus