@@ -5397,6 +5397,32 @@ def get_upgrade_override_until(self) -> Union[str, None]:
53975397 # this parameter does not need validation
53985398 return self .raw_param .get ("upgrade_override_until" )
53995399
5400+ def get_ai_toolchain_operator (self , enable_validation : bool = False ) -> bool :
5401+ """Internal function to obtain the value of enable_ai_toolchain_operator.
5402+ When enabled, if both enable_ai_toolchain_operator and
5403+ disable_ai_toolchain_operator are specified, raise
5404+ a MutuallyExclusiveArgumentError.
5405+ :return: bool
5406+ """
5407+ enable_ai_toolchain_operator = self .raw_param .get ("enable_ai_toolchain_operator" )
5408+ # This parameter does not need dynamic completion.
5409+ if enable_validation :
5410+ if enable_ai_toolchain_operator and self .get_disable_ai_toolchain_operator ():
5411+ raise MutuallyExclusiveArgumentError (
5412+ "Cannot specify --enable-ai-toolchain-operator and "
5413+ "--disable-ai-toolchain-operator at the same time. "
5414+ )
5415+
5416+ return enable_ai_toolchain_operator
5417+
5418+ def get_disable_ai_toolchain_operator (self ) -> bool :
5419+ """Obtain the value of disable_ai_toolchain_operator.
5420+ :return: bool
5421+ """
5422+ # Note: No need to check for mutually exclusive parameter with enable-ai-toolchain-operator here
5423+ # because it's already checked in get_ai_toolchain_operator
5424+ return self .raw_param .get ("disable_ai_toolchain_operator" )
5425+
54005426 def _get_enable_cost_analysis (self , enable_validation : bool = False ) -> bool :
54015427 """Internal function to obtain the value of enable_cost_analysis.
54025428 When enabled, if both enable_cost_analysis and disable_cost_analysis are
@@ -6718,6 +6744,18 @@ def set_up_ingress_web_app_routing(self, mc: ManagedCluster) -> ManagedCluster:
67186744
67196745 return mc
67206746
6747+ def set_up_ai_toolchain_operator (self , mc : ManagedCluster ) -> ManagedCluster :
6748+ self ._ensure_mc (mc )
6749+
6750+ if self .context .get_ai_toolchain_operator (enable_validation = True ):
6751+ if mc .ai_toolchain_operator_profile is None :
6752+ mc .ai_toolchain_operator_profile = self .models .ManagedClusterAIToolchainOperatorProfile () # pylint: disable=no-member
6753+ # set enabled
6754+ mc .ai_toolchain_operator_profile .enabled = True
6755+
6756+ # Default is disabled so no need to worry about that here
6757+ return mc
6758+
67216759 def set_up_cost_analysis (self , mc : ManagedCluster ) -> ManagedCluster :
67226760 self ._ensure_mc (mc )
67236761
@@ -6854,6 +6892,8 @@ def construct_mc_profile_default(self, bypass_restore_defaults: bool = False) ->
68546892 mc = self .set_up_metrics_profile (mc )
68556893 # set up node resource group profile
68566894 mc = self .set_up_node_resource_group_profile (mc )
6895+ # set up AI toolchain operator
6896+ mc = self .set_up_ai_toolchain_operator (mc )
68576897 # set up bootstrap profile
68586898 mc = self .set_up_bootstrap_profile (mc )
68596899
@@ -8631,6 +8671,23 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
86318671
86328672 return mc
86338673
8674+ def update_ai_toolchain_operator (self , mc : ManagedCluster ) -> ManagedCluster :
8675+ """Updates the aiToolchainOperatorProfile field of the managed cluster
8676+ :return: the ManagedCluster object
8677+ """
8678+
8679+ if self .context .get_ai_toolchain_operator (enable_validation = True ):
8680+ if mc .ai_toolchain_operator_profile is None :
8681+ mc .ai_toolchain_operator_profile = self .models .ManagedClusterAIToolchainOperatorProfile () # pylint: disable=no-member
8682+ mc .ai_toolchain_operator_profile .enabled = True
8683+
8684+ if self .context .get_disable_ai_toolchain_operator ():
8685+ if mc .ai_toolchain_operator_profile is None :
8686+ mc .ai_toolchain_operator_profile = self .models .ManagedClusterAIToolchainOperatorProfile () # pylint: disable=no-member
8687+ mc .ai_toolchain_operator_profile .enabled = False
8688+
8689+ return mc
8690+
86348691 def update_cost_analysis (self , mc : ManagedCluster ) -> ManagedCluster :
86358692 self ._ensure_mc (mc )
86368693
@@ -8763,6 +8820,8 @@ def update_mc_profile_default(self) -> ManagedCluster:
87638820 mc = self .update_metrics_profile (mc )
87648821 # update node resource group profile
87658822 mc = self .update_node_resource_group_profile (mc )
8823+ # update AI toolchain operator
8824+ mc = self .update_ai_toolchain_operator (mc )
87668825 # update bootstrap profile
87678826 mc = self .update_bootstrap_profile (mc )
87688827 # update kubernetes version and orchestrator version
0 commit comments