Floating IPsClient
- class FloatingIPsClient(client: Client)[source]
- actions: ResourceActionsClient
Floating IPs scoped actions client
- Type:
- assign(floating_ip: FloatingIP | BoundFloatingIP, server: Server | BoundServer) BoundAction[source]
Assigns a Floating IP to a server.
- Parameters:
floating_ip –
BoundFloatingIPorFloatingIPserver –
BoundServerorServerServer the Floating IP shall be assigned to
- Returns:
- change_dns_ptr(floating_ip: FloatingIP | BoundFloatingIP, ip: str, dns_ptr: str) BoundAction[source]
Changes the hostname that will appear when getting the hostname belonging to this Floating IP.
- Parameters:
floating_ip –
BoundFloatingIPorFloatingIPip – str The IP address for which to set the reverse DNS entry
dns_ptr – str Hostname to set as a reverse DNS PTR entry, will reset to original default value if None
- Returns:
- change_protection(floating_ip: FloatingIP | BoundFloatingIP, delete: bool | None = None) BoundAction[source]
Changes the protection configuration of the Floating IP.
- Parameters:
floating_ip –
BoundFloatingIPorFloatingIPdelete – boolean If true, prevents the Floating IP from being deleted
- Returns:
- create(type: str, description: str | None = None, labels: dict[str, str] | None = None, home_location: Location | BoundLocation | None = None, server: Server | BoundServer | None = None, name: str | None = None) CreateFloatingIPResponse[source]
Creates a new Floating IP assigned to a server.
- Parameters:
type – str Floating IP type Choices: ipv4, ipv6
description – str (optional)
labels – Dict[str, str] (optional) User-defined labels (key-value pairs)
home_location –
BoundLocationorLocation( Home location (routing is optimized for that location). Only optional if server argument is passed.server –
BoundServerorServerServer to assign the Floating IP toname – str (optional)
- Returns:
- delete(floating_ip: FloatingIP | BoundFloatingIP) bool[source]
Deletes a Floating IP. If it is currently assigned to a server it will automatically get unassigned.
- Parameters:
floating_ip –
BoundFloatingIPorFloatingIP- Returns:
boolean
- get_actions(floating_ip: FloatingIP | BoundFloatingIP, status: list[Literal['running', 'success', 'error']] | None = None, sort: list[Literal['id', 'id:asc', 'id:desc', 'command', 'command:asc', 'command:desc', 'status', 'status:asc', 'status:desc', 'started', 'started:asc', 'started:desc', 'finished', 'finished:asc', 'finished:desc']] | None = None) list[BoundAction][source]
Returns all Actions for a Floating IP.
- Parameters:
floating_ip – Floating IP to get the Actions for.
status – Filter the Actions by status.
sort – Sort Actions by field and direction.
- get_actions_list(floating_ip: FloatingIP | BoundFloatingIP, status: list[Literal['running', 'success', 'error']] | None = None, sort: list[Literal['id', 'id:asc', 'id:desc', 'command', 'command:asc', 'command:desc', 'status', 'status:asc', 'status:desc', 'started', 'started:asc', 'started:desc', 'finished', 'finished:asc', 'finished:desc']] | None = None, page: int | None = None, per_page: int | None = None) ActionsPageResult[source]
Returns a paginated list of Actions for a Floating IP.
- Parameters:
floating_ip – Floating IP to get the Actions for.
status – Filter the Actions by status.
sort – Sort Actions by field and direction.
page – Page number to get.
per_page – Maximum number of Actions returned per page.
- get_all(label_selector: str | None = None, name: str | None = None) list[BoundFloatingIP][source]
Get all floating ips from this account
- Parameters:
label_selector – str (optional) Can be used to filter Floating IPs by labels. The response will only contain Floating IPs matching the label selector.able values.
name – str (optional) Can be used to filter networks by their name.
- Returns:
List[
BoundFloatingIP]
- get_by_id(id: int) BoundFloatingIP[source]
Returns a specific Floating IP object.
- Parameters:
id – int
- Returns:
- get_by_name(name: str) BoundFloatingIP | None[source]
Get Floating IP by name
- Parameters:
name – str Used to get Floating IP by name.
- Returns:
- get_list(label_selector: str | None = None, page: int | None = None, per_page: int | None = None, name: str | None = None) FloatingIPsPageResult[source]
Get a list of floating ips from this account
- Parameters:
label_selector – str (optional) Can be used to filter Floating IPs by labels. The response will only contain Floating IPs matching the label selector.able values.
page – int (optional) Specifies the page to fetch
per_page – int (optional) Specifies how many results are returned by page
name – str (optional) Can be used to filter networks by their name.
- Returns:
(List[
BoundFloatingIP],Meta)
- unassign(floating_ip: FloatingIP | BoundFloatingIP) BoundAction[source]
Unassigns a Floating IP, resulting in it being unreachable. You may assign it to a server again at a later time.
- Parameters:
floating_ip –
BoundFloatingIPorFloatingIP- Returns:
- update(floating_ip: FloatingIP | BoundFloatingIP, description: str | None = None, labels: dict[str, str] | None = None, name: str | None = None) BoundFloatingIP[source]
Updates the description or labels of a Floating IP.
- Parameters:
floating_ip –
BoundFloatingIPorFloatingIPdescription – str (optional) New Description to set
labels – Dict[str, str] (optional) User-defined labels (key-value pairs)
name – str (optional) New name to set
- Returns:
- class BoundFloatingIP(client: FloatingIPsClient, data: dict[str, Any], complete: bool = True)[source]
- assign(server: Server | BoundServer) BoundAction[source]
Assigns a Floating IP to a server.
- Parameters:
server –
BoundServerorServerServer the Floating IP shall be assigned to- Returns:
- change_dns_ptr(ip: str, dns_ptr: str) BoundAction[source]
Changes the hostname that will appear when getting the hostname belonging to this Floating IP.
- Parameters:
ip – str The IP address for which to set the reverse DNS entry
dns_ptr – str Hostname to set as a reverse DNS PTR entry, will reset to original default value if None
- Returns:
- change_protection(delete: bool | None = None) BoundAction[source]
Changes the protection configuration of the Floating IP.
- Parameters:
delete – boolean If true, prevents the Floating IP from being deleted
- Returns:
- delete() bool[source]
Deletes a Floating IP. If it is currently assigned to a server it will automatically get unassigned.
- Returns:
boolean
- get_actions(status: list[Literal['running', 'success', 'error']] | None = None, sort: list[Literal['id', 'id:asc', 'id:desc', 'command', 'command:asc', 'command:desc', 'status', 'status:asc', 'status:desc', 'started', 'started:asc', 'started:desc', 'finished', 'finished:asc', 'finished:desc']] | None = None) list[BoundAction][source]
Returns all Actions for a Floating IP.
- Parameters:
status – Filter the Actions by status.
sort – Sort Actions by field and direction.
- get_actions_list(status: list[Literal['running', 'success', 'error']] | None = None, sort: list[Literal['id', 'id:asc', 'id:desc', 'command', 'command:asc', 'command:desc', 'status', 'status:asc', 'status:desc', 'started', 'started:asc', 'started:desc', 'finished', 'finished:asc', 'finished:desc']] | None = None, page: int | None = None, per_page: int | None = None) ActionsPageResult[source]
Returns a paginated list of Actions for a Floating IP.
- Parameters:
status – Filter the Actions by status.
sort – Sort Actions by field and direction.
page – Page number to get.
per_page – Maximum number of Actions returned per page.
- model
alias of
FloatingIP
- unassign() BoundAction[source]
Unassigns a Floating IP, resulting in it being unreachable. You may assign it to a server again at a later time.
- Returns:
- update(description: str | None = None, labels: dict[str, str] | None = None, name: str | None = None) BoundFloatingIP[source]
Updates the description or labels of a Floating IP.
- Parameters:
description – str (optional) New Description to set
labels – Dict[str, str] (optional) User-defined labels (key-value pairs)
name – str (optional) New Name to set
- Returns:
- class FloatingIP(id: int | None = None, type: str | None = None, description: str | None = None, ip: str | None = None, server: BoundServer | None = None, dns_ptr: list[DNSPtr] | None = None, home_location: BoundLocation | None = None, blocked: bool | None = None, protection: FloatingIPProtection | None = None, labels: dict[str, str] | None = None, created: str | None = None, name: str | None = None)[source]
Floating IP Domain
- Parameters:
id – int ID of the Floating IP
description – str, None Description of the Floating IP
ip – str IP address of the Floating IP
type – str Type of Floating IP. Choices: ipv4, ipv6
server –
BoundServer, None Server the Floating IP is assigned to, None if it is not assigned at alldns_ptr – List[Dict] Array of reverse DNS entries
home_location –
BoundLocationLocation the Floating IP was created in. Routing is optimized for this location.blocked – boolean Whether the IP is blocked
protection – dict Protection configuration for the Floating IP
labels – dict User-defined labels (key-value pairs)
created – datetime Point in time when the Floating IP was created
name – str Name of the Floating IP
- class CreateFloatingIPResponse(floating_ip: BoundFloatingIP, action: BoundAction | None)[source]
Create Floating IP Response Domain
- Parameters:
floating_ip –
BoundFloatingIPThe Floating IP which was createdaction –
BoundActionThe Action which shows the progress of the Floating IP Creation