Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/binarylane/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class Account:
tax_code (TaxCode): The tax code that currently applies to transactions for this account.
configured_payment_methods (List[PaymentMethod]): The payment methods that are configured (available) for this
account.
additional_ipv4_limit (int): The maximum additional IPv4 addresses this account may assign across all servers.
You may contact support to request this limit be increased.
"""

email: str
Expand All @@ -41,6 +43,7 @@ class Account:
status: AccountStatus
tax_code: TaxCode
configured_payment_methods: List[PaymentMethod]
additional_ipv4_limit: int
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
Expand All @@ -57,6 +60,8 @@ def to_dict(self) -> Dict[str, Any]:

configured_payment_methods.append(configured_payment_methods_item)

additional_ipv4_limit = self.additional_ipv4_limit

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -67,6 +72,7 @@ def to_dict(self) -> Dict[str, Any]:
"status": status,
"tax_code": tax_code,
"configured_payment_methods": configured_payment_methods,
"additional_ipv4_limit": additional_ipv4_limit,
}
)

Expand All @@ -92,13 +98,16 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:

configured_payment_methods.append(configured_payment_methods_item)

additional_ipv4_limit = d.pop("additional_ipv4_limit")

account = cls(
email=email,
email_verified=email_verified,
two_factor_authentication_enabled=two_factor_authentication_enabled,
status=status,
tax_code=tax_code,
configured_payment_methods=configured_payment_methods,
additional_ipv4_limit=additional_ipv4_limit,
)

account.additional_properties = d
Expand Down
10 changes: 10 additions & 0 deletions lib/binarylane/models/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ class Action:
completed_at (Union[Unset, None, datetime.datetime]): The timestamp in ISO8601 format of when processing of this
action completed. If this value is null the action is currently in progress.
resource_type (Union[Unset, None, ResourceType]): The resource type (if any) associated with this action.

| Value | Description |
| ----- | ----------- |
| server | Server |
| load-balancer | Load Balancer |
| ssh-key | SSH Key |
| vpc | Virtual Private Network |
| image | Backup or Operating System Image |
| registered-domain-name | Registered Domain Name |

resource_id (Union[Unset, None, int]): The resource id of the resource (if any) associated with this action.
region (Union[Unset, None, Region]): The region (if any) of the resource associated with this action.
region_slug (Union[Unset, None, str]): The region slug (if any) of the resource associated with this action.
Expand Down
14 changes: 14 additions & 0 deletions lib/binarylane/models/advanced_firewall_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ class AdvancedFirewallRule:
destination_addresses (List[str]): The destination addresses to match for this rule. Each address may be an
individual IPv4 address or a range in IPv4 CIDR notation.
protocol (AdvancedFirewallRuleProtocol): The protocol to match for this rule.

| Value | Description |
| ----- | ----------- |
| all | This rule will match any protocol. |
| icmp | This rule will match ICMP traffic only. |
| tcp | This rule will match TCP traffic only. |
| udp | This rule will match UDP traffic only. |

action (AdvancedFirewallRuleAction): The action to take when there is a match on this rule.

| Value | Description |
| ----- | ----------- |
| drop | Traffic matching this rule will be dropped. |
| accept | Traffic matching this rule will be accepted. |

destination_ports (Union[Unset, None, List[str]]): The destination ports to match for this rule. Leave null or
empty to match on all ports.
description (Union[Unset, None, str]): A description to assist in identifying this rule. Commonly used to record
Expand Down
128 changes: 128 additions & 0 deletions lib/binarylane/models/advanced_firewall_rule_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
from __future__ import annotations

from typing import Any, Dict, List, Type, TypeVar, Union, cast

import attr

from binarylane.models.advanced_firewall_rule_action import AdvancedFirewallRuleAction
from binarylane.models.advanced_firewall_rule_protocol import AdvancedFirewallRuleProtocol
from binarylane.types import UNSET, Unset

T = TypeVar("T", bound="AdvancedFirewallRuleRequest")


@attr.s(auto_attribs=True)
class AdvancedFirewallRuleRequest:
"""
Attributes:
source_addresses (List[str]): The source addresses to match for this rule. Each address may be an individual
IPv4 address or a range in IPv4 CIDR notation.
destination_addresses (List[str]): The destination addresses to match for this rule. Each address may be an
individual IPv4 address or a range in IPv4 CIDR notation.
protocol (AdvancedFirewallRuleProtocol): The protocol to match for this rule.

| Value | Description |
| ----- | ----------- |
| all | This rule will match any protocol. |
| icmp | This rule will match ICMP traffic only. |
| tcp | This rule will match TCP traffic only. |
| udp | This rule will match UDP traffic only. |

action (AdvancedFirewallRuleAction): The action to take when there is a match on this rule.

| Value | Description |
| ----- | ----------- |
| drop | Traffic matching this rule will be dropped. |
| accept | Traffic matching this rule will be accepted. |

destination_ports (Union[Unset, None, List[str]]): The destination ports to match for this rule. Leave null or
empty to match on all ports.
description (Union[Unset, None, str]): A description to assist in identifying this rule. Commonly used to record
the reason for the rule or the intent behind it, e.g. "Block access to RDP" or "Allow access from HQ".
"""

source_addresses: List[str]
destination_addresses: List[str]
protocol: AdvancedFirewallRuleProtocol
action: AdvancedFirewallRuleAction
destination_ports: Union[Unset, None, List[str]] = UNSET
description: Union[Unset, None, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
source_addresses = self.source_addresses

destination_addresses = self.destination_addresses

protocol = self.protocol.value

action = self.action.value

destination_ports: Union[Unset, None, List[str]] = UNSET
if not isinstance(self.destination_ports, Unset):
if self.destination_ports is None:
destination_ports = None
else:
destination_ports = self.destination_ports

description = self.description

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"source_addresses": source_addresses,
"destination_addresses": destination_addresses,
"protocol": protocol,
"action": action,
}
)
if destination_ports is not UNSET:
field_dict["destination_ports"] = destination_ports
if description is not UNSET:
field_dict["description"] = description

return field_dict

@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
source_addresses = cast(List[str], d.pop("source_addresses"))

destination_addresses = cast(List[str], d.pop("destination_addresses"))

protocol = AdvancedFirewallRuleProtocol(d.pop("protocol"))

action = AdvancedFirewallRuleAction(d.pop("action"))

destination_ports = cast(List[str], d.pop("destination_ports", UNSET))

description = d.pop("description", UNSET)

advanced_firewall_rule_request = cls(
source_addresses=source_addresses,
destination_addresses=destination_addresses,
protocol=protocol,
action=action,
destination_ports=destination_ports,
description=description,
)

advanced_firewall_rule_request.additional_properties = d
return advanced_firewall_rule_request

@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())

def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]

def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value

def __delitem__(self, key: str) -> None:
del self.additional_properties[key]

def __contains__(self, key: str) -> bool:
return key in self.additional_properties
12 changes: 12 additions & 0 deletions lib/binarylane/models/advanced_server_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ class AdvancedServerFeatures:
machine_type (Union[Unset, None, VmMachineType]): The machine_type (corresponding to a KVM version) used for
this server.
A null value indicates automatic selection of the best KVM machine type supported by the host node.

| Value | Description |
| ----- | ----------- |
| pc_i440fx_1point5 | PC i440FX 1.5 |
| pc_i440fx_2point11 | PC i440FX 2.11 |
| pc_i440fx_4point1 | PC i440FX 4.1 |
| pc_i440fx_4point2 | PC i440FX 4.2 |
| pc_i440fx_5point0 | PC i440FX 5.0 |
| pc_i440fx_5point1 | PC i440FX 5.1 |
| pc_i440fx_7point2 | PC i440FX 7.2 |
| pc_i440fx_8point2 | PC i440FX 8.2 |

"""

video_device: VideoDevice
Expand Down
20 changes: 20 additions & 0 deletions lib/binarylane/models/change_advanced_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,29 @@ class ChangeAdvancedFeatures:
automatic_processor_model (Union[Unset, None, bool]): Set to true to use best available processor model. If this
is provided the processor_model property must not be provided.
machine_type (Union[Unset, None, VmMachineType]): Do not provide or set to null to keep existing machine type.

| Value | Description |
| ----- | ----------- |
| pc_i440fx_1point5 | PC i440FX 1.5 |
| pc_i440fx_2point11 | PC i440FX 2.11 |
| pc_i440fx_4point1 | PC i440FX 4.1 |
| pc_i440fx_4point2 | PC i440FX 4.2 |
| pc_i440fx_5point0 | PC i440FX 5.0 |
| pc_i440fx_5point1 | PC i440FX 5.1 |
| pc_i440fx_7point2 | PC i440FX 7.2 |
| pc_i440fx_8point2 | PC i440FX 8.2 |

automatic_machine_type (Union[Unset, None, bool]): Set to true to use best available machine type. If this is
provided the machine_type property must not be provided.
video_device (Union[Unset, None, VideoDevice]): Do not provide or set to null to keep existing video device.

| Value | Description |
| ----- | ----------- |
| cirrus-logic | Cirrus Logic GD5446 |
| standard | Standard VGA with VESA 2.0 extensions |
| virtio | Virtio VGA (800x600) |
| virtio-wide | Virtio VGA (1600x900) |

"""

type: ChangeAdvancedFeaturesType
Expand Down
10 changes: 5 additions & 5 deletions lib/binarylane/models/change_advanced_firewall_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import attr

from binarylane.models.advanced_firewall_rule import AdvancedFirewallRule
from binarylane.models.advanced_firewall_rule_request import AdvancedFirewallRuleRequest
from binarylane.models.change_advanced_firewall_rules_type import ChangeAdvancedFirewallRulesType

T = TypeVar("T", bound="ChangeAdvancedFirewallRules")
Expand All @@ -16,12 +16,12 @@ class ChangeAdvancedFirewallRules:

Attributes:
type (ChangeAdvancedFirewallRulesType):
firewall_rules (List[AdvancedFirewallRule]): A list of rules for the server. NB: that any existing rules that
are not included will be removed. Submit an empty list to clear all rules.
firewall_rules (List[AdvancedFirewallRuleRequest]): A list of rules for the server. NB: that any existing rules
that are not included will be removed. Submit an empty list to clear all rules.
"""

type: ChangeAdvancedFirewallRulesType
firewall_rules: List[AdvancedFirewallRule]
firewall_rules: List[AdvancedFirewallRuleRequest]
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
Expand Down Expand Up @@ -52,7 +52,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
firewall_rules = []
_firewall_rules = d.pop("firewall_rules")
for firewall_rules_item_data in _firewall_rules:
firewall_rules_item = AdvancedFirewallRule.from_dict(firewall_rules_item_data)
firewall_rules_item = AdvancedFirewallRuleRequest.from_dict(firewall_rules_item_data)

firewall_rules.append(firewall_rules_item)

Expand Down
16 changes: 15 additions & 1 deletion lib/binarylane/models/domain_record_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,26 @@ class DomainRecordRequest:
"""
Attributes:
type (DomainRecordType): The type of the DNS record.

| Value | Description |
| ----- | ----------- |
| A | Map an IPv4 address to a hostname. |
| AAAA | Map an IPv6 address to a hostname. |
| CAA | Restrict which certificate authorities are permitted to issue certificates for a domain. |
| CNAME | Define an alias for your canonical hostname. |
| MX | Define the mail exchanges that handle mail for the domain. |
| NS | Define the nameservers that manage the domain. |
| SOA | The Start of Authority record for the zone. |
| SRV | Specify a server by hostname and port to handle a service or services. |
| TXT | Define a string of text that is associated with a hostname. |

name (str): The subdomain for this record. Use @ for records on the domain itself, and * to create a wildcard
record.
data (str): A general data field that has different functions depending on the record type.
priority (Union[Unset, None, int]): A priority value that is only relevant for SRV and MX records.
port (Union[Unset, None, int]): A port value that is only relevant for SRV records.
ttl (Union[Unset, None, int]): This value is the time to live for the record, in seconds.
ttl (Union[Unset, None, int]): This value is the time to live for the record, in seconds. The default and only
supported value is 3600. Leave null to accept this default.
weight (Union[Unset, None, int]): The weight value that is only relevant for SRV records.
flags (Union[Unset, None, int]): An unsigned integer between 0-255 that is only relevant for CAA records.
tag (Union[Unset, None, str]): A parameter tag that is only relevant for CAA records.
Expand Down
6 changes: 6 additions & 0 deletions lib/binarylane/models/forwarding_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ class ForwardingRule:
Attributes:
entry_protocol (LoadBalancerRuleProtocol): The protocol that traffic must match for this load balancer to
forward traffic according to this rule.

| Value | Description |
| ----- | ----------- |
| http | The load balancer will forward HTTP traffic that matches this rule. |
| https | The load balancer will forward HTTPS traffic that matches this rule. |

"""

entry_protocol: LoadBalancerRuleProtocol
Expand Down
8 changes: 8 additions & 0 deletions lib/binarylane/models/health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ class HealthCheck:
"""
Attributes:
protocol (Union[Unset, None, HealthCheckProtocol]): Leave null to accept the default HTTP protocol.

| Value | Description |
| ----- | ----------- |
| http | The health check will be performed via HTTP. |
| https | The health check will be performed via HTTPS. |
| both | The health check will be performed via both HTTP and HTTPS. Failing a health check on one protocol will
remove the server from the pool of servers only for that protocol. |

path (Union[Unset, None, str]): Leave null to accept the default '/' path.
"""

Expand Down
3 changes: 2 additions & 1 deletion lib/binarylane/models/image_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class ImageRequest:
name (Union[Unset, None, str]): Optional: a new display name for this image. Do not provide to leave the display
name unchanged, submit an empty string to clear the display name.
locked (Union[Unset, None, bool]): Optional: you may choose to lock an individual backup in which case we will
not update that backup until you unlock it. Do not provide to leave the locked status unchanged.
not update that backup until you unlock it. Do not provide to leave the locked status unchanged. You may not
lock or unlock a temporary backup or a backup that is attached to a server.
"""

name: Union[Unset, None, str] = UNSET
Expand Down
19 changes: 19 additions & 0 deletions lib/binarylane/models/take_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,27 @@ class TakeBackup:
Attributes:
type (TakeBackupType):
replacement_strategy (BackupReplacementStrategy): The strategy for selecting which backup to replace (if any).

| Value | Description |
| ----- | ----------- |
| none | Do not replace any existing backup: use a free slot of the provided backup type. If there are no free
slots an error will occur. |
| specified | Replace the specific backup id provided. |
| oldest | Use any free slots of the provided backup type, and if there are no free slots replace the oldest
unlocked and un-attached backup of the provided backup type. |
| newest | Use any free slots of the provided backup type, and if there are no free slots replace the newest
unlocked and un-attached backup of the provided backup type. |

backup_type (Union[Unset, None, BackupSlot]): If replacement_strategy is anything other than 'specified', this
must be provided.

| Value | Description |
| ----- | ----------- |
| daily | A backup which is scheduled to be taken each day. |
| weekly | A backup which is scheduled to be taken each week. |
| monthly | A backup which is scheduled to be taken each month. |
| temporary | A backup which is created on demand and only retained for a maximum of seven days. |

backup_id_to_replace (Union[Unset, None, int]): If replacement_strategy is 'specified' this property must be set
to an existing backup.
label (Union[Unset, None, str]): An optional label to identify the backup.
Expand Down
Loading
Loading