Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra parameters when creating record using nextavailableip function #226

Open
tsubus opened this issue Mar 15, 2024 · 0 comments
Open

extra parameters when creating record using nextavailableip function #226

tsubus opened this issue Mar 15, 2024 · 0 comments

Comments

@tsubus
Copy link

tsubus commented Mar 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant