THE GAME HAS CHANGED

Introducing Infoblox Universal DDI ManagementTM

Watch the launch to discover the new era of management for critical network services. Watch Now

API & Integration, DevOps,NetOps,SecOps

Reply

How to delete Network's extensible attributes via WAPI

New Member
Posts: 4
5512     0

Hi all,

 

I've been struggling with the WAPI Docs, trying to find a way to delete an extensible attribute attached to a Network or Network Container.

 

When using the Infoblox UI, I can browse the IPAM's Network View to get the list of Networks and Network Containers, where I can edit that record, check a specific extensible attribute (checkbox next to the name) and then click the bin icon.

 

However, I can't find any way to run the same request/function by using the WAPI, through my app that integrates with Infoblox.

 

Suggestions?

 

Thanks in advance for your time,

 

D

Re: How to delete Network's extensible attributes via WAPI

Adviser
Posts: 181
5512     0

Hi,

 

You can remove the extattrs using extattrs- as shown below:

Following is an example of unconditionally removing the “attrstring” and “attrinteger” extensible attributes:

"extattrs-": {
"attrstring": {},
"attrinteger": {}
}

To remove an extensible attribute that has a specific value, the value should be passed to the request as follows:

"extattrs-": {
"attrstring": {"value": "test string"},
}

If the specified value is different than the existing value, the appliance returns an error.

 

For a specific networok, pass this as the body to a PUT request like below to remove an extensible attribute Site

curl -k -u admin:infoblox -H 'content-type: application/json' -X PUT "https://grid-master/wapi/v2.11/network/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5pbmZvLndhcGk:10.10.10.0/24/default?_return_fields%2B=extattrs&_return_as_object=1" -d '{"extattrs-":{"Site": {"value": "East"}}}'

hope this helps,

Krishna

Re: How to delete Network's extensible attributes via WAPI

New Member
Posts: 4
5512     0

Thank you very much!

Re: How to delete Network's extensible attributes via WAPI

New Member
Posts: 4
5512     0

Hi, Krishna,

 

Sorry to bother you again.

 

That example worked very well. However, I can't make it work with the descendants actions.

 

- Given a Network Container with the following data:

 

{
    "extattrs": {
        "FirstExtAttr": { "value": "123" },
        "SecondExtAttr": { "value": "qwerty" }
    }
}

 

- Given a Network that belongs to the Network Container with the same content (inherited from the parent's Network Container)

 

- When I try to delete one of the extensible attributes by sending a PUT request with the following content targeting the Network Container's reference:

 

{
    "extattrs-": {
        "FirstExtAttr": {
            "descendants_action": {
                "option_delete_ea": "REMOVE"
            }
        }
    }
}

 

I am expecting to delete the extensible attribute on both cases (Network Container and child Network). Still, it looks like the action ignores the "option_delete_ea" and changes the child Network's extensible attribute like it was the 1st level to include it, so that the Network Container deletes it, but the child Network keeps it as the 1st one to add the extensible attribute.

 

Should I run additional calls to remove both of them?

 

Thanks in advance,

 

D

Re: How to delete Network's extensible attributes via WAPI

Adviser
Posts: 181
5513     0

Hi,

 

The option descendants_action has to be set before the actual deletion of the EA.

 

So you can first do a PUT request to set the option, and the use extattrs- to delete the EA.

 

Hope this works,

Krishna

Re: How to delete Network's extensible attributes via WAPI

New Member
Posts: 4
5513     0

Hi,

 

That was my guessing yesterday, and I tried it before posting the new message. However, when I send a PUT request with the following body...

 

{
    "extattrs": {
        "ExtAttrName": {
            "descendants_action": {
                "option_delete_ea" => "REMOVE"
            }
        }
    }
}

 

...then I get an error coming from the WAPI with this message:

 

Invalid value for extattrs: {"ExtAttrName": {"descendants_action": {"option_delete_ea": "REMOVE"}}}: 'inheritance_operation'

 

As per my guessings, if I want to update the descendants' action, then I need to provide the inheritance operation too. However, I am updating the 1st level inside the Network View, meaning that the inheritance action can't be applied because there isn't a parent.

 

Does this make any sense to you?

 

Thanks in advance for all your help.

 

D

Showing results for 
Search instead for 
Did you mean: 

Recommended for You