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 provide null value for an extensible attribute as part of API POST method call?

Authority
Posts: 29
6895     0

 

Hi Team,

 

I have a quick question.

 

What is the way to provide empty value for an Infoblox extensible attribute as a part of API call??

 

When I write like this, "Justification":{"value":""},the API is throwing me an error. I don’t prefer writing null as a value for a parameter.

 

Can you suggest me what is the correct way to pass on empty value as part of API call?

 

 

curl -k -u paSmiley Tonguea -H 'content-type: application/json' -X POST "https://aial3019.belldev.dev.bce.ca/wapi/v2.7/fixedaddress?_return_fields%2B=ipv4addr,mac&_return_as..." -d '{"ipv4addr":"10.20.0.5","mac":"aa:bb:cc:13:22:35","extattrs":{"Device Site Code":{"value":"DCO"},"ICN Device Type":{"value":"G"},"Device Sequence":{"value":"16"},"Device Interface":{"value":"255"},"Device Extension Number":{"value":"0"},"Network Element":{"value":"DCOVKA-101"},"Slot/Sub Slot":{"value":"1/"},"Port":{"value":"48"},"IP Address Complete":{"value":"67.69.243.250"},"Nat IP Complete":{"value":"null"},"Transaction Type":{"value":"AssignIpTransaction"},"Transaction Status":{"value":"Completed"},"Transaction Effective Date":{"value":"2014-05-10 14:24:54.667"},"Bay Location":{"value":"null"},"Is Sent To DNS":{"value":"1"},"Comments History":{"value":"PLEASE ASSIGN VIP ON DEVICE NAME: ALIC8P; VLAN: V523"},"Responsible PEIN":{"value":"6080971"},"CP4 PEIN":{"value":"null"},"VLAN":{"value":"V550"},"IP Required":{"value":"1"},"Reference Number":{"value":"20170628153434"},"Source":{"value":"Other"},"Asset Type":{"value":"AI Server"},"Device Serial Number":{"value":"null"},"ICN Device Model":{"value":"null"},"Justification":{"value":""}}}'

 

 

"code": "Client.Ibap.Data.Conflict",

"text": "Missing value for extensible attribute 'Justification'

Re: how to provide null value for an extensible attribute as part of API POST method call?

Adviser
Posts: 181
6895     0

Hi,

 

If your intention is to remove the EA "Justification" from the list of EAs, then do not pass it in the body like below:

curl -k -u admin:infoblox -H 'content-type: application/json' -X POST "https://aial3019.belldev.dev.bce.ca/wapi/v2.7/fixedaddress?_return_fields%2B=ipv4addr,mac&_return_as..." -d '{"ipv4addr":"10.20.0.5","mac":"aa:bb:cc:13:22:35","extattrs":{"Device Site Code":{"value":"DCO"},"ICN Device Type":{"value":"G"},"Device Sequence":{"value":"16"},"Device Interface":{"value":"255"},"Device Extension Number":{"value":"0"},"Network Element":{"value":"DCOVKA-101"},"Slot/Sub Slot":{"value":"1/"},"Port":{"value":"48"},"IP Address Complete":{"value":"67.69.243.250"},"Nat IP Complete":{"value":"null"},"Transaction Type":{"value":"AssignIpTransaction"},"Transaction Status":{"value":"Completed"},"Transaction Effective Date":{"value":"2014-05-10 14:24:54.667"},"Bay Location":{"value":"null"},"Is Sent To DNS":{"value":"1"},"Comments History":{"value":"PLEASE ASSIGN VIP ON DEVICE NAME: ALIC8P; VLAN: V523"},"Responsible PEIN":{"value":"6080971"},"CP4 PEIN":{"value":"null"},"VLAN":{"value":"V550"},"IP Required":{"value":"1"},"Reference Number":{"value":"20170628153434"},"Source":{"value":"Other"},"Asset Type":{"value":"AI Server"},"Device Serial Number":{"value":"null"},"ICN Device Model":{"value":"null"}}}'

If you want to pass it a null value, then you would have to call it null, like below:

curl -k -u admin:infoblox -H 'content-type: application/json' -X POST "https://aial3019.belldev.dev.bce.ca/wapi/v2.7/fixedaddress?_return_fields%2B=ipv4addr,mac&_return_as..." -d '{"ipv4addr":"10.20.0.5","mac":"aa:bb:cc:13:22:35","extattrs":{"Device Site Code":{"value":"DCO"},"ICN Device Type":{"value":"G"},"Device Sequence":{"value":"16"},"Device Interface":{"value":"255"},"Device Extension Number":{"value":"0"},"Network Element":{"value":"DCOVKA-101"},"Slot/Sub Slot":{"value":"1/"},"Port":{"value":"48"},"IP Address Complete":{"value":"67.69.243.250"},"Nat IP Complete":{"value":"null"},"Transaction Type":{"value":"AssignIpTransaction"},"Transaction Status":{"value":"Completed"},"Transaction Effective Date":{"value":"2014-05-10 14:24:54.667"},"Bay Location":{"value":"null"},"Is Sent To DNS":{"value":"1"},"Comments History":{"value":"PLEASE ASSIGN VIP ON DEVICE NAME: ALIC8P; VLAN: V523"},"Responsible PEIN":{"value":"6080971"},"CP4 PEIN":{"value":"null"},"VLAN":{"value":"V550"},"IP Required":{"value":"1"},"Reference Number":{"value":"20170628153434"},"Source":{"value":"Other"},"Asset Type":{"value":"AI Server"},"Device Serial Number":{"value":"null"},"ICN Device Model":{"value":"null"},"Justification":{"value":"null"}}}'

Hope this is helpful,

Thanks & Regards,

Krishna Vasudevan

Re: how to provide null value for an extensible attribute as part of API POST method call?

Authority
Posts: 29
6895     0

Actually, i want to provide a empty value. With your API call, Justification attribute will have a string value called null. Can I pass the empty string?

Re: how to provide null value for an extensible attribute as part of API POST method call?

Adviser
Posts: 181
6895     0

Hi,

 

There is no provision to pass an empty string as such.

 

Regards,

Krishna

Re: how to provide null value for an extensible attribute as part of API POST method call?

Adviser
Posts: 63
6896     0

If you are updating an existing object, you can either add or remove an attribute by uisng extattrs+ to add or extattrs- to remove attributes without affecting other attributes that may already exist!

 

Documentation is here:

    https://{GridMasterNameOrIP}/wapidoc/additional/extattrsearch.html#extensible-attributes-update

 

Or this public page:

    https://ipam.illinois.edu/wapidoc/additional/extattrsearch.html#extensible-attributes-update

 

 

 

Extensible attributes update

The extensible attributes field allows +/- to be specified as part of the field name while updating the object, which will respectively add/modify or remove the specified extensible attribute. The appliance returns an error when the specified extensible attribute does not exist. Note that this is supported only when using JSON to access WAPI.

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.

Following is an example of adding or updating (if the extensible attribute already exists) the “attrstring” extensible attribute:

"extattrs+": {
             "attrstring": {"value": "new string"}
             }

if Re: how to provide null value for an extensible attribute as part of API POST method call?

Authority
Posts: 14
6896     0

how to check if the EA is null or not?

Showing results for 
Search instead for 
Did you mean: 

Recommended for You