Reply

[HELP] [URGENT] API operations using _return_fields

[ Edited ]
New Member
Posts: 2
3109     0

Hello,

 

I have the curl command following

 

curl -s -k -u "adminSmiley Tongueasswd!" -H "Content-Type: application/json" -X GET "https://10.111.133.100/wapi/v2.7.1/dtc:topology:rule?_return_fields=source".

 

Here what the command returns:

 

{
"_ref": "dtc:topology:rule/ZG5zLmlkbnNfdG9wb2xvZ3lfcnVsZSRyaWdodHYubnR2NF9vcmFuZ2UuZnJfdG9wby4zOGI2NWU1Mi03MGJmLTQ0ZWEtOGU4OC1hOWE0OTFiNzlhOWM:rightv.ntv4_orange.fr_topo/rightv.ntv4_orange.fr_abo",
"sources": [
{
"source_op": "IS",
"source_type": "SUBNET",
"source_value": "10.65.0.0/16"
}
]
},
{
"_ref": "dtc:topology:rule/ZG5zLmlkbnNfdG9wb2xvZ3lfcnVsZSRyaWdodHYubnR2NF9vcmFuZ2UuZnJfdG9wby5mNGFmOTJiNC0wMmFlLTQxOTItODNmZC1iYTZmYmVhM2ZhMDA:rightv.ntv4_orange.fr_topo/rightv.ntv4_orange.fr_int",
"sources": [
{
"source_op": "IS_NOT",
"source_type": "SUBNET",
"source_value": "10.65.0.0/16"
}
]
},
{
"_ref": "dtc:topology:rule/ZG5zLmlkbnNfdG9wb2xvZ3lfcnVsZSRyaWdodHYubnR2NF9vcmFuZ2UuZnJfdG9wby45MWFjMDVjNC1mMjI5LTQ4NTUtYWRmMC1kOGUyOWRiYWQ2ZTg:rightv.ntv4_orange.fr_topo/rightv.ntv4_orange.fr_abo",
"sources": [
{
"source_op": "IS",
"source_type": "SUBNET",
"source_value": "80.12.41.120/29"
}
]
}

 

 

 

 

I just want the topology rules where the source_value is 10.65.0.0/16.

 

Can you help me with any operations I have to do ?

 

Thank you.

Re: [HELP] [URGENT] API operations using _return_fields

Moderator
Moderator
Posts: 321
3110     0

Based on the API doc, the sources field is not searchable.  NIOS will always return all the rules for a topology ruleset.

 

The topology field is searchable, so you can limit the results to a single topology ruleset by searching for that ruleset by reference:

 

curl -k -u admin:infoblox -X GET "https://10.111.133.100/wapi/v2.7.1/dtc:topology:rule?topology=dtc:topology/ZG5zLmlkbnNfdG9wb2xvZ3kkcmlnaHR2Lm50djRfb3JhbmdlLmZyX3RvcG8:rightv.ntv4_orange.fr_topo&_return_fields%2b=topology,sources"
Showing results for 
Search instead for 
Did you mean: 

Recommended for You