Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. def update_perm_dcgw(router):
  2.   hydra = instantiate_hydra()
  3.   router_name = hydra.api_post("ci/search" , data={"hostname" : router}) ########################
  4.   router_id = router_name[0]["id"]
  5.   ci_lifs = hydra.api_get("ci/" + str(router_id) , params={"expand" : "logical_interfaces.ips"})
  6.   for lif in ci_lifs[0]["logical_interfaces"]:
  7.     if lif["ips"]:
  8.       for network in lif["ips"]:
  9.         test = hydra.api_post("relation/network/consumer", data={"team_id" : 1865, "network_id" : network["network_id"]})
  10.  
  11.  
  12.  
  13.  
  14. logging.getLogger().setLevel(logging.ERROR)
  15. update_perm_dcgw("serointrt12101")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement