- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
WAPI Conundrum - Multiple EAs and Inheritance
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2019 08:35 AM
Greetings Community -
I've been working on my own WAPI script in Bash, and I've been successful in updating multiple seperate EA's in one request with my own values. However, when I want the values to be inherited from the network above it I am at a loss.
#!/bin/bash curl -k1 -u "userID":"password" -H "Content-Type: application/json" -X POST https://192.168.1.3/wapi/v2.9.1/record:host -d '{''"ipv4addrs"':[{'"use_for_ea_inheritance"': true,'"ipv4addr"':'"func:nextavailableip"':'"192.168.200.0/24"','"configure_for_dhcp"':false}], '"Application"':{'"value"':'"Test"'}, '"inheritance_source"':'"network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yMDAuMC8yNC8w:192.168.200.0/24/default"', '"inheritance_operation"':"INHERIT", '"Contact"':{"value":"Test@test.com"}, '"inheritance_source"':'"network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yMDAuMC8yNC8w:192.168.200.0/24/default"', '"inheritance_operation"':'"INHERIT"', '"Device Type"':{'"value"':'"Virtual"'}, '"inheritance_source"':'"network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yMDAuMC8yNC8w:192.168.200.0/24/default"', '"inheritance_operation"':'"INHERIT"', '"Environment"':{'"value"':'"Production"'}, '"inheritance_source"':'"network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yMDAuMC8yNC8w:192.168.200.0/24/default"', '"inheritance_operation"':'"INHERIT"', '"Location"':{'"value"':'"CDC"'}, '"inheritance_source"':'"network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yMDAuMC8yNC8w:192.168.200.0/24/default"', '"inheritance_operation"':'"INHERIT"', '"Owner"':{'"value"':'"test@test.com"'}, '"inheritance_source"':'"network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yMDAuMC8yNC8w:192.168.200.0/24/default"', '"inheritance_operation"':'"INHERIT"', '"Ticket"':{'"value":"1234"'}, '"name"':'"illithid.domain.com"', '"configure_for_dns"':true'}'
Whenever I add these inheritance options I start running into errors with the JSON; anyone got any reccomendations to make this smoother?
I've considered a workaround where I utilize the CSV import function to force inheritance after the fact, or use the CSV import for the entirety by building a CSV file for each set of changes and pushing it to the WAPI to run. That feels a bit like surrender though; I'd really rather figure this out.
Thanks,
Nick