@@ -790,6 +790,31 @@ class UpgradeInterfacesResult(JSONObject):
790790 )
791791
792792
793+ @dataclass
794+ class InstanceAlerts (JSONObject ):
795+ """
796+ Represents both legacy and ACLP alerts for a Linode Instance.
797+ """
798+
799+ cpu : int = 0
800+ io : int = 0
801+ network_in : int = 0
802+ network_out : int = 0
803+ transfer_quota : int = 0
804+ system_alerts : Optional [List [int ]] = None
805+ user_alerts : Optional [List [int ]] = None
806+
807+
808+ @dataclass
809+ class InstanceACLPAlertsOptions (JSONObject ):
810+ """
811+ Represents the ACLP alerts available to define during instance creation and cloning.
812+ """
813+
814+ system_alerts : Optional [List [int ]] = None
815+ user_alerts : Optional [List [int ]] = None
816+
817+
793818@dataclass
794819class InstanceBackupSchedule (JSONObject ):
795820 """
@@ -842,7 +867,7 @@ class Instance(Base):
842867 "created" : Property (is_datetime = True ),
843868 "updated" : Property (volatile = True , is_datetime = True ),
844869 "region" : Property (slug_relationship = Region ),
845- "alerts" : Property (mutable = True ),
870+ "alerts" : Property (mutable = True , json_object = InstanceAlerts ),
846871 "image" : Property (slug_relationship = Image ),
847872 "disks" : Property (derived_class = Disk ),
848873 "configs" : Property (derived_class = Config ),
@@ -1949,6 +1974,9 @@ def clone(
19491974 Dict [str , Any ],
19501975 int ,
19511976 ] = None ,
1977+ alerts : Optional [
1978+ Union [Dict [str , Any ], InstanceACLPAlertsOptions ]
1979+ ] = None ,
19521980 ):
19531981 """
19541982 Clones this linode into a new linode or into a new linode in the given region
@@ -1987,6 +2015,10 @@ def clone(
19872015 :param placement_group: Information about the placement group to create this instance under.
19882016 :type placement_group: Union[InstancePlacementGroupAssignment, PlacementGroup, Dict[str, Any], int]
19892017
2018+ :param alerts: ACLP monitor alert definitions associated with the cloned Instance.
2019+ This is under v4beta and may not be available to all users.
2020+ :type alerts: dict[str, Any] or InstanceACLPAlertsOptions
2021+
19902022 :returns: The cloned Instance.
19912023 :rtype: Instance
19922024 """
@@ -2017,6 +2049,7 @@ def clone(
20172049 "label" : label ,
20182050 "group" : group ,
20192051 "with_backups" : with_backups ,
2052+ "alerts" : alerts ,
20202053 "placement_group" : _expand_placement_group_assignment (
20212054 placement_group
20222055 ),
0 commit comments