Closed ad1rie1 closed 5 years ago
Hi, There are seveeral ways to update (i.e. enable) the internal VPN endpoint on an interface. You can iterate:
engine = Engine('ospfengine')
for internal_endpoint in engine.vpn.internal_endpoint:
print(internal_endpoint)
internal_endpoint.update(enabled=True)
Or optionally fetch the interface directly. The naming of an internal endpoint is the same as what you would see in the SMC:
Then to operate on the internal endpoint of '1.1.1.1':
engine = Engine('ospfengine')
my_interface = engine.vpn.internal_endpoint.get_exact('1.1.1.1')
print(my_interface)
my_interface.update(enabled=True)
If you want to operate on multiple attributes of the internal endpoint, set them in the update command:
engine = Engine('ospfengine')
my_interface = engine.vpn.internal_endpoint.get_exact('1.1.1.1')
pprint(vars(my_interface.data))
my_interface.update(enabled=True,ipsec_vpn=True,force_nat_t=True,ssl_vpn_portal=False,ssl_vpn_tunnel=False)
Thank you it's working like charm :) it can be good to update the documentation with this ;)
Done. Thanks for the feedback!
Hello, I want to edit the Internal endpoint of an engine but engine.update() do nothing...
i have try to use InternalEndpoint.update() but it do nothing too .
I want to modify the name of internat endpoint but nothing in the doc to do that, do you know how to do that ?
Sample code : engine = Engine('NAME FIREWALL') for ie in engine.vpn.internal_endpoint:
print(ie)
In the documentation it say : If I want to enable VPN on interface 0, you can obtain the right endpoint and enable: