bloxHub

www.infoblox.com/community
4 posts / 0 new
Modification of extensible attributes of specific fixed address through API

Hello everyone,

this is my first post so please bare with me. We have recently upgraded our infoblox appliances from 4.3r6 version to 5.1r3-12, this upgrade changed the java GUI management to webmanagament.

We want to reorganize our whole network so Smart Folders can be easily used as the filters can't use regular expressions and filter can only combined as AND, not OR between them. To do this we want to add extensible attributes to them depending on where are located (Building), type of equipment (computers, printers, servers,...) and so on.

We tried to automate this by using the Infoblox API, but had no luck. As it seems, you can set a specific value that overwrites the existing attributes of a specific fixed address, with the session -> modify(), retrieve the extensible attributes that returns a hash reference as "HASH(0x2ddb6e4)" or add an existing attribute to the fixed address which fails as it tries to overwrite the fixed address that already exists.

My question is, how can I add an extensible attribute without overwriting the existing ones on a fixed address? Can be the new extensible attribute somehow be added to that hash reference that is returned by extensible_attributes()? Can that hash reference be broken down to get the specific extensible attributes and values which it references?

It would be greatly appreciated.

Kind regards,

Aarón

+1
+1
-1
Tags
Infoblox Grid
Re: Modification of extensible attributes of specific fixed...

Hi fefa2k,

Thank you for posting your question. I'm going to alert a couple folks internally to your inquiry.  Please give us a little while to work up a response for you.

Best,

Eric

+1
0
-1
Re: Modification of extensible attributes of specific fixed...

Hello estieg,

please do not mind my earlier post as a work colleague already helped me out. I had never programmed in perl so I didn't know a hash reference could be modified.

To add a value to the hash reference retrieved of a fixed address I did this:

$extensiveRetrieved = $fixedAddress->extensible_attributes(); -> hash reference of the extensible attributes already defined in that fixed address.
$extensiveRetrieved->{ $extensiveAttribute } = $value; -> here I add the $value to the $extensiveAttribute I need, for example, Country and Spain.

After this I only had to modify the fixed address through the session already opened against the infoblox grid.

Thank you for help, I hope this helps somebody that has the same problem.

Kind regars,

Aarón

+1
0
-1
Re: Modification of extensible attributes of specific fixed...

Hey  fefa2k,

Not a problem!  A couple folks internally did send me some info, so I'll provide this as a reference to you, or perhaps other users in the future who may have a similar question :)

You can get the hashref to the extensible attributes and add to it as you see fit -  then submit with modify, so the answer to this would be yes. They can also create a new hash and pass it.  See below:

$t = $session->get(.....);

$x = $t->extensible_attributes();

$x->{'newextattr'} = 'newvalue';

$session->modify($t);

 

or more concisely

 

$t = $session->get(.....)

${$t->extensible_attributes()}{'newextattr'} = 'newvalue';

$session->modify($t);

 

to add the 'newextattr' to the existing extattrs

 

Let me know if this was helpful,

Eric

+1
+2
-1