Reply
Accepted Solution

update not allowed for ipv4address

[ Edited ]
Authority
Posts: 31
4473     0

I'm trying to update an IP address's EAs, description, etc with a PUT to this URI:

 

https://ipam.domain.com/wapi/v2.2/ipv4address/Li5pcHY0X2FkZHJlc3MkMi4yLjIuMjQvMA:2.2.2.24

 

This is the JSON that is being passed to it:

 

[{
	"extattrs": {
		"Circuit_id": {
			"value": "55555"
		},
		"Site": {
			"inheritance_source": {
				"_ref": "network\/ZG5zLm5ldHdvcmskMi4yLjIuMC8yNC8w:2.2.2.0\/24\/default"
			},
			"value": "mysite"
		},
		"Type": {
			"inheritance_source": {
				"_ref": "network\/ZG5zLm5ldHdvcmskMi4yLjIuMC8yNC8w:2.2.2.0\/24\/default"
			},
			"value": "Public"
		},
		"Comment": {
			"value": "Comment"
		},
		"Equipment": {
			"value": "Equipment"
		},
		"Default_Gateway": {
			"value": "2.2.2.1"
		}
	}
}]

All of the data already exists before, and I'm getting it with a GET.  The only thing that is changing is the Circuit_Id.

 

 

I get this as a response to the curl request:

{ "Error": "AdmConProtoError: Operation update not allowed for ipv4address",
  "code": "Client.Ibap.Proto",
  "text": "Operation update not allowed for ipv4address"
}

The user that is running the curl request is a superuser in Infoblox.  Also, this same user can add and delete records.

 

Am I passing the right thing, or is there something wrong with the JSON that I'm sending?  It passes jsonlinter.com as legit, but it's entirely possible that it's not exactly what Infoblox is looking for.

 

Thanks!

Blair

Re: update not allowed for ipv4address

Authority
Posts: 31
4474     0

I also tried using a direct curl call instead of via PHP, and I get the same result:

$ curl -k -u user:pass -H "Content-Type: application/json" -X PUT https://ipam.domain.com/wapi/v2.2/ipv4address/Li5pcHY0X2FkZHJlc3MkMi4yLjIuMjQvMA:2.2.2.24 -d '[{"_ref":"ipv4address\/Li5pcHY0X2FkZHJlc3MkMi4yLjIuMjQvMA:2.2.2.24","extattrs":{"Circuit_id":{"value":"55555"},"Site":{"inheritance_source":{"_ref":"network\/ZG5zLm5ldHdvcmskMi4yLjIuMC8yNC8w:2.2.2.0\/24\/default"},"value":"mysite"},"Type":{"inheritance_source":{"_ref":"network\/ZG5zLm5ldHdvcmskMi4yLjIuMC8yNC8w:2.2.2.0\/24\/default"},"value":"Public"},"Comment":{"value":"Comment"},"Equipment":{"value":"Equipment"},"Default_Gateway":{"value":"2.2.2.1"}},"ip_address":"2.2.2.24","is_conflict":false,"mac_address":"","names":["myname"],"network":"2.2.2.0\/24","network_view":"default","objects":["record:host\/ZG5zLmhvc3QkLm5vbl9ETlNfaG9zdF9yb290LjAuMTQ5NDUzNzgzOTg0MS5teW5hbWU:myname\/%20"],"status":"USED","types":["HOST"],"usage":[]}]'
{ "Error": "AdmConProtoError: Operation update not allowed for ipv4address",
  "code": "Client.Ibap.Proto",
  "text": "Operation update not allowed for ipv4address"
}

Re: update not allowed for ipv4address

Authority
Posts: 31
4474     0

For those that come after, I found out that I can't update the EAs directly...I have to delete the address and then add it back with the updates.

Re: update not allowed for ipv4address

Moderator BRampling
Moderator
Posts: 69
4474     0

The ipv4address object is not editable so you do need to remove it and re-add it as you mentioned. In other cases where the object is editable you can change the content of individual EAs using the EA add/update like this:

 

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

Re: update not allowed for ipv4address

ton10291
Techie
Posts: 12
4474     0

 

Is there a way to construct a new ipv4address from an existing ipv4address object?

 

What i'm thinking is:

 

1. Get an existing ipv4address object.

2. Change the names field.

3. Delete the existing ipv4address.

4. Create the new ipv4address using the modified object from step 2.

 

The reason would be to recreate the ipv4address that would be identical to the original except for the name.

Showing results for 
Search instead for 
Do you mean 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin