- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
[HELP] [URGENT] API operations using _return_fields
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 02:59 AM - edited 07-28-2020 07:06 AM
Hello,
I have the curl command following
curl -s -k -u "adminasswd!" -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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 05:09 AM
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"