How to use the hcloud.core.domain.BaseDomain function in hcloud

To help you get started, we’ve selected a few hcloud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hetznercloud / hcloud-python / hcloud / networks / domain.py View on Github external
servers=None,
            protection=None,
            labels=None,
    ):
        self.id = id
        self.name = name
        self.created = isoparse(created) if created else None
        self.ip_range = ip_range
        self.subnets = subnets
        self.routes = routes
        self.servers = servers
        self.protection = protection
        self.labels = labels


class NetworkSubnet(BaseDomain):
    """Network Subnet Domain

    :param type: str
              Type of sub network.
    :param ip_range: str
              Range to allocate IPs from.
    :param network_zone: str
              Name of network zone.
    :param gateway: str
              Gateway for the route.
    """
    __slots__ = ("type", "ip_range", "network_zone", "gateway")

    def __init__(self, ip_range, type=None, network_zone=None, gateway=None):
        self.type = type
        self.ip_range = ip_range
github hetznercloud / hcloud-python / hcloud / load_balancers / domain.py View on Github external
"""IPv6 Network Domain

    :param ip: str
           The IPv6 Network as CIDR Notation
    """
    __slots__ = (
        "ip",
    )

    def __init__(self,
                 ip,  # type: str
                 ):
        self.ip = ip


class PrivateNet(BaseDomain):
    """PrivateNet Domain

    :param network: :class:`BoundNetwork `
           The Network the LoadBalancer is attached to
    :param ip: str
           The main IP Address of the LoadBalancer in the Network
    """
    __slots__ = (
        "network",
        "ip",
    )

    def __init__(self,
                 network,  # type: BoundNetwork
                 ip,  # type: str
                 ):
github hetznercloud / hcloud-python / hcloud / load_balancers / domain.py View on Github external
self.server = server
        self.label_selector = label_selector
        self.use_private_ip = use_private_ip


class LoadBalancerAlgorithm(BaseDomain):
    """LoadBalancerAlgorithm Domain
                    :param type: str
                            Algorithm of the Load Balancer. Choices: round_robin, least_connections
        """

    def __init__(self, type=None):
        self.type = type


class PublicNetwork(BaseDomain):
    """Public Network Domain

    :param ipv4: :class:`IPv4Address `
    :param ipv6: :class:`IPv6Network `
    :param enabled:  boolean
    """
    __slots__ = (
        "ipv4",
        "ipv6",
        "enabled"
    )

    def __init__(self,
                 ipv4,     # type: IPv4Address
                 ipv6,     # type: IPv6Network
                 enabled,  # type: bool
github hetznercloud / hcloud-python / hcloud / servers / domain.py View on Github external
"ip",
        "blocked",
        "dns_ptr"
    )

    def __init__(self,
                 ip,  # type: str
                 blocked,  # type: bool
                 dns_ptr,  # type: str
                 ):
        self.ip = ip
        self.blocked = blocked
        self.dns_ptr = dns_ptr


class IPv6Network(BaseDomain):
    """IPv6 Network Domain

    :param ip: str
           The IPv6 Network as CIDR Notation
    :param blocked: bool
           Determine if the Network is blocked
    :param dns_ptr: dict
           DNS PTR Records for the Network as Dict
    :param network: str
           The network without the network mask
    :param network_mask: str
           The network mask
    """
    __slots__ = (
        "ip",
        "blocked",
github hetznercloud / hcloud-python / hcloud / load_balancers / domain.py View on Github external
:param retries: int
                    Retries we perform until we assume a target as unhealthy
            :param http: LoadBalancerHealtCheckHttp
                    HTTP Config
            """

    def __init__(self, protocol=None, port=None, interval=None, timeout=None, retries=None, http=None):
        self.protocol = protocol
        self.port = port
        self.interval = interval
        self.timeout = timeout
        self.retries = retries
        self.http = http


class LoadBalancerHealtCheckHttp(BaseDomain):
    """LoadBalancerHealtCheckHttp Domain

                :param domain: str
                        Domain name to send in HTTP request. Can be null: In that case we will not send a domain name
                :param path: str
                        HTTP Path send in Request
                :param response: str
                        Optional HTTP response to receive in order to pass the health check
                :param status_codes: list
                        List of HTTP status codes to receive in order to pass the health check
                :param tls: bool
                        Type of health check
                """

    def __init__(self, domain=None, path=None, response=None, status_codes=None, tls=None):
        self.domain = domain
github hetznercloud / hcloud-python / hcloud / actions / domain.py View on Github external
# -*- coding: utf-8 -*-
from dateutil.parser import isoparse

from hcloud.core.domain import BaseDomain


class Action(BaseDomain):
    """Action Domain

    :param id: int ID of an action
    :param command: Command executed in the action
    :param status: Status of the action
    :param progress: Progress of action in percent
    :param started: Point in time when the action was started
    :param datetime,None finished: Point in time when the action was finished. Only set if the action is finished otherwise None
    :param resources: Resources the action relates to
    :param error: Error message for the action if error occurred, otherwise None.
    """
    STATUS_RUNNING = "running"
    """Action Status running"""
    STATUS_SUCCESS = "success"
    """Action Status success"""
    STATUS_ERROR = "error"
github hetznercloud / hcloud-python / hcloud / servers / domain.py View on Github external
"""
    __slots__ = (
        "action",
        "root_password"
    )

    def __init__(
            self,
            action,  # type: BoundAction
            root_password  # type: str
    ):
        self.action = action
        self.root_password = root_password


class EnableRescueResponse(BaseDomain):
    """Enable Rescue Response Domain

    :param action: :class:`BoundAction `
           Shows the progress of the server enable rescue action
    :param root_password: str
           The root password of the server in the rescue mode
    """
    __slots__ = (
        "action",
        "root_password"
    )

    def __init__(
            self,
            action,  # type: BoundAction
            root_password  # type: str