@@ -15,7 +15,7 @@ def __init__(
15
15
self , client , label , instance_settings_template_id , virtual_network_id , image_id
16
16
):
17
17
"""
18
- Helper to create a DSS Instance
18
+ Helper to create a DSS instance.
19
19
20
20
:param client: The FM client
21
21
:type client: :class:`dataikuapi.fm.fmclient`
@@ -36,16 +36,17 @@ def __init__(
36
36
37
37
def with_dss_node_type (self , dss_node_type ):
38
38
"""
39
- Set the DSS Node type of the instance to create
39
+ Set the DSS node type of the instance to create. The default node type is `DESIGN`.
40
40
41
- :param str dss_node_type: Optional , the type of the dss node to create. Supports "design", "automation" or "deployer". Defaults to "design"
41
+ :param dss_node_type: the type of the dss node to create.
42
+ :type dss_node_type: :class:`dataikuapi.fm.instances.FMNodeType`
42
43
:rtype: :class:`dataikuapi.fm.instances.FMInstanceCreator`
43
44
"""
44
- if dss_node_type not in [ "design" , "automation" , "deployer" ]:
45
- raise ValueError (
46
- 'Only "design", "automation" or "deployer" dss_node_type are supported'
47
- )
48
- self .data ["dssNodeType" ] = dss_node_type
45
+ # backward compatibility, was a string before . be sure the value falls into the enum
46
+ value = dss_node_type ;
47
+ if isinstance ( dss_node_type , str ):
48
+ value = FMNodeType [ dss_node_type . upper ()]
49
+ self .data ["dssNodeType" ] = value . value
49
50
return self
50
51
51
52
def with_cloud_instance_type (self , cloud_instance_type ):
@@ -399,6 +400,11 @@ def set_public_ip(self, enable, public_ip_id):
399
400
self .instance_data ["gcpPublicIPId" ] = public_ip_id
400
401
return self
401
402
403
+ class FMNodeType (Enum ):
404
+ DESIGN = "design"
405
+ DEPLOYER = "deployer"
406
+ AUTOMATION = "automation"
407
+ GOVERN = "govern"
402
408
403
409
class FMInstanceEncryptionMode (Enum ):
404
410
NONE = "NONE"
0 commit comments