Reply

Unreserve an IP via API

Member
Posts: 1
2176     0

How to unreserve IP via API 

Re: Unreserve an IP via API

Moderator
Moderator
Posts: 87
2177     0

You should be able to use the API to delete the relevant fixedaddress object.

Re: Unreserve an IP via API

Community Manager
Community Manager
Posts: 212
2177     0

You also might want to use the DELETE function to remove all DNS & DHCP & discovery information from an IP Address.  Get the IP address's reference and then issue a DELETE with the reference.  This is the same as the "Reclaim" button in the Infoblox GUI.

Re: Unreserve an IP via API

Member
Posts: 1
2177     0

Using Ansible:

 

- name: Reclaim Infoblox IP Address
  ansible.builtin.uri:
    url: "https://{{ nios_provider.host }}/wapi/v2.11/request"
    url_password: "{{ nios_provider.password }}"
    url_username: "{{ nios_provider.username }}"
    validate_certs: false
    method: POST
    status_code:
      - 201
    return_content: true
    body_format: json
    body:
      - method: "STATE:ASSIGN"
        data:
          ip_address: "{{ ipv4_reservation_ipv4_address }}"
      - method: GET
        object: "ipv4address"
        data:
          ip_address: "##STATE:ip_address:##"
        assign_state:
          ip_ref: _ref
        enable_substitution: true
        discard: true
      - method: DELETE
        object: "##STATE:ip_ref:##"
        enable_substitution: true
        discard: true
      - method: "STATE:DISPLAY"
Showing results for 
Search instead for 
Did you mean: 

Recommended for You