2023-08-08 16:17:22 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
|
|
|
|
from ..core import BaseDomain, DomainIdentityMixin
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
from ..locations import Location
|
|
|
|
from ..server_types import BoundServerType
|
2023-07-11 09:15:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Datacenter(BaseDomain, DomainIdentityMixin):
|
|
|
|
"""Datacenter Domain
|
|
|
|
|
|
|
|
:param id: int ID of Datacenter
|
|
|
|
:param name: str Name of Datacenter
|
|
|
|
:param description: str Description of Datacenter
|
|
|
|
:param location: :class:`BoundLocation <hcloud.locations.client.BoundLocation>`
|
|
|
|
:param server_types: :class:`DatacenterServerTypes <hcloud.datacenters.domain.DatacenterServerTypes>`
|
|
|
|
"""
|
|
|
|
|
|
|
|
__slots__ = ("id", "name", "description", "location", "server_types")
|
|
|
|
|
|
|
|
def __init__(
|
2023-08-08 16:17:22 +00:00
|
|
|
self,
|
|
|
|
id: int | None = None,
|
|
|
|
name: str | None = None,
|
|
|
|
description: str | None = None,
|
|
|
|
location: Location | None = None,
|
|
|
|
server_types: DatacenterServerTypes | None = None,
|
2023-07-11 09:15:08 +00:00
|
|
|
):
|
|
|
|
self.id = id
|
|
|
|
self.name = name
|
|
|
|
self.description = description
|
|
|
|
self.location = location
|
|
|
|
self.server_types = server_types
|
|
|
|
|
|
|
|
|
2023-09-25 11:34:49 +00:00
|
|
|
class DatacenterServerTypes(BaseDomain):
|
2023-07-11 09:15:08 +00:00
|
|
|
"""DatacenterServerTypes Domain
|
|
|
|
|
|
|
|
:param available: List[:class:`BoundServerTypes <hcloud.server_types.client.BoundServerTypes>`]
|
|
|
|
All available server types for this datacenter
|
|
|
|
:param supported: List[:class:`BoundServerTypes <hcloud.server_types.client.BoundServerTypes>`]
|
|
|
|
All supported server types for this datacenter
|
|
|
|
:param available_for_migration: List[:class:`BoundServerTypes <hcloud.server_types.client.BoundServerTypes>`]
|
|
|
|
All available for migration (change type) server types for this datacenter
|
|
|
|
"""
|
|
|
|
|
|
|
|
__slots__ = ("available", "supported", "available_for_migration")
|
|
|
|
|
2023-08-08 16:17:22 +00:00
|
|
|
def __init__(
|
|
|
|
self,
|
|
|
|
available: list[BoundServerType],
|
|
|
|
supported: list[BoundServerType],
|
|
|
|
available_for_migration: list[BoundServerType],
|
|
|
|
):
|
2023-07-11 09:15:08 +00:00
|
|
|
self.available = available
|
|
|
|
self.supported = supported
|
|
|
|
self.available_for_migration = available_for_migration
|