@@ -69,7 +69,7 @@ def __init__( # pylint: disable=too-many-locals
6969 code_configuration : Optional [Dict [str , Any ]] = None ,
7070 environment_variables : Optional [Dict [str , str ]] = None ,
7171 app_insights_enabled : Optional [bool ] = None ,
72- allowed_instance_type : Optional [str ] = None ,
72+ allowed_instance_types : Optional [str ] = None ,
7373 default_instance_type : Optional [str ] = None , # Handle default instance type
7474 scoring_port : Optional [int ] = None ,
7575 scoring_path : Optional [str ] = None ,
@@ -99,7 +99,7 @@ def __init__( # pylint: disable=too-many-locals
9999 self .code_configuration = code_configuration
100100 self .environment_variables = environment_variables
101101 self .app_insights_enabled = app_insights_enabled
102- self .allowed_instance_type = allowed_instance_type
102+ self .allowed_instance_types = allowed_instance_types
103103 self .default_instance_type = default_instance_type
104104 self .scoring_port = scoring_port
105105 self .scoring_path = scoring_path
@@ -362,7 +362,9 @@ def get_value(source, key, default=None):
362362 )
363363
364364 # Extract additional fields
365- allowed_instance_type = get_value (properties , "allowedInstanceType" ) or get_value (obj , "allowed_instance_type" )
365+ allowed_instance_types = get_value (properties , "allowedInstanceTypes" ) or get_value (
366+ obj , "allowed_instance_types"
367+ )
366368 scoring_port = get_value (properties , "scoringPort" ) or get_value (obj , "scoring_port" )
367369 scoring_path = get_value (properties , "scoringPath" ) or get_value (obj , "scoring_path" )
368370 model_mount_path = get_value (properties , "modelMountPath" ) or get_value (obj , "model_mount_path" )
@@ -387,12 +389,12 @@ def get_value(source, key, default=None):
387389 except (ValueError , SyntaxError ):
388390 environment_variables = {}
389391
390- # Parse allowed_instance_type if it's a string
391- if isinstance (allowed_instance_type , str ):
392+ # Parse allowed_instance_types if it's a string
393+ if isinstance (allowed_instance_types , str ):
392394 try :
393- allowed_instance_type = ast .literal_eval (allowed_instance_type )
395+ allowed_instance_types = ast .literal_eval (allowed_instance_types )
394396 except (ValueError , SyntaxError ):
395- allowed_instance_type = None
397+ allowed_instance_types = None
396398
397399 # Convert request_settings to OnlineRequestSettings object using the built-in conversion method
398400 request_settings_obj = OnlineRequestSettings ._from_rest_object (request_settings ) if request_settings else None
@@ -434,7 +436,7 @@ def get_value(source, key, default=None):
434436 environment_variables = environment_variables ,
435437 app_insights_enabled = get_value (obj , "app_insights_enabled" ), # May not be present in this API format
436438 deployment_template_type = deployment_template_type , # Include deployment template type
437- allowed_instance_type = allowed_instance_type , # Include allowed instance types
439+ allowed_instance_types = allowed_instance_types , # Include allowed instance types
438440 scoring_port = scoring_port , # Include scoring port
439441 scoring_path = scoring_path , # Include scoring path
440442 model_mount_path = model_mount_path , # Include model mount path
@@ -466,7 +468,7 @@ def get_value(source, key, default=None):
466468 "code_configuration" : get_value (obj , "code_configuration" ),
467469 "app_insights_enabled" : get_value (obj , "app_insights_enabled" ),
468470 "deployment_template_type" : deployment_template_type ,
469- "allowed_instance_type " : allowed_instance_type ,
471+ "allowed_instance_types " : allowed_instance_types ,
470472 "scoring_port" : scoring_port ,
471473 "scoring_path" : scoring_path ,
472474 "model_mount_path" : model_mount_path ,
@@ -564,15 +566,15 @@ def _to_rest_object(self) -> dict:
564566 result ["appInsightsEnabled" ] = self .app_insights_enabled # type: ignore
565567
566568 # Handle allowed instance types - convert string to array format for API
567- if hasattr (self , "allowed_instance_type " ) and self .allowed_instance_type :
568- if isinstance (self .allowed_instance_type , str ):
569+ if hasattr (self , "allowed_instance_types " ) and self .allowed_instance_types :
570+ if isinstance (self .allowed_instance_types , str ):
569571 # Convert space-separated string to array
570- instance_types_array = self .allowed_instance_type .split ()
571- elif isinstance (self .allowed_instance_type , list ):
572- instance_types_array = self .allowed_instance_type
572+ instance_types_array = self .allowed_instance_types .split ()
573+ elif isinstance (self .allowed_instance_types , list ):
574+ instance_types_array = self .allowed_instance_types
573575 else :
574- instance_types_array = [str (self .allowed_instance_type )]
575- result ["allowedInstanceType " ] = instance_types_array # type: ignore[assignment]
576+ instance_types_array = [str (self .allowed_instance_types )]
577+ result ["allowedInstanceTypes " ] = instance_types_array # type: ignore[assignment]
576578
577579 return result
578580
@@ -637,8 +639,8 @@ def _to_dict(self) -> Dict:
637639 result ["readinessProbe" ] = readiness_dict # type: ignore[assignment]
638640
639641 # Add instance configuration
640- if hasattr (self , "allowed_instance_type " ) and self .allowed_instance_type :
641- result ["allowedInstanceType " ] = self .allowed_instance_type # type: ignore[assignment]
642+ if hasattr (self , "allowed_instance_types " ) and self .allowed_instance_types :
643+ result ["allowedInstanceTypes " ] = self .allowed_instance_types # type: ignore[assignment]
642644 if self .default_instance_type :
643645 result ["defaultInstanceType" ] = self .default_instance_type
644646 elif self .instance_type :
0 commit comments