Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Add support to modify gateway_backing_config #695

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pyvcloud/vcd/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')

Expand All @@ -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)
Expand Down