API & Integration

Reply
Highlighted

Update extensible_attributes over Web API ?

HYildirim
Techie
Posts: 11
12065     0

Hello,

How can we Update extensible_attributes over Web API ? I tried all different possibilites,

all of them did not work...

What is the correct syntax for it? 

https://X.X.X.X/wapi/v1.1/fixedaddress/_REFID:10.17.26.10/default?extensible_att......

thanks....

Hassan

Not: It would be great if you guys give me a java or c# sample...

 

 

 

Re: Update extensible

HYildirim
Techie
Posts: 11
12066     0

I am getting this error:

{ "Error": "AdmConProtoError: Unknown argument/field: 'VlanNo'", 

 

  "code": "Client.Ibap.Proto", 
  "text": "Unknown argument/field: 'VlanNo'"
}
 
 
 

Re: Update extensible

HYildirim
Techie
Posts: 11
12066     0

this one does not work either..

 

curl -k -u admin:infoblox -H "Content-Type: application/json" -X PUThttps://10.129.32.50/wapi/v1.1/network/##SOMEREF##:10.1.0.0/16/default -d '{"extensible_attributes": {"Site": "somewhere"}}' 

constantly saying that "unknown arg. for ext. attr.

 

Why ????

Re: Update extensible

Posts: 11
12066     0

I tried below command and its working for me

curl -k -u admin:infoblox -H "Content-Type: application/json" -X PUT https://1.1.1.20/wapi/v1.1/network/#REF#:10.0.0.0/8/default -d '{"extensible_attributes": {"Site": "somewhere"}}'

Can you provide more info on what you tried ?

 

Re: Update extensible

HYildirim
Techie
Posts: 11
12066     0

We are trying to  update extensible_attributes of an

FixedAddress object over Web API (v1.1) But we are always

getting error regarding syntax I guess...

curl -k -u admin:infoblox -H "Content-Type: application/json" -X PUT https://1.1.1.20/wapi/v1.1/network/#REF#:10.0.0.0/8/default -d '{"extensible_attributes": {"Site": "somewhere"}}

When we try to send above command, API gives error about ext...attr. 

it says  "Unknown argument/field.....

Maybe, we are not sending correct json format...

I am not sure...  

is this OK ?

-d {"extensible_attributes":{"Site":"TEST"}}

thanks....

Re: Update extensible

Posts: 11
12066     0

Can you paste the complete command which you are passing ?

Re: Update extensible

HYildirim
Techie
Posts: 11
12066     0

here it is...

curl -k -u webapi:XXXXX -X PUT https://Y.Y.Y.Y/wapi/v1.1/fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuMTcuMjYuMTAuMC4u:10.17.26.10/defa... -d {"extensible_attributes" :{"Site" :"TEST"}}

by this, we are targeting an extensible field named "Site".

So, what do you think ?

thanks....

 

 

Re: Update extensible

Posts: 11
12066     0

I see you are missing content type in your request

-H "Content-Type: application/json". Can you add this and try once ?

Re: Update extensible

HYildirim
Techie
Posts: 11
12066     0

I already tried that one too...

Content Type is JSON as default as far as I know...

event I declare cont. type, did not change anything...

still getting same error...

........

What else do you advice? thanks 

Re: Update extensible

Posts: 11
12066     0

Make sure the extensible_attribute is already existing in the appliance and extensible_attribute is case sensitive.

Re: Update extensible

HYildirim
Techie
Posts: 11
12066     0

 

Yes I am aware of those as well... typing ext. att. names 
as described in Grid and carefull about case sensitive.
 
Currently working on Perl Scripts to update those fields..
 
so far, so good... I think PAPI is stronger than WAPI.
Looks like wapi not ready yet completely...
 
thanks anyway...

Re: Update extensible

HYildirim
Techie
Posts: 11
12066     0

can you give me an example of CURL ?

to update extensible_attributes without an error..

thanks....

 

 

Re: Update extensible

Posts: 11
12066     0

Below is the CURL example which i was succesfully able to update ext_attr

curl -k -u admin:infoblox -H "Content-Type: application/json" -X PUT https://x.x.x.x/wapi/v1.1/network/ZG5zLm5ldHdvcmskMTAuMC4wLjAvOC8w:10.0.0.0/8/default -d  '{"extensible_attributes":{"Site":"TEST"}}'


"network/ZG5zLm5ldHdvcmskMTAuMC4wLjAvOC8w:10.0.0.0/8/default"

 

 

Re: Update extensible attributes in WAPI

CCox
Techie
Posts: 15
12066     0

I don't seem to get what is listed here to work for me.

Also, if the extensible attribute exists on the object I can update it, however if the extensible attribute doesn't exist previously I am unable to add the extensible field as a part of the update.

Hoping someone else has run across this and has WAPI extensible attribute updates working.

Thanks!

Craig

 

 

Re: Update extensible attributes in WAPI

CCox
Techie
Posts: 15
12066     0

It appears my problem with inconsistent updates was due to the EA was a list value and I didn't have my value in the list.

Also I think you need to use extattrs instead of extensible_attributes when working in the WAPI interface.

Craig

 

Re: Update extensible attributes in WAPI

GScott_1
Techie
Posts: 2
12066     0

Hello!

I have tried to use the examples above but with no luck.

curl -k -u admin:infoblox -H "Content-Type: application/json" -X PUT https://1.2.3.4/wapi/v1.4.2/network/ZG5zLm5ldHdvcmskMTAuMS4wLjAvMTYvMA:10.1.0.0/16/default -d  '{"extattrs":{"Site":"TEST"}}'

{ "Error": "AdmConProtoError: Invalid value for extattrs: {\"Site\": \"TEST\"}: string indices must be integers", 
  "code": "Client.Ibap.Proto", 
  "text": "Invalid value for extattrs: {\"Site\": \"TEST\"}: string indices must be integers"

Does anyone have any suggestions?

Gunnar

Based on those specific

Adviser
Posts: 213
12066     0

Based on those specific errors, the call appears to be correct but it looks like your Site EA requires integers and will not take text. You should check your Grid > Extensible Attribute page for the Site EA and see if someone specified the data type as integer. The system will enforce the data type of it's restricted.

This is a new test appliance

GScott_1
Techie
Posts: 2
12066     0

This is a new test appliance with default EA attributes and Site(string) is one of them. I have been able to add networks and update comments without any problems. Is the syntax correct?

Re: This is a new test appliance

akrt
Techie
Posts: 4
12066     0

Can you share your findings? 

Re: This is a new test appliance

mnotarus
Techie
Posts: 1
12066     0

 

I ran into the same problem.

 

It took some time but it turns out that we now have to be a little more pedantic in the submission:

 

 --data '{"extattrs": {"Site": {"value": "NEWSITE"}}}' 

 

or if you pretty-print the json

{
    "extattrs" : {
              "Site" : {
                  "value" : "NEWSITE"
               }
         }
}

Showing results for 
Search instead for 
Do you mean 

Recommended for You