Introducing SOC Insights for BloxOne Threat Defense: Boost your SOC efficiency with AI-driven insights to eliminate manual work and accelerate investigation and response times. Read the blog announcement here.

API & Integration, DevOps,NetOps,SecOps

Reply

How to Add multiple Extensible Attribute

New Member
Posts: 2
1049     0

I am using the InfoBlox API to add a given extensible attribute:value to a specific network obect, although I don't seem to be able to add new ones as everytime I try to do that, I always overwrite the current one. Basically I am not quite sure if the API requires an array of attribute:value all the time or If I am allowed to add an attribute one bye one

Re: How to Add multiple Extensible Attribute

Superuser
Posts: 38
1050     0

Hi ravig,

 

Each time you are setting/updating extensible attributes you need to pass all the attributes you need to set via API together.
For setting multiple attributes you can use the below format.

{
    "extattrs": {
        "Country": {
            "value": "UK"
        },
        "Region": {
            "value": "EMEA"
        }
    }
}
Shukran

Re: How to Add multiple Extensible Attribute

Moderator
Moderator
Posts: 289
1050     0

Some fields, including the extattrs field, allow for the "+" and "-" modifiers to add or remove individual values.

 

Adding a Site value to existing values

curl -k -u admin:infoblox -X PUT 'https://192.168.1.2/wapi/v2.11/network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yNy4wLzI0LzA:192.168.27.0/24/default' \
 -H "Content-Type: application/json" -d \
 '{
        "extattrs+": {
            "Site": {
                "value": "Honolulu"
            }
        }
 }'

Adding a "State" value:

curl -k -u admin:infoblox -X PUT 'https://192.168.1.2/wapi/v2.11/network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yNy4wLzI0LzA:192.168.27.0/24/default' \
 -H "Content-Type: application/json" -d \
 '{
        "extattrs+": {
            "State": {
                "value": "HI"
            }
        }
 }'

Removing a "State" value:

curl -k -u admin:infoblox -X PUT 'https://192.168.1.2/wapi/v2.11/network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yNy4wLzI0LzA:192.168.27.0/24/default' \
 -H "Content-Type: application/json" -d \
 '{
        "extattrs-": {
            "State": {
                "value": "HI"
            }
        }
 }'
Showing results for 
Search instead for 
Did you mean: 

Recommended for You