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
20 changes: 17 additions & 3 deletions hcloud/certificates/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ def get_actions_list(
Specifies how many results are returned by page
:return: (List[:class:`BoundAction <hcloud.actions.client.BoundAction>`], :class:`Meta <hcloud.core.domain.Meta>`)
"""
return self._client.get_actions_list(self, status, sort, page, per_page)
return self._client.get_actions_list(
self,
status=status,
sort=sort,
page=page,
per_page=per_page,
)

def get_actions(
self,
Expand All @@ -68,7 +74,11 @@ def get_actions(
Specify how the results are sorted. Choices: `id` `id:asc` `id:desc` `command` `command:asc` `command:desc` `status` `status:asc` `status:desc` `progress` `progress:asc` `progress:desc` `started` `started:asc` `started:desc` `finished` `finished:asc` `finished:desc`
:return: List[:class:`BoundAction <hcloud.actions.client.BoundAction>`]
"""
return self._client.get_actions(self, status, sort)
return self._client.get_actions(
self,
status=status,
sort=sort,
)

def update(
self,
Expand All @@ -83,7 +93,11 @@ def update(
User-defined labels (key-value pairs)
:return: :class:`BoundCertificate <hcloud.certificates.client.BoundCertificate>`
"""
return self._client.update(self, name, labels)
return self._client.update(
self,
name=name,
labels=labels,
)

def delete(self) -> bool:
"""Deletes a certificate.
Expand Down
22 changes: 16 additions & 6 deletions hcloud/firewalls/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ def get_actions_list(
Specifies how many results are returned by page
:return: (List[:class:`BoundAction <hcloud.actions.client.BoundAction>`], :class:`Meta <hcloud.core.domain.Meta>`)
"""
return self._client.get_actions_list(self, status, sort, page, per_page)
return self._client.get_actions_list(
self,
status=status,
sort=sort,
page=page,
per_page=per_page,
)

def get_actions(
self,
Expand All @@ -125,7 +131,11 @@ def get_actions(

:return: List[:class:`BoundAction <hcloud.actions.client.BoundAction>`]
"""
return self._client.get_actions(self, status, sort)
return self._client.get_actions(
self,
status=status,
sort=sort,
)

def update(
self,
Expand All @@ -140,7 +150,7 @@ def update(
New Name to set
:return: :class:`BoundFirewall <hcloud.firewalls.client.BoundFirewall>`
"""
return self._client.update(self, labels, name)
return self._client.update(self, name=name, labels=labels)

def delete(self) -> bool:
"""Deletes a Firewall.
Expand All @@ -155,7 +165,7 @@ def set_rules(self, rules: list[FirewallRule]) -> list[BoundAction]:
:return: List[:class:`BoundAction <hcloud.actions.client.BoundAction>`]
"""

return self._client.set_rules(self, rules)
return self._client.set_rules(self, rules=rules)

def apply_to_resources(
self,
Expand All @@ -165,7 +175,7 @@ def apply_to_resources(
:param resources: List[:class:`FirewallResource <hcloud.firewalls.domain.FirewallResource>`]
:return: List[:class:`BoundAction <hcloud.actions.client.BoundAction>`]
"""
return self._client.apply_to_resources(self, resources)
return self._client.apply_to_resources(self, resources=resources)

def remove_from_resources(
self,
Expand All @@ -175,7 +185,7 @@ def remove_from_resources(
:param resources: List[:class:`FirewallResource <hcloud.firewalls.domain.FirewallResource>`]
:return: List[:class:`BoundAction <hcloud.actions.client.BoundAction>`]
"""
return self._client.remove_from_resources(self, resources)
return self._client.remove_from_resources(self, resources=resources)


class FirewallsPageResult(NamedTuple):
Expand Down
20 changes: 14 additions & 6 deletions hcloud/floating_ips/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ def get_actions_list(
Specifies how many results are returned by page
:return: (List[:class:`BoundAction <hcloud.actions.client.BoundAction>`], :class:`Meta <hcloud.core.domain.Meta>`)
"""
return self._client.get_actions_list(self, status, sort, page, per_page)
return self._client.get_actions_list(
self,
status=status,
sort=sort,
page=page,
per_page=per_page,
)

def get_actions(
self,
Expand All @@ -70,7 +76,7 @@ def get_actions(
Specify how the results are sorted. Choices: `id` `id:asc` `id:desc` `command` `command:asc` `command:desc` `status` `status:asc` `status:desc` `progress` `progress:asc` `progress:desc` `started` `started:asc` `started:desc` `finished` `finished:asc` `finished:desc`
:return: List[:class:`BoundAction <hcloud.actions.client.BoundAction>`]
"""
return self._client.get_actions(self, status, sort)
return self._client.get_actions(self, status=status, sort=sort)

def update(
self,
Expand All @@ -88,7 +94,9 @@ def update(
New Name to set
:return: :class:`BoundFloatingIP <hcloud.floating_ips.client.BoundFloatingIP>`
"""
return self._client.update(self, description, labels, name)
return self._client.update(
self, description=description, labels=labels, name=name
)

def delete(self) -> bool:
"""Deletes a Floating IP. If it is currently assigned to a server it will automatically get unassigned.
Expand All @@ -104,7 +112,7 @@ def change_protection(self, delete: bool | None = None) -> BoundAction:
If true, prevents the Floating IP from being deleted
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.change_protection(self, delete)
return self._client.change_protection(self, delete=delete)

def assign(self, server: Server | BoundServer) -> BoundAction:
"""Assigns a Floating IP to a server.
Expand All @@ -113,7 +121,7 @@ def assign(self, server: Server | BoundServer) -> BoundAction:
Server the Floating IP shall be assigned to
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.assign(self, server)
return self._client.assign(self, server=server)

def unassign(self) -> BoundAction:
"""Unassigns a Floating IP, resulting in it being unreachable. You may assign it to a server again at a later time.
Expand All @@ -131,7 +139,7 @@ def change_dns_ptr(self, ip: str, dns_ptr: str) -> BoundAction:
Hostname to set as a reverse DNS PTR entry, will reset to original default value if `None`
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.change_dns_ptr(self, ip, dns_ptr)
return self._client.change_dns_ptr(self, ip=ip, dns_ptr=dns_ptr)


class FloatingIPsPageResult(NamedTuple):
Expand Down
18 changes: 14 additions & 4 deletions hcloud/images/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ def get_actions_list(
:return: (List[:class:`BoundAction <hcloud.actions.client.BoundAction>`], :class:`Meta <hcloud.core.domain.Meta>`)
"""
return self._client.get_actions_list(
self, sort=sort, page=page, per_page=per_page, status=status
self,
sort=sort,
page=page,
per_page=per_page,
status=status,
)

def get_actions(
Expand All @@ -69,7 +73,11 @@ def get_actions(
Specify how the results are sorted. Choices: `id` `id:asc` `id:desc` `command` `command:asc` `command:desc` `status` `status:asc` `status:desc` `progress` `progress:asc` `progress:desc` `started` `started:asc` `started:desc` `finished` `finished:asc` `finished:desc`
:return: List[:class:`BoundAction <hcloud.actions.client.BoundAction>`]
"""
return self._client.get_actions(self, status=status, sort=sort)
return self._client.get_actions(
self,
status=status,
sort=sort,
)

def update(
self,
Expand All @@ -88,7 +96,9 @@ def update(
User-defined labels (key-value pairs)
:return: :class:`BoundImage <hcloud.images.client.BoundImage>`
"""
return self._client.update(self, description, type, labels)
return self._client.update(
self, description=description, type=type, labels=labels
)

def delete(self) -> bool:
"""Deletes an Image. Only images of type snapshot and backup can be deleted.
Expand All @@ -104,7 +114,7 @@ def change_protection(self, delete: bool | None = None) -> BoundAction:
If true, prevents the snapshot from being deleted
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.change_protection(self, delete)
return self._client.change_protection(self, delete=delete)


class ImagesPageResult(NamedTuple):
Expand Down
35 changes: 23 additions & 12 deletions hcloud/load_balancers/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def update(
User-defined labels (key-value pairs)
:return: :class:`BoundLoadBalancer <hcloud.load_balancers.client.BoundLoadBalancer>`
"""
return self._client.update(self, name, labels)
return self._client.update(self, name=name, labels=labels)

def delete(self) -> bool:
"""Deletes a Load Balancer.
Expand Down Expand Up @@ -224,7 +224,13 @@ def get_actions_list(
Specifies how many results are returned by page
:return: (List[:class:`BoundAction <hcloud.actions.client.BoundAction>`], :class:`Meta <hcloud.core.domain.Meta>`)
"""
return self._client.get_actions_list(self, status, sort, page, per_page)
return self._client.get_actions_list(
self,
status=status,
sort=sort,
page=page,
per_page=per_page,
)

def get_actions(
self,
Expand All @@ -239,7 +245,7 @@ def get_actions(
Specify how the results are sorted. Choices: `id` `id:asc` `id:desc` `command` `command:asc` `command:desc` `status` `status:asc` `status:desc` `progress` `progress:asc` `progress:desc` `started` `started:asc` `started:desc` `finished` `finished:asc` `finished:desc`
:return: List[:class:`BoundAction <hcloud.actions.client.BoundAction>`]
"""
return self._client.get_actions(self, status, sort)
return self._client.get_actions(self, status=status, sort=sort)

def add_service(self, service: LoadBalancerService) -> BoundAction:
"""Adds a service to a Load Balancer.
Expand All @@ -266,7 +272,7 @@ def delete_service(self, service: LoadBalancerService) -> BoundAction:
The LoadBalancerService you want to delete from the Load Balancer
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.delete_service(self, service)
return self._client.delete_service(self, service=service)

def add_target(self, target: LoadBalancerTarget) -> BoundAction:
"""Adds a target to a Load Balancer.
Expand All @@ -275,7 +281,7 @@ def add_target(self, target: LoadBalancerTarget) -> BoundAction:
The LoadBalancerTarget you want to add to the Load Balancer
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.add_target(self, target)
return self._client.add_target(self, target=target)

def remove_target(self, target: LoadBalancerTarget) -> BoundAction:
"""Removes a target from a Load Balancer.
Expand All @@ -284,7 +290,7 @@ def remove_target(self, target: LoadBalancerTarget) -> BoundAction:
The LoadBalancerTarget you want to remove from the Load Balancer
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.remove_target(self, target)
return self._client.remove_target(self, target=target)

def change_algorithm(self, algorithm: LoadBalancerAlgorithm) -> BoundAction:
"""Changes the algorithm used by the Load Balancer
Expand All @@ -293,7 +299,7 @@ def change_algorithm(self, algorithm: LoadBalancerAlgorithm) -> BoundAction:
The LoadBalancerAlgorithm you want to use
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.change_algorithm(self, algorithm)
return self._client.change_algorithm(self, algorithm=algorithm)

def change_dns_ptr(self, ip: str, dns_ptr: str) -> BoundAction:
"""Changes the hostname that will appear when getting the hostname belonging to the public IPs (IPv4 and IPv6) of this Load Balancer.
Expand All @@ -304,7 +310,7 @@ def change_dns_ptr(self, ip: str, dns_ptr: str) -> BoundAction:
Hostname to set as a reverse DNS PTR entry, will reset to original default value if `None`
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.change_dns_ptr(self, ip, dns_ptr)
return self._client.change_dns_ptr(self, ip=ip, dns_ptr=dns_ptr)

def change_protection(self, delete: bool) -> BoundAction:
"""Changes the protection configuration of a Load Balancer.
Expand All @@ -313,7 +319,7 @@ def change_protection(self, delete: bool) -> BoundAction:
If True, prevents the Load Balancer from being deleted
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.change_protection(self, delete)
return self._client.change_protection(self, delete=delete)

def attach_to_network(
self,
Expand All @@ -330,15 +336,20 @@ def attach_to_network(
IP range in CIDR block notation of the subnet to attach to.
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.attach_to_network(self, network, ip, ip_range)
return self._client.attach_to_network(
self,
network=network,
ip=ip,
ip_range=ip_range,
)

def detach_from_network(self, network: Network | BoundNetwork) -> BoundAction:
"""Detaches a Load Balancer from a Network.

:param network: :class:`BoundNetwork <hcloud.networks.client.BoundNetwork>` or :class:`Network <hcloud.networks.domain.Network>`
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.detach_from_network(self, network)
return self._client.detach_from_network(self, network=network)

def enable_public_interface(self) -> BoundAction:
"""Enables the public interface of a Load Balancer.
Expand All @@ -364,7 +375,7 @@ def change_type(
Load Balancer type the Load Balancer should migrate to
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
return self._client.change_type(self, load_balancer_type)
return self._client.change_type(self, load_balancer_type=load_balancer_type)


class LoadBalancersPageResult(NamedTuple):
Expand Down
10 changes: 8 additions & 2 deletions hcloud/networks/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ def get_actions_list(
Specifies how many results are returned by page
:return: (List[:class:`BoundAction <hcloud.actions.client.BoundAction>`], :class:`Meta <hcloud.core.domain.Meta>`)
"""
return self._client.get_actions_list(self, status, sort, page, per_page)
return self._client.get_actions_list(
self,
status=status,
sort=sort,
page=page,
per_page=per_page,
)

def get_actions(
self,
Expand All @@ -104,7 +110,7 @@ def get_actions(
Specify how the results are sorted. Choices: `id` `id:asc` `id:desc` `command` `command:asc` `command:desc` `status` `status:asc` `status:desc` `progress` `progress:asc` `progress:desc` `started` `started:asc` `started:desc` `finished` `finished:asc` `finished:desc`
:return: List[:class:`BoundAction <hcloud.actions.client.BoundAction>`]
"""
return self._client.get_actions(self, status, sort)
return self._client.get_actions(self, status=status, sort=sort)

def add_subnet(self, subnet: NetworkSubnet) -> BoundAction:
"""Adds a subnet entry to a network.
Expand Down
2 changes: 1 addition & 1 deletion hcloud/placement_groups/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def update(
New Name to set
:return: :class:`BoundPlacementGroup <hcloud.placement_groups.client.BoundPlacementGroup>`
"""
return self._client.update(self, labels, name)
return self._client.update(self, labels=labels, name=name)

def delete(self) -> bool:
"""Deletes a Placement Group
Expand Down
Loading