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 –
BoundFloatingIP
orFloatingIP
server –
BoundServer
orServer
Server 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 –
BoundFloatingIP
orFloatingIP
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(floating_ip: FloatingIP | BoundFloatingIP, delete: bool | None = None) BoundAction [source]
Changes the protection configuration of the Floating IP.
- Parameters:
floating_ip –
BoundFloatingIP
orFloatingIP
delete – boolean If true, prevents the Floating IP from being deleted
- Returns:
- create(type: str, description: str | None = None, labels: 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 –
BoundLocation
orLocation
( Home location (routing is optimized for that location). Only optional if server argument is passed.server –
BoundServer
orServer
Server 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 –
BoundFloatingIP
orFloatingIP
- Returns:
boolean
- get_actions(floating_ip: FloatingIP | BoundFloatingIP, status: list[str] | None = None, sort: list[str] | None = None) list[BoundAction] [source]
Returns all action objects for a Floating IP.
- Parameters:
floating_ip –
BoundFloatingIP
orFloatingIP
status – List[str] (optional) Response will have only actions with specified statuses. Choices: running success error
sort – List[str] (optional) 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
- Returns:
List[
BoundAction
]
- get_actions_list(floating_ip: FloatingIP | BoundFloatingIP, status: list[str] | None = None, sort: list[str] | None = None, page: int | None = None, per_page: int | None = None) ActionsPageResult [source]
Returns all action objects for a Floating IP.
- Parameters:
floating_ip –
BoundFloatingIP
orFloatingIP
status – List[str] (optional) Response will have only actions with specified statuses. Choices: running success error
sort – List[str] (optional) 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
page – int (optional) Specifies the page to fetch
per_page – int (optional) Specifies how many results are returned by page
- Returns:
(List[
BoundAction
],Meta
)
- 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 –
BoundFloatingIP
orFloatingIP
- 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 –
BoundFloatingIP
orFloatingIP
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 BoundFloatingIP(client: FloatingIPsClient, data: dict, complete: bool = True)[source]
- assign(server: Server | BoundServer) BoundAction [source]
Assigns a Floating IP to a server.
- Parameters:
server –
BoundServer
orServer
Server 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[str] | None = None, sort: list[str] | None = None) list[BoundAction] [source]
Returns all action objects for a Floating IP.
- Parameters:
status – List[str] (optional) Response will have only actions with specified statuses. Choices: running success error
sort – List[str] (optional) 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
- Returns:
List[
BoundAction
]
- get_actions_list(status: list[str] | None = None, sort: list[str] | None = None, page: int | None = None, per_page: int | None = None) ActionsPageResult [source]
Returns all action objects for a Floating IP.
- Parameters:
status – List[str] (optional) Response will have only actions with specified statuses. Choices: running success error
sort – List[str] (optional) 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
page – int (optional) Specifies the page to fetch
per_page – int (optional) Specifies how many results are returned by page
- Returns:
(List[
BoundAction
],Meta
)
- 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[dict] | None = None, home_location: BoundLocation | None = None, blocked: bool | None = None, protection: dict | 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 –
BoundLocation
Location 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 –
BoundFloatingIP
The Floating IP which was createdaction –
BoundAction
The Action which shows the progress of the Floating IP Creation