@@ -5412,6 +5412,32 @@ def get_upgrade_override_until(self) -> Union[str, None]:
54125412 # this parameter does not need validation
54135413 return self .raw_param .get ("upgrade_override_until" )
54145414
5415+ def get_ai_toolchain_operator (self , enable_validation : bool = False ) -> bool :
5416+ """Internal function to obtain the value of enable_ai_toolchain_operator.
5417+ When enabled, if both enable_ai_toolchain_operator and
5418+ disable_ai_toolchain_operator are specified, raise
5419+ a MutuallyExclusiveArgumentError.
5420+ :return: bool
5421+ """
5422+ enable_ai_toolchain_operator = self .raw_param .get ("enable_ai_toolchain_operator" )
5423+ # This parameter does not need dynamic completion.
5424+ if enable_validation :
5425+ if enable_ai_toolchain_operator and self .get_disable_ai_toolchain_operator ():
5426+ raise MutuallyExclusiveArgumentError (
5427+ "Cannot specify --enable-ai-toolchain-operator and "
5428+ "--disable-ai-toolchain-operator at the same time. "
5429+ )
5430+
5431+ return enable_ai_toolchain_operator
5432+
5433+ def get_disable_ai_toolchain_operator (self ) -> bool :
5434+ """Obtain the value of disable_ai_toolchain_operator.
5435+ :return: bool
5436+ """
5437+ # Note: No need to check for mutually exclusive parameter with enable-ai-toolchain-operator here
5438+ # because it's already checked in get_ai_toolchain_operator
5439+ return self .raw_param .get ("disable_ai_toolchain_operator" )
5440+
54155441 def _get_enable_cost_analysis (self , enable_validation : bool = False ) -> bool :
54165442 """Internal function to obtain the value of enable_cost_analysis.
54175443 When enabled, if both enable_cost_analysis and disable_cost_analysis are
@@ -6733,6 +6759,18 @@ def set_up_ingress_web_app_routing(self, mc: ManagedCluster) -> ManagedCluster:
67336759
67346760 return mc
67356761
6762+ def set_up_ai_toolchain_operator (self , mc : ManagedCluster ) -> ManagedCluster :
6763+ self ._ensure_mc (mc )
6764+
6765+ if self .context .get_ai_toolchain_operator (enable_validation = True ):
6766+ if mc .ai_toolchain_operator_profile is None :
6767+ mc .ai_toolchain_operator_profile = self .models .ManagedClusterAIToolchainOperatorProfile () # pylint: disable=no-member
6768+ # set enabled
6769+ mc .ai_toolchain_operator_profile .enabled = True
6770+
6771+ # Default is disabled so no need to worry about that here
6772+ return mc
6773+
67366774 def set_up_cost_analysis (self , mc : ManagedCluster ) -> ManagedCluster :
67376775 self ._ensure_mc (mc )
67386776
@@ -6869,6 +6907,8 @@ def construct_mc_profile_default(self, bypass_restore_defaults: bool = False) ->
68696907 mc = self .set_up_metrics_profile (mc )
68706908 # set up node resource group profile
68716909 mc = self .set_up_node_resource_group_profile (mc )
6910+ # set up AI toolchain operator
6911+ mc = self .set_up_ai_toolchain_operator (mc )
68726912 # set up bootstrap profile
68736913 mc = self .set_up_bootstrap_profile (mc )
68746914
@@ -8649,6 +8689,23 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
86498689
86508690 return mc
86518691
8692+ def update_ai_toolchain_operator (self , mc : ManagedCluster ) -> ManagedCluster :
8693+ """Updates the aiToolchainOperatorProfile field of the managed cluster
8694+ :return: the ManagedCluster object
8695+ """
8696+
8697+ if self .context .get_ai_toolchain_operator (enable_validation = True ):
8698+ if mc .ai_toolchain_operator_profile is None :
8699+ mc .ai_toolchain_operator_profile = self .models .ManagedClusterAIToolchainOperatorProfile () # pylint: disable=no-member
8700+ mc .ai_toolchain_operator_profile .enabled = True
8701+
8702+ if self .context .get_disable_ai_toolchain_operator ():
8703+ if mc .ai_toolchain_operator_profile is None :
8704+ mc .ai_toolchain_operator_profile = self .models .ManagedClusterAIToolchainOperatorProfile () # pylint: disable=no-member
8705+ mc .ai_toolchain_operator_profile .enabled = False
8706+
8707+ return mc
8708+
86528709 def update_cost_analysis (self , mc : ManagedCluster ) -> ManagedCluster :
86538710 self ._ensure_mc (mc )
86548711
@@ -8781,6 +8838,8 @@ def update_mc_profile_default(self) -> ManagedCluster:
87818838 mc = self .update_metrics_profile (mc )
87828839 # update node resource group profile
87838840 mc = self .update_node_resource_group_profile (mc )
8841+ # update AI toolchain operator
8842+ mc = self .update_ai_toolchain_operator (mc )
87848843 # update bootstrap profile
87858844 mc = self .update_bootstrap_profile (mc )
87868845 # update kubernetes version and orchestrator version
0 commit comments