Skip to content

Commit b307bf4

Browse files
committed
feat(acns): add retinaNetworkFlowLogs to azure cli
1 parent 472853f commit b307bf4

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@
228228
- name: --disable-acns-security
229229
type: bool
230230
short-summary: Used to disable advanced networking security features on a clusters when enabling advanced networking features with "--enable-acns".
231+
- name: --enable-retina-flow-logs
232+
type: bool
233+
short-summary: Enable advanced network flow log collection functionalities on a cluster.
231234
- name: --no-ssh-key -x
232235
type: string
233236
short-summary: Do not use or create a local SSH key.
@@ -1214,6 +1217,12 @@
12141217
- name: --disable-acns-security
12151218
type: bool
12161219
short-summary: Used to disable advanced networking security features on a clusters when enabling advanced networking features with "--enable-acns".
1220+
- name: --enable-retina-flow-logs
1221+
type: bool
1222+
short-summary: Enable advanced network flow log collection functionalities on a cluster.
1223+
- name: --disable-retina-flow-logs
1224+
type: bool
1225+
short-summary: Disable advanced network flow log collection functionalities on a cluster.
12171226
- name: --enable-cost-analysis
12181227
type: bool
12191228
short-summary: Enable exporting Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. For more information see aka.ms/aks/docs/cost-analysis.

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,10 @@ def load_arguments(self, _):
825825
"disable_acns_security",
826826
action="store_true",
827827
)
828+
c.argument(
829+
"enable_retina_flow_logs",
830+
action="store_true",
831+
)
828832
c.argument(
829833
"custom_ca_trust_certificates",
830834
options_list=["--custom-ca-trust-certificates", "--ca-certs"],
@@ -1303,6 +1307,14 @@ def load_arguments(self, _):
13031307
"disable_acns_security",
13041308
action="store_true",
13051309
)
1310+
c.argument(
1311+
"enable_retina_flow_logs",
1312+
action="store_true",
1313+
)
1314+
c.argument(
1315+
"disable_retina_flow_logs",
1316+
action="store_true",
1317+
)
13061318
c.argument("enable_cost_analysis", action="store_true")
13071319
c.argument("disable_cost_analysis", action="store_true")
13081320
c.argument('enable_ai_toolchain_operator', is_preview=True, action='store_true')

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ def aks_create(
493493
enable_acns=None,
494494
disable_acns_observability=None,
495495
disable_acns_security=None,
496+
enable_retina_flow_logs=None,
496497
# nodepool
497498
crg_id=None,
498499
message_of_the_day=None,
@@ -724,6 +725,8 @@ def aks_update(
724725
disable_acns=None,
725726
disable_acns_observability=None,
726727
disable_acns_security=None,
728+
enable_retina_flow_logs=None,
729+
disable_retina_flow_logs=None,
727730
# metrics profile
728731
enable_cost_analysis=False,
729732
disable_cost_analysis=False,

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,24 @@ def get_acns_security(self) -> Union[bool, None]:
762762
return not disable_acns_security
763763
return None
764764

765+
def get_retina_flow_logs(self) -> Union[bool, None]:
766+
"""Get the enablement of retina flow logs
767+
768+
:return: bool or None"""
769+
enable_retina_flow_logs = self.raw_param.get("enable_retina_flow_logs")
770+
disable_retina_flow_logs = self.raw_param.get("disable_retina_flow_logs")
771+
if enable_retina_flow_logs is None and disable_retina_flow_logs is None:
772+
return None
773+
if enable_retina_flow_logs and disable_retina_flow_logs:
774+
raise MutuallyExclusiveArgumentError(
775+
"Cannot specify --enable-retina-flow-logs and "
776+
"--disable-retina-flow-logs at the same time."
777+
)
778+
enable_retina_flow_logs = bool(enable_retina_flow_logs) if enable_retina_flow_logs is not None else False
779+
disable_retina_flow_logs = bool(disable_retina_flow_logs) if disable_retina_flow_logs is not None else False
780+
retina_flow_logs = enable_retina_flow_logs or not disable_retina_flow_logs
781+
return retina_flow_logs
782+
765783
def get_load_balancer_managed_outbound_ip_count(self) -> Union[int, None]:
766784
"""Obtain the value of load_balancer_managed_outbound_ip_count.
767785

0 commit comments

Comments
 (0)