Skip to content

Commit 7c549b6

Browse files
committed
address comments
1 parent d5e0aa9 commit 7c549b6

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

linode_api4/groups/linode.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ def instance_create(
141141
region,
142142
image=None,
143143
authorized_keys=None,
144-
alerts: Optional[
145-
Union[Dict[str, Any], InstanceACLPAlertsOptions]
146-
] = None,
147144
firewall: Optional[Union[Firewall, int]] = None,
148145
backup: Optional[Union[Backup, int]] = None,
149146
stackscript: Optional[Union[StackScript, int]] = None,
@@ -166,6 +163,9 @@ def instance_create(
166163
interface_generation: Optional[Union[InterfaceGeneration, str]] = None,
167164
network_helper: Optional[bool] = None,
168165
maintenance_policy: Optional[str] = None,
166+
alerts: Optional[
167+
Union[Dict[str, Any], InstanceACLPAlertsOptions]
168+
] = None,
169169
**kwargs,
170170
):
171171
"""
@@ -323,9 +323,6 @@ def instance_create(
323323
The contents of this field can be built using the
324324
:any:`build_instance_metadata` method.
325325
:type metadata: dict
326-
:param alerts: ACLP alerts available to define during instance creation.
327-
This is v4beta only and may not be available to all users.
328-
:type alerts: dict[str, Any] or InstanceACLPAlertsOptions
329326
:param firewall: The firewall to attach this Linode to.
330327
:type firewall: int or Firewall
331328
:param disk_encryption: The disk encryption policy for this Linode.
@@ -343,6 +340,9 @@ def instance_create(
343340
:param maintenance_policy: The slug of the maintenance policy to apply during maintenance.
344341
If not provided, the default policy (linode/migrate) will be applied.
345342
:type maintenance_policy: str
343+
:param alerts: ACLP alerts available to define during instance creation.
344+
This is v4beta only and may not be available to all users.
345+
:type alerts: dict[str, Any] or InstanceACLPAlertsOptions
346346
347347
:returns: A new Instance object, or a tuple containing the new Instance and
348348
the generated password.

linode_api4/objects/linode.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,8 @@ class InstanceAlerts(JSONObject):
777777
network_in: int = 0
778778
network_out: int = 0
779779
transfer_quota: int = 0
780-
system_alerts: List[int] = field(default_factory=list)
781-
user_alerts: List[int] = field(default_factory=list)
780+
system_alerts: Optional[List[int]] = None
781+
user_alerts: Optional[List[int]] = None
782782

783783

784784
@dataclass
@@ -787,8 +787,8 @@ class InstanceACLPAlertsOptions(JSONObject):
787787
Represents the ACLP alerts available to define during instance creation and cloning.
788788
"""
789789

790-
system_alerts: List[int] = field(default_factory=list)
791-
user_alerts: List[int] = field(default_factory=list)
790+
system_alerts: Optional[List[int]] = None
791+
user_alerts: Optional[List[int]] = None
792792

793793

794794
class Instance(Base):
@@ -1847,15 +1847,15 @@ def clone(
18471847
label=None,
18481848
group=None,
18491849
with_backups=None,
1850-
alerts: Optional[
1851-
Union[Dict[str, Any], InstanceACLPAlertsOptions]
1852-
] = None,
18531850
placement_group: Union[
18541851
InstancePlacementGroupAssignment,
18551852
"PlacementGroup",
18561853
Dict[str, Any],
18571854
int,
18581855
] = None,
1856+
alerts: Optional[
1857+
Union[Dict[str, Any], InstanceACLPAlertsOptions]
1858+
] = None,
18591859
):
18601860
"""
18611861
Clones this linode into a new linode or into a new linode in the given region
@@ -1891,12 +1891,13 @@ def clone(
18911891
enrolled in the Linode Backup service. This will incur an additional charge.
18921892
:type: with_backups: bool
18931893
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
18971894
:param placement_group: Information about the placement group to create this instance under.
18981895
:type placement_group: Union[InstancePlacementGroupAssignment, PlacementGroup, Dict[str, Any], int]
18991896
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+
19001901
:returns: The cloned Instance.
19011902
:rtype: Instance
19021903
"""

0 commit comments

Comments
 (0)