@@ -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 : List [int ] = field (default_factory = list )
781+ user_alerts : List [int ] = field (default_factory = list )
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 : List [int ] = field (default_factory = list )
791+ user_alerts : List [int ] = field (default_factory = list )
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 ),
@@ -1822,6 +1847,9 @@ def clone(
18221847 label = None ,
18231848 group = None ,
18241849 with_backups = None ,
1850+ alerts : Optional [
1851+ Union [Dict [str , Any ], InstanceACLPAlertsOptions ]
1852+ ] = None ,
18251853 placement_group : Union [
18261854 InstancePlacementGroupAssignment ,
18271855 "PlacementGroup" ,
@@ -1863,6 +1891,9 @@ def clone(
18631891 enrolled in the Linode Backup service. This will incur an additional charge.
18641892 :type: with_backups: bool
18651893
1894+ :param alerts: ACLP monitor alert definitions associate with the cloned Instance.
1895+ This is under v4beta and may not be available to all users.
1896+ :type alerts: dict[str, Any] or InstanceACLPAlertsOptions
18661897 :param placement_group: Information about the placement group to create this instance under.
18671898 :type placement_group: Union[InstancePlacementGroupAssignment, PlacementGroup, Dict[str, Any], int]
18681899
@@ -1893,6 +1924,7 @@ def clone(
18931924 "label" : label ,
18941925 "group" : group ,
18951926 "with_backups" : with_backups ,
1927+ "alerts" : alerts ,
18961928 "placement_group" : _expand_placement_group_assignment (
18971929 placement_group
18981930 ),
0 commit comments