@@ -766,6 +766,31 @@ class UpgradeInterfacesResult(JSONObject):
766766 )
767767
768768
769+ @dataclass
770+ class InstanceAlerts (JSONObject ):
771+ """
772+ Represents both legacy and ACLP alerts for a Linode Instance.
773+ """
774+
775+ cpu : int = 0
776+ io : int = 0
777+ network_in : int = 0
778+ network_out : int = 0
779+ transfer_quota : int = 0
780+ system_alerts : Optional [List [int ]] = None
781+ user_alerts : Optional [List [int ]] = None
782+
783+
784+ @dataclass
785+ class InstanceACLPAlertsOptions (JSONObject ):
786+ """
787+ Represents the ACLP alerts available to define during instance creation and cloning.
788+ """
789+
790+ system_alerts : Optional [List [int ]] = None
791+ user_alerts : Optional [List [int ]] = None
792+
793+
769794class Instance (Base ):
770795 """
771796 A Linode Instance.
@@ -782,7 +807,7 @@ class Instance(Base):
782807 "created" : Property (is_datetime = True ),
783808 "updated" : Property (volatile = True , is_datetime = True ),
784809 "region" : Property (slug_relationship = Region ),
785- "alerts" : Property (mutable = True ),
810+ "alerts" : Property (mutable = True , json_object = InstanceAlerts ),
786811 "image" : Property (slug_relationship = Image ),
787812 "disks" : Property (derived_class = Disk ),
788813 "configs" : Property (derived_class = Config ),
@@ -1828,6 +1853,9 @@ def clone(
18281853 Dict [str , Any ],
18291854 int ,
18301855 ] = None ,
1856+ alerts : Optional [
1857+ Union [Dict [str , Any ], InstanceACLPAlertsOptions ]
1858+ ] = None ,
18311859 ):
18321860 """
18331861 Clones this linode into a new linode or into a new linode in the given region
@@ -1866,6 +1894,10 @@ def clone(
18661894 :param placement_group: Information about the placement group to create this instance under.
18671895 :type placement_group: Union[InstancePlacementGroupAssignment, PlacementGroup, Dict[str, Any], int]
18681896
1897+ :param alerts: ACLP monitor alert definitions associated with the cloned Instance.
1898+ This is under v4beta and may not be available to all users.
1899+ :type alerts: dict[str, Any] or InstanceACLPAlertsOptions
1900+
18691901 :returns: The cloned Instance.
18701902 :rtype: Instance
18711903 """
@@ -1893,6 +1925,7 @@ def clone(
18931925 "label" : label ,
18941926 "group" : group ,
18951927 "with_backups" : with_backups ,
1928+ "alerts" : alerts ,
18961929 "placement_group" : _expand_placement_group_assignment (
18971930 placement_group
18981931 ),
0 commit comments