From c23d05059dce9a6b0673e77bd9f7df90abf8f7fb Mon Sep 17 00:00:00 2001 From: Taher Darolywala Date: Sun, 29 Jan 2023 18:21:39 -0600 Subject: [PATCH 1/6] update models to include ip restrictions feat --- .../azext_containerapp/_models.py | 3 +- .../azext_containerapp/_sdk_models.py | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/containerapp/azext_containerapp/_models.py b/src/containerapp/azext_containerapp/_models.py index 15c685b33b7..f58ef42305d 100644 --- a/src/containerapp/azext_containerapp/_models.py +++ b/src/containerapp/azext_containerapp/_models.py @@ -152,7 +152,8 @@ "transport": None, # 'auto', 'http', 'http2', 'tcp' "exposedPort": None, "traffic": None, # TrafficWeight - "customDomains": None # [CustomDomain] + "customDomains": None, # [CustomDomain] + "ipSecurityRestrictions": None # [IPSecurityRestrictions] } RegistryCredentials = { diff --git a/src/containerapp/azext_containerapp/_sdk_models.py b/src/containerapp/azext_containerapp/_sdk_models.py index dd93bfce7c2..cab96da4c1d 100644 --- a/src/containerapp/azext_containerapp/_sdk_models.py +++ b/src/containerapp/azext_containerapp/_sdk_models.py @@ -1315,6 +1315,34 @@ def __init__(self, **kwargs): self.certificate_id = kwargs.get('certificate_id', None) +class IPSecurityRestrictions(Model): + """Custom Domain of a Container App. + + :param name: Hostname. + :type name: str + :param binding_type: Custom Domain binding type. Possible values include: + 'Disabled', 'SniEnabled' + :type binding_type: str or ~commondefinitions.models.BindingType + :param certificate_id: Resource Id of the Certificate to be bound to this + hostname. Must exist in the Managed Environment. + :type certificate_id: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ipAddressRange': {'key': 'ipAddressRange', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IPSecurityRestrictions, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.ipAddressRange = kwargs.get('ipAddressRange', None) + self.action = kwargs.get('action', None) + self.description = kwargs.get('description', None) + + class CustomHostnameAnalysisResult(ProxyResource): """Custom domain analysis. @@ -2071,6 +2099,7 @@ class Ingress(Model): 'traffic': {'key': 'traffic', 'type': '[TrafficWeight]'}, 'custom_domains': {'key': 'customDomains', 'type': '[CustomDomain]'}, 'allow_insecure': {'key': 'allowInsecure', 'type': 'bool'}, + 'ipSecurityRestrictions': {'key': 'ipSecurityRestrictions', 'type': '[IPSecurityRestrictions]'}, } def __init__(self, **kwargs): @@ -2082,6 +2111,7 @@ def __init__(self, **kwargs): self.traffic = kwargs.get('traffic', None) self.custom_domains = kwargs.get('custom_domains', None) self.allow_insecure = kwargs.get('allow_insecure', None) + self.ipSecurityRestrictions = kwargs.get('ipSecurityRestrictions', None) class LegacyMicrosoftAccount(Model): From 84a570014196f455315f746c912e567dfce4b839 Mon Sep 17 00:00:00 2001 From: Taher Darolywala Date: Sun, 29 Jan 2023 18:29:15 -0600 Subject: [PATCH 2/6] update descriptions --- .../azext_containerapp/_sdk_models.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/containerapp/azext_containerapp/_sdk_models.py b/src/containerapp/azext_containerapp/_sdk_models.py index cab96da4c1d..5a37854a966 100644 --- a/src/containerapp/azext_containerapp/_sdk_models.py +++ b/src/containerapp/azext_containerapp/_sdk_models.py @@ -1316,16 +1316,17 @@ def __init__(self, **kwargs): class IPSecurityRestrictions(Model): - """Custom Domain of a Container App. + """IP Restrictions of a Container App. - :param name: Hostname. + :param name: ipAddressRange :type name: str - :param binding_type: Custom Domain binding type. Possible values include: - 'Disabled', 'SniEnabled' - :type binding_type: str or ~commondefinitions.models.BindingType - :param certificate_id: Resource Id of the Certificate to be bound to this - hostname. Must exist in the Managed Environment. - :type certificate_id: str + :param name: action + :type name: str + :param name: name + :type name: str + :param name: description + :type name: str + """ _attribute_map = { From aeb005d4eeee785e867d862645a0db0415eff14c Mon Sep 17 00:00:00 2001 From: Taher Darolywala Date: Sun, 29 Jan 2023 19:25:25 -0600 Subject: [PATCH 3/6] add space --- src/containerapp/azext_containerapp/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containerapp/azext_containerapp/_models.py b/src/containerapp/azext_containerapp/_models.py index f58ef42305d..9dbfbaa09c3 100644 --- a/src/containerapp/azext_containerapp/_models.py +++ b/src/containerapp/azext_containerapp/_models.py @@ -153,7 +153,7 @@ "exposedPort": None, "traffic": None, # TrafficWeight "customDomains": None, # [CustomDomain] - "ipSecurityRestrictions": None # [IPSecurityRestrictions] + "ipSecurityRestrictions": None # [IPSecurityRestrictions] } RegistryCredentials = { From 34252b38323437995458241652d52539897215cc Mon Sep 17 00:00:00 2001 From: Taher Darolywala Date: Tue, 31 Jan 2023 12:03:52 -0600 Subject: [PATCH 4/6] increment version and changelog --- src/containerapp/HISTORY.rst | 4 ++++ src/containerapp/setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/containerapp/HISTORY.rst b/src/containerapp/HISTORY.rst index 0ce871a675d..2ea3e129270 100644 --- a/src/containerapp/HISTORY.rst +++ b/src/containerapp/HISTORY.rst @@ -2,6 +2,10 @@ Release History =============== +0.3.21 +++++++ +* Fix the empty IP Restrictions object caused running `az containerapp update` command on Windows with a pre existing .yaml file + 0.3.21 ++++++ * Fix the PermissionError caused for the Temporary files while running `az containerapp up` command on Windows diff --git a/src/containerapp/setup.py b/src/containerapp/setup.py index 9f25d5e6bd4..96a31426d53 100644 --- a/src/containerapp/setup.py +++ b/src/containerapp/setup.py @@ -17,7 +17,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.3.20' +VERSION = '0.3.22' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 450624b6889d0197050da6e7e8a055808903ae60 Mon Sep 17 00:00:00 2001 From: Taher Darolywala Date: Tue, 31 Jan 2023 13:45:10 -0600 Subject: [PATCH 5/6] update history bug --- src/containerapp/HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containerapp/HISTORY.rst b/src/containerapp/HISTORY.rst index 2ea3e129270..6795fb2b3d7 100644 --- a/src/containerapp/HISTORY.rst +++ b/src/containerapp/HISTORY.rst @@ -2,7 +2,7 @@ Release History =============== -0.3.21 +0.3.22 ++++++ * Fix the empty IP Restrictions object caused running `az containerapp update` command on Windows with a pre existing .yaml file From 989ed12ee0d408576d6b9b125b5f55f539063d6f Mon Sep 17 00:00:00 2001 From: Taher Darolywala Date: Tue, 31 Jan 2023 22:17:15 -0600 Subject: [PATCH 6/6] change versions decrement --- src/containerapp/HISTORY.rst | 5 +---- src/containerapp/setup.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/containerapp/HISTORY.rst b/src/containerapp/HISTORY.rst index 6795fb2b3d7..68227e988fa 100644 --- a/src/containerapp/HISTORY.rst +++ b/src/containerapp/HISTORY.rst @@ -2,13 +2,10 @@ Release History =============== -0.3.22 -++++++ -* Fix the empty IP Restrictions object caused running `az containerapp update` command on Windows with a pre existing .yaml file - 0.3.21 ++++++ * Fix the PermissionError caused for the Temporary files while running `az containerapp up` command on Windows +* Fix the empty IP Restrictions object caused running `az containerapp update` command on Windows with a pre existing .yaml file 0.3.20 ++++++ diff --git a/src/containerapp/setup.py b/src/containerapp/setup.py index 96a31426d53..16a134707b4 100644 --- a/src/containerapp/setup.py +++ b/src/containerapp/setup.py @@ -17,7 +17,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.3.22' +VERSION = '0.3.21' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers