10
10
from typing import Dict , List , Optional
11
11
12
12
from azure .ai .ml ._restclient .v2022_10_01_preview .models import AssignedUser
13
- from azure .ai .ml ._restclient .v2022_10_01_preview .models import ComputeInstance as CIRest
14
- from azure .ai .ml ._restclient .v2022_10_01_preview .models import ComputeInstanceProperties
15
- from azure .ai .ml ._restclient .v2022_10_01_preview .models import ComputeInstanceSshSettings as CiSShSettings
16
- from azure .ai .ml ._restclient .v2022_10_01_preview .models import (
13
+ from azure .ai .ml ._restclient .v2023_08_01_preview .models import ComputeInstance as CIRest
14
+ from azure .ai .ml ._restclient .v2023_08_01_preview .models import ComputeInstanceProperties
15
+ from azure .ai .ml ._restclient .v2023_08_01_preview .models import ComputeInstanceSshSettings as CiSShSettings
16
+ from azure .ai .ml ._restclient .v2023_08_01_preview .models import (
17
17
ComputeResource ,
18
18
PersonalComputeInstanceSettings ,
19
19
ResourceId ,
@@ -160,6 +160,10 @@ class ComputeInstance(Compute):
160
160
:type setup_scripts: Optional[~azure.ai.ml.entities.SetupScripts]
161
161
:param custom_applications: List of custom applications and their endpoints for the compute instance.
162
162
:type custom_applications: Optional[List[~azure.ai.ml.entities.CustomApplications]]
163
+ :param enable_sso: Enable or disable single sign-on. Defaults to True.
164
+ :type enable_sso: bool
165
+ :param enable_root_access: Enable or disable root access. Defaults to True.
166
+ :type enable_root_access: bool
163
167
164
168
.. admonition:: Example:
165
169
@@ -189,6 +193,8 @@ def __init__(
189
193
setup_scripts : Optional [SetupScripts ] = None ,
190
194
enable_node_public_ip : bool = True ,
191
195
custom_applications : Optional [List [CustomApplications ]] = None ,
196
+ enable_sso : bool = True ,
197
+ enable_root_access : bool = True ,
192
198
** kwargs ,
193
199
) -> None :
194
200
kwargs [TYPE ] = ComputeType .COMPUTEINSTANCE
@@ -215,6 +221,8 @@ def __init__(
215
221
self .idle_time_before_shutdown_minutes = idle_time_before_shutdown_minutes
216
222
self .setup_scripts = setup_scripts
217
223
self .enable_node_public_ip = enable_node_public_ip
224
+ self .enable_sso = enable_sso
225
+ self .enable_root_access = enable_root_access
218
226
self .custom_applications = custom_applications
219
227
self .subnet = None
220
228
@@ -295,6 +303,8 @@ def _to_rest_object(self) -> ComputeResource:
295
303
personal_compute_instance_settings = personal_compute_instance_settings ,
296
304
idle_time_before_shutdown = idle_time_before_shutdown ,
297
305
enable_node_public_ip = self .enable_node_public_ip ,
306
+ enable_sso = self .enable_sso ,
307
+ enable_root_access = self .enable_root_access ,
298
308
)
299
309
compute_instance_prop .schedules = self .schedules ._to_rest_object () if self .schedules else None
300
310
compute_instance_prop .setup_scripts = self .setup_scripts ._to_rest_object () if self .setup_scripts else None
@@ -432,6 +442,12 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "ComputeInstance":
432
442
if (prop .properties and prop .properties .enable_node_public_ip is not None )
433
443
else True ,
434
444
custom_applications = custom_applications ,
445
+ enable_sso = prop .properties .enable_sso
446
+ if (prop .properties and prop .properties .enable_sso is not None )
447
+ else True ,
448
+ enable_root_access = prop .properties .enable_root_access
449
+ if (prop .properties and prop .properties .enable_root_access is not None )
450
+ else True ,
435
451
)
436
452
return response
437
453
0 commit comments