libcloud.common.upcloud module
- class libcloud.common.upcloud.PlanPrice(zone_prices)[source]
Bases:
object
Helper class to construct plan price in different zones
- Parameters:
zone_prices (
`list`
) – List of prices in different zones in UpCloud
- get_price(plan_name, location=None)[source]
Returns the plan’s price in location. If location is not provided returns None
- Parameters:
plan_name (
`str`
) – Name of the planlocation (
NodeLocation
) – Location, which price is returned (optional)
rtype:
float
- class libcloud.common.upcloud.UpcloudCreateNodeRequestBody(name, size, image, location, auth=None, ex_hostname='localhost', ex_username='root')[source]
Bases:
object
Body of the create_node request
Takes the create_node arguments (**kwargs) and constructs the request body
- Parameters:
name (
str
) – Name of the created server (required)size (
NodeSize
) – The size of resources allocated to this node.image (
NodeImage
) – OS Image to boot on node.location (
NodeLocation
) – Which data center to create a node in. If empty, undefined behavior will be selected. (optional)auth (
NodeAuthSSHKey
) – Initial authentication information for the node (optional)ex_hostname (
str
) – Hostname. Default is ‘localhost’. (optional)ex_username (
str
) – User’s username, which is created. Default is ‘root’. (optional)
- class libcloud.common.upcloud.UpcloudNodeDestroyer(upcloud_node_operations, sleep_func=None)[source]
Bases:
object
Helper class for destroying node. Node must be first stopped and then it can be destroyed
- Parameters:
upcloud_node_operations (
UpcloudNodeOperations
) – UpcloudNodeOperations instancesleep_func (
function
) – Callable function, which sleeps. Takes int argument to sleep in seconds (optional)
- SLEEP_COUNT_TO_TIMEOUT = 20
- WAIT_AMOUNT = 2
- class libcloud.common.upcloud.UpcloudNodeOperations(connection)[source]
Bases:
object
Helper class to start and stop node.
- Parameters:
connection (
UpcloudConnection
) – Connection instance
- exception libcloud.common.upcloud.UpcloudTimeoutException(value: str, driver: BaseDriver | None = None)[source]
Bases:
LibcloudError