Reply

WAPI Conundrum - Multiple EAs and Inheritance

New Member
Posts: 1
3050     0

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

Showing results for 
Search instead for 
Did you mean: 

Recommended for You

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