infoblox:api
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| infoblox:api [2025/08/24 17:21] – [Network] bstafford | infoblox:api [2026/03/07 00:25] (current) – bstafford | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== BloxOne API ====== | ====== BloxOne API ====== | ||
| ([[infoblox: | ([[infoblox: | ||
| + | |||
| + | |||
| + | REMEMBER, in Linux you can pipe output into " | ||
| ===== Swagger ===== | ===== Swagger ===== | ||
| Line 6: | Line 9: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | ===== Convert JSON ===== | ||
| + | The " | ||
| + | |||
| + | Page on transforming JSON with jq [[www.digitalocean.com/ | ||
| ===== Quick CURL===== | ===== Quick CURL===== | ||
| < | < | ||
| ===== Simple CURL ===== | ===== Simple CURL ===== | ||
| + | ==== Quick Sample ===== | ||
| + | < | ||
| + | BASE_URL=" | ||
| + | API_TOKEN=" | ||
| + | curl -s -X GET \ | ||
| + | -H " | ||
| + | -H " | ||
| + | " | ||
| + | CONTENT_TYPE=" | ||
| + | AUTHORIZATION=" | ||
| + | Then you can just run | ||
| + | < | ||
| + | " | ||
| + | |||
| + | What you can do is insert the following lines into .bashrc to have them auto populate when you log in. Be careful about this as it exposes your API key. Nice in a lab but risky in production. | ||
| + | < | ||
| + | BASE_URL=" | ||
| + | API_TOKEN=" | ||
| + | |||
| + | |||
| + | or even | ||
| + | < | ||
| + | curl -s -X GET -H " | ||
| ==== External Networks ==== | ==== External Networks ==== | ||
| API documentation [[https:// | API documentation [[https:// | ||
| Line 255: | Line 286: | ||
| sys.exit(1)</ | sys.exit(1)</ | ||
| ===== Reference ===== | ===== Reference ===== | ||
| + | API Docs [[https:// | ||
| + | |||
| + | ===== Subnet Filter ===== | ||
| + | |||
| + | |||
| + | < | ||
| + | --header ' | ||
| + | --header ' | ||
| + | | jq -r ' | ||
| + | |||
| + | This command will find all subnets that have the tag " | ||
| + | |||
| + | You can then use the jq command to filter the subnet address value and the subnet CIDR value and display in format address/ | ||
| + | ==== AWS IPAM ==== | ||
| + | To get the Infoblox ID needed by AWS IPAM for management: | ||
| + | < | ||
| + | ==== Get Internal Domain List ==== | ||
| + | The following gets the full list of Internal Domain lists (Security) as well as their contents. You can use this to get the ID of each list. | ||
| + | < | ||
| + | |||
| + | The code below is for when you want to filter the query to show just the contents of a specific list (in this case, the ID is 1234) | ||
| + | < | ||
| + | |||
| ==== Get Data of Threat Feed ==== | ==== Get Data of Threat Feed ==== | ||
| < | < | ||
| Line 308: | Line 362: | ||
| CURL version | CURL version | ||
| < | < | ||
| + | ===== NIOS-X Host Monitoring ===== | ||
| + | This is JSON to use in Postman Test to filter results of monitoring NIOS-X service | ||
| + | [[https:// | ||
| + | < | ||
| + | [[https:// | ||
| + | < | ||
| + | < | ||
| + | let jsonData = pm.response.json(); | ||
| + | |||
| + | let jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | let gb = objValue / (1024 ** 3); | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | let gb = objValue / (1024 ** 3); | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | |||
| + | |||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | let answer = objValue * 1; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | |||
| + | |||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | let answer = objValue * 1; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | |||
| + | |||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | |||
| + | |||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | console.log(" | ||
| + | } | ||
| + | |||
| + | |||
| + | jsonObject = jsonData.find(item => item.name === " | ||
| + | if (jsonObject && jsonObject.metrics.length > 0) { | ||
| + | let objValue = jsonObject.metrics[0].value; | ||
| + | let answer = objValue * 1; | ||
| + | console.log(" | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Printing state is much easier | ||
| + | < | ||
| + | let jsonData = pm.response.json(); | ||
| + | |||
| + | jsonData.forEach(item => { | ||
| + | console.log(" | ||
| + | });</ | ||
| ====== NIOS ====== | ====== NIOS ====== | ||
| Calls to create network objects are blocking, within a network space. Essentially single threaded. If there are enough calls queued up, waiting for service, those calls will hit a timeout within the product. | Calls to create network objects are blocking, within a network space. Essentially single threaded. If there are enough calls queued up, waiting for service, those calls will hit a timeout within the product. | ||
| Line 327: | Line 514: | ||
| More specific searches are always going to be better than broad searches. | More specific searches are always going to be better than broad searches. | ||
| + | |||
| + | ===== GetGridData ===== | ||
| + | How to download a Grid backup via API | ||
| + | * BACKUP | ||
| + | * BACKUP_DTC | ||
| + | * NTP_KEY_FILE | ||
| + | * SNMP_MIBS_FILE | ||
| + | * HF_MANIFEST_FILE | ||
| + | |||
| + | Get download URL and token | ||
| + | < | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | < | ||
| + | |||
| ===== GetMemberData ===== | ===== GetMemberData ===== | ||
| Line 703: | Line 907: | ||
| For very large results, you may need to add ''& | For very large results, you may need to add ''& | ||
| The return object will contain a next_page_id field, which you call in the following call with the same query but adding ''& | The return object will contain a next_page_id field, which you call in the following call with the same query but adding ''& | ||
| + | ===== NIOS Perl API ===== | ||
| + | The Perl API (PAPI) has been officially deprecated since NIOS version 8.4. | ||
| + | |||
| + | Starting from NIOS version 9.0.6, Perl module access is disabled by default. | ||
| + | |||
| + | All future enhancements and fixes are now provided through the RESTful API (WAPI). | ||
| + | |||
| + | To enable PAPI, the following CLI command must be executed: < | ||
| + | |||
| + | When you enable or disable the perl_mod_access, | ||
infoblox/api.1756056112.txt.gz · Last modified: by bstafford
