@@ -612,6 +612,11 @@ def _interface_create(self, body: Dict[str, Any]) -> NetworkInterface:
612612 return i
613613
614614
615+ class MigrationType :
616+ COLD = "cold"
617+ WARM = "warm"
618+
619+
615620class Instance (Base ):
616621 """
617622 A Linode Instance.
@@ -948,7 +953,13 @@ def reboot(self):
948953 return False
949954 return True
950955
951- def resize (self , new_type , allow_auto_disk_resize = True , ** kwargs ):
956+ def resize (
957+ self ,
958+ new_type ,
959+ allow_auto_disk_resize = True ,
960+ migration_type : MigrationType = MigrationType .COLD ,
961+ ** kwargs ,
962+ ):
952963 """
953964 Resizes a Linode you have the read_write permission to a different Type. If any
954965 actions are currently running or queued, those actions must be completed first
@@ -970,6 +981,10 @@ def resize(self, new_type, allow_auto_disk_resize=True, **kwargs):
970981 data must fit within the smaller disk size. Defaults to true.
971982 :type: allow_auto_disk_resize: bool
972983
984+ :param migration_type: Type of migration to be used when resizing a Linode.
985+ Customers can choose between warm and cold, the default type is cold.
986+ :type: migration_type: str
987+
973988 :returns: True if the operation was successful.
974989 :rtype: bool
975990 """
@@ -979,6 +994,7 @@ def resize(self, new_type, allow_auto_disk_resize=True, **kwargs):
979994 params = {
980995 "type" : new_type ,
981996 "allow_auto_disk_resize" : allow_auto_disk_resize ,
997+ "migration_type" : migration_type ,
982998 }
983999 params .update (kwargs )
9841000
@@ -1438,7 +1454,12 @@ def mutate(self, allow_auto_disk_resize=True):
14381454
14391455 return True
14401456
1441- def initiate_migration (self , region = None , upgrade = None ):
1457+ def initiate_migration (
1458+ self ,
1459+ region = None ,
1460+ upgrade = None ,
1461+ migration_type : MigrationType = MigrationType .COLD ,
1462+ ):
14421463 """
14431464 Initiates a pending migration that is already scheduled for this Linode
14441465 Instance
@@ -1459,10 +1480,16 @@ def initiate_migration(self, region=None, upgrade=None):
14591480 region field does not allow upgrades, then the endpoint will return a 400 error
14601481 code and the migration will not be performed.
14611482 :type: upgrade: bool
1483+
1484+ :param migration_type: The type of migration that will be used for this Linode migration.
1485+ Customers can only use this param when activating a support-created migration.
1486+ Customers can choose between a cold and warm migration, cold is the default type.
1487+ :type: mirgation_type: str
14621488 """
14631489 params = {
14641490 "region" : region .id if issubclass (type (region ), Base ) else region ,
14651491 "upgrade" : upgrade ,
1492+ "type" : migration_type ,
14661493 }
14671494
14681495 util .drop_null_keys (params )
0 commit comments