@@ -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
@@ -6764,6 +6790,18 @@ def set_up_ingress_web_app_routing(self, mc: ManagedCluster) -> ManagedCluster:
67646790
67656791 return mc
67666792
6793+ def set_up_ai_toolchain_operator (self , mc : ManagedCluster ) -> ManagedCluster :
6794+ self ._ensure_mc (mc )
6795+
6796+ if self .context .get_ai_toolchain_operator (enable_validation = True ):
6797+ if mc .ai_toolchain_operator_profile is None :
6798+ mc .ai_toolchain_operator_profile = self .models .ManagedClusterAIToolchainOperatorProfile () # pylint: disable=no-member
6799+ # set enabled
6800+ mc .ai_toolchain_operator_profile .enabled = True
6801+
6802+ # Default is disabled so no need to worry about that here
6803+ return mc
6804+
67676805 def set_up_cost_analysis (self , mc : ManagedCluster ) -> ManagedCluster :
67686806 self ._ensure_mc (mc )
67696807
@@ -6919,6 +6957,8 @@ def construct_mc_profile_default(self, bypass_restore_defaults: bool = False) ->
69196957 mc = self .set_up_metrics_profile (mc )
69206958 # set up node resource group profile
69216959 mc = self .set_up_node_resource_group_profile (mc )
6960+ # set up AI toolchain operator
6961+ mc = self .set_up_ai_toolchain_operator (mc )
69226962 # set up bootstrap profile
69236963 mc = self .set_up_bootstrap_profile (mc )
69246964 # set up static egress gateway profile
@@ -8701,6 +8741,23 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
87018741
87028742 return mc
87038743
8744+ def update_ai_toolchain_operator (self , mc : ManagedCluster ) -> ManagedCluster :
8745+ """Updates the aiToolchainOperatorProfile field of the managed cluster
8746+ :return: the ManagedCluster object
8747+ """
8748+
8749+ if self .context .get_ai_toolchain_operator (enable_validation = True ):
8750+ if mc .ai_toolchain_operator_profile is None :
8751+ mc .ai_toolchain_operator_profile = self .models .ManagedClusterAIToolchainOperatorProfile () # pylint: disable=no-member
8752+ mc .ai_toolchain_operator_profile .enabled = True
8753+
8754+ if self .context .get_disable_ai_toolchain_operator ():
8755+ if mc .ai_toolchain_operator_profile is None :
8756+ mc .ai_toolchain_operator_profile = self .models .ManagedClusterAIToolchainOperatorProfile () # pylint: disable=no-member
8757+ mc .ai_toolchain_operator_profile .enabled = False
8758+
8759+ return mc
8760+
87048761 def update_cost_analysis (self , mc : ManagedCluster ) -> ManagedCluster :
87058762 self ._ensure_mc (mc )
87068763
@@ -8862,6 +8919,8 @@ def update_mc_profile_default(self) -> ManagedCluster:
88628919 mc = self .update_metrics_profile (mc )
88638920 # update node resource group profile
88648921 mc = self .update_node_resource_group_profile (mc )
8922+ # update AI toolchain operator
8923+ mc = self .update_ai_toolchain_operator (mc )
88658924 # update bootstrap profile
88668925 mc = self .update_bootstrap_profile (mc )
88678926 # update static egress gateway
0 commit comments