From 07eb5d75003b1f899bb13afd6273efbbca830824 Mon Sep 17 00:00:00 2001 From: azzamsa Date: Fri, 24 Jul 2020 13:44:10 +0700 Subject: [PATCH] Add support to modify `gateway_backing_config` --- pyvcloud/vcd/gateway.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyvcloud/vcd/gateway.py b/pyvcloud/vcd/gateway.py index cc659f66d..b3a98150d 100644 --- a/pyvcloud/vcd/gateway.py +++ b/pyvcloud/vcd/gateway.py @@ -369,7 +369,7 @@ def remove_external_network(self, network_name): self.resource, RelationType.GATEWAY_UPDATE_PROPERTIES, EntityType.EDGE_GATEWAY.value, gateway) - def edit_gateway(self, newname=None, desc=None, ha=None): + def edit_gateway(self, newname=None, desc=None, ha=None, gateway_backing_config=None): """It changes the old name of the gateway to the new name. :param str newname: new name of the gateway @@ -383,7 +383,7 @@ def edit_gateway(self, newname=None, desc=None, ha=None): :raises: ValueError: if the values are not provided. """ - if newname is None and desc is None and ha is None: + if newname is None and desc is None and ha is None and gateway_backing_config is None: raise ValueError('Invalid input, please provide at least one ' 'parameter') @@ -398,6 +398,11 @@ def edit_gateway(self, newname=None, desc=None, ha=None): if ha: gateway.Configuration.HaEnabled = E.HaEnabled(ha) + if gateway_backing_config: + gateway.Configuration.GatewayBackingConfig = E.GatewayBackingConfig( + gateway_backing_config + ) + return self.client.put_linked_resource( self.resource, RelationType.EDIT, EntityType.EDGE_GATEWAY.value, gateway)