import * as API from "@distilled.cloud/core/api"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-hetzner/specs/cloud.spec.json). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; import { UnknownHetznerError } from "../errors.ts"; import { paginatePageNumber } from "../pagination.ts"; import { HetznerProtocol, type HetznerOpError, type HetznerOpContext } from "../protocol.ts"; import * as Retry from "../retry.ts"; import * as T from "../traits.ts"; // Schema table, filled on first reach (see __S at the end). const __s: any[] = []; export type { HetznerOpError, HetznerOpContext }; /** Type of the algorithm. */ export type CreateLoadBalancerRequestAlgorithmType = "round_robin" | "least_connections"; /** Algorithm of the Load Balancer. */ export interface CreateLoadBalancerRequestAlgorithm { /** Type of the algorithm. */ type: CreateLoadBalancerRequestAlgorithmType | (string & {}); } /** Protocol of the Load Balancer. */ export type ServiceTCPProtocol = "tcp" | "http" | "https"; /** Type of the health check. */ export type ServiceTCPHealthCheckProtocol = "tcp" | "http"; /** List of returned HTTP status codes in order to pass the health check. Supports the wildcards `?` for exactly one character and `*` for multiple ones. */ export type ServiceTCPHealthCheckHttpStatusCodesList = Array; /** Additional configuration for protocol http. */ export interface ServiceTCPHealthCheckHttp { /** Host header to send in the HTTP request. May not contain spaces, percent or backslash symbols. Can be null, in that case no host header is sent. */ domain: string | null; /** HTTP path to use for health checks. May not contain literal spaces, use percent-encoding instead. */ path: string; /** String that must be contained in HTTP response in order to pass the health check. */ response?: string; /** List of returned HTTP status codes in order to pass the health check. Supports the wildcards `?` for exactly one character and `*` for multiple ones. */ status_codes?: ServiceTCPHealthCheckHttpStatusCodesList; /** Use HTTPS for health check. */ tls?: boolean; } /** Service health check. */ export interface ServiceTCPHealthCheck { /** Type of the health check. */ protocol: ServiceTCPHealthCheckProtocol | (string & {}); /** Port the health check will be performed on. */ port: number; /** Time interval in seconds health checks are performed. */ interval: number; /** Time in seconds after an attempt is considered a timeout. */ timeout: number; /** Unsuccessful retries needed until a target is considered unhealthy; an unhealthy target needs the same number of successful retries to become healthy again. */ retries: number; /** Additional configuration for protocol http. */ http?: ServiceTCPHealthCheckHttp; } export interface ServiceTCP { /** Protocol of the Load Balancer. */ protocol: ServiceTCPProtocol | (string & {}); /** Port the Load Balancer listens on. */ listen_port: number; /** Port the Load Balancer will balance to. */ destination_port: number; /** Is Proxyprotocol enabled or not. */ proxyprotocol: boolean; /** Service health check. */ health_check: ServiceTCPHealthCheck; } /** Protocol of the Load Balancer. */ export type ServiceHTTPProtocolProtocol = "tcp" | "http" | "https"; /** Type of the health check. */ export type ServiceHTTPProtocolHealthCheckProtocol = "tcp" | "http"; /** List of returned HTTP status codes in order to pass the health check. Supports the wildcards `?` for exactly one character and `*` for multiple ones. */ export type ServiceHTTPProtocolHealthCheckHttpStatusCodesList = Array; /** Additional configuration for protocol http. */ export interface ServiceHTTPProtocolHealthCheckHttp { /** Host header to send in the HTTP request. May not contain spaces, percent or backslash symbols. Can be null, in that case no host header is sent. */ domain: string | null; /** HTTP path to use for health checks. May not contain literal spaces, use percent-encoding instead. */ path: string; /** String that must be contained in HTTP response in order to pass the health check. */ response?: string; /** List of returned HTTP status codes in order to pass the health check. Supports the wildcards `?` for exactly one character and `*` for multiple ones. */ status_codes?: ServiceHTTPProtocolHealthCheckHttpStatusCodesList; /** Use HTTPS for health check. */ tls?: boolean; } /** Service health check. */ export interface ServiceHTTPProtocolHealthCheck { /** Type of the health check. */ protocol: ServiceHTTPProtocolHealthCheckProtocol | (string & {}); /** Port the health check will be performed on. */ port: number; /** Time interval in seconds health checks are performed. */ interval: number; /** Time in seconds after an attempt is considered a timeout. */ timeout: number; /** Unsuccessful retries needed until a target is considered unhealthy; an unhealthy target needs the same number of successful retries to become healthy again. */ retries: number; /** Additional configuration for protocol http. */ http?: ServiceHTTPProtocolHealthCheckHttp; } /** Configuration option for protocol http. */ export interface ServiceHTTPProtocolHttp { /** Name of the cookie used for sticky sessions. */ cookie_name: string; /** Lifetime of the cookie used for sticky sessions (in seconds). */ cookie_lifetime: number; /** Idle timeout in seconds for the client and server side. */ timeout_idle: number; /** Use sticky sessions. */ sticky_sessions: boolean; } export interface ServiceHTTPProtocol { /** Protocol of the Load Balancer. */ protocol: ServiceHTTPProtocolProtocol | (string & {}); /** Port the Load Balancer listens on. */ listen_port: number; /** Port the Load Balancer will balance to. */ destination_port: number; /** Is Proxyprotocol enabled or not. */ proxyprotocol: boolean; /** Service health check. */ health_check: ServiceHTTPProtocolHealthCheck; /** Configuration option for protocol http. */ http: ServiceHTTPProtocolHttp; } /** Protocol of the Load Balancer. */ export type ServiceHTTPSProtocolProtocol = "tcp" | "http" | "https"; /** Type of the health check. */ export type ServiceHTTPSProtocolHealthCheckProtocol = "tcp" | "http"; /** List of returned HTTP status codes in order to pass the health check. Supports the wildcards `?` for exactly one character and `*` for multiple ones. */ export type ServiceHTTPSProtocolHealthCheckHttpStatusCodesList = Array; /** Additional configuration for protocol http. */ export interface ServiceHTTPSProtocolHealthCheckHttp { /** Host header to send in the HTTP request. May not contain spaces, percent or backslash symbols. Can be null, in that case no host header is sent. */ domain: string | null; /** HTTP path to use for health checks. May not contain literal spaces, use percent-encoding instead. */ path: string; /** String that must be contained in HTTP response in order to pass the health check. */ response?: string; /** List of returned HTTP status codes in order to pass the health check. Supports the wildcards `?` for exactly one character and `*` for multiple ones. */ status_codes?: ServiceHTTPSProtocolHealthCheckHttpStatusCodesList; /** Use HTTPS for health check. */ tls?: boolean; } /** Service health check. */ export interface ServiceHTTPSProtocolHealthCheck { /** Type of the health check. */ protocol: ServiceHTTPSProtocolHealthCheckProtocol | (string & {}); /** Port the health check will be performed on. */ port: number; /** Time interval in seconds health checks are performed. */ interval: number; /** Time in seconds after an attempt is considered a timeout. */ timeout: number; /** Unsuccessful retries needed until a target is considered unhealthy; an unhealthy target needs the same number of successful retries to become healthy again. */ retries: number; /** Additional configuration for protocol http. */ http?: ServiceHTTPSProtocolHealthCheckHttp; } /** IDs of the Certificates to use for TLS/SSL termination by the Load Balancer; empty for TLS/SSL passthrough. */ export type ServiceHTTPSProtocolHttpCertificatesList = Array; /** Configuration option for protocol https. */ export interface ServiceHTTPSProtocolHttp { /** Name of the cookie used for sticky sessions. */ cookie_name: string; /** Lifetime of the cookie used for sticky sessions (in seconds). */ cookie_lifetime: number; /** Idle timeout in seconds for the client and server side. */ timeout_idle: number; /** IDs of the Certificates to use for TLS/SSL termination by the Load Balancer; empty for TLS/SSL passthrough. */ certificates: ServiceHTTPSProtocolHttpCertificatesList; /** Redirect HTTP requests to HTTPS. */ redirect_http: boolean; /** Use sticky sessions. */ sticky_sessions: boolean; } export interface ServiceHTTPSProtocol { /** Protocol of the Load Balancer. */ protocol: ServiceHTTPSProtocolProtocol | (string & {}); /** Port the Load Balancer listens on. */ listen_port: number; /** Port the Load Balancer will balance to. */ destination_port: number; /** Is Proxyprotocol enabled or not. */ proxyprotocol: boolean; /** Service health check. */ health_check: ServiceHTTPSProtocolHealthCheck; /** Configuration option for protocol https. */ http: ServiceHTTPSProtocolHttp; } export type CreateLoadBalancerRequestServicesItem = | ServiceTCP | ServiceHTTPProtocol | ServiceHTTPSProtocol; /** Array of services. */ export type CreateLoadBalancerRequestServicesList = Array; /** Type of the resource. */ export type CreateLoadBalancerRequestTargetsItemType = "server" | "label_selector" | "ip"; /** Configuration for type Server, only valid and required if type is `server`. */ export interface CreateLoadBalancerRequestTargetsItemServer { /** ID of the Server. */ id: number; /** Optional public IP of the Server to use as target. Must be the Primary IPv4 of the Server, or an IPv6 host address within IPv6 /64 subnet of the Server. If omitted, the Primary IPv4 of the Server is used. Must not be a private IP and is only valid for public targets. */ ip?: string; } /** Configuration for label selector targets, only valid and required if type is `label_selector`. */ export interface CreateLoadBalancerRequestTargetsItemLabelSelector { /** Label selector. */ selector: string; } /** Configuration for an IP target. It is only possible to use the (Public or vSwitch) IPs of Hetzner Online Root Servers belonging to the project owner. IPs belonging to other users are blocked. Additionally IPs belonging to services provided by Hetzner Cloud (Servers, Load Balancers, ...) are blocked as well. Only valid and required if type is `ip`. */ export interface CreateLoadBalancerRequestTargetsItemIp { /** IP of a server that belongs to the same customer (public IPv4/IPv6) or private IP in a subnet type vswitch. */ ip: string; } export interface CreateLoadBalancerRequestTargetsItem { /** Type of the resource. */ type: CreateLoadBalancerRequestTargetsItemType | (string & {}); /** Configuration for type Server, only valid and required if type is `server`. */ server?: CreateLoadBalancerRequestTargetsItemServer; /** Configuration for label selector targets, only valid and required if type is `label_selector`. */ label_selector?: CreateLoadBalancerRequestTargetsItemLabelSelector; /** Configuration for an IP target. It is only possible to use the (Public or vSwitch) IPs of Hetzner Online Root Servers belonging to the project owner. IPs belonging to other users are blocked. Additionally IPs belonging to services provided by Hetzner Cloud (Servers, Load Balancers, ...) are blocked as well. Only valid and required if type is `ip`. */ ip?: CreateLoadBalancerRequestTargetsItemIp; /** Use the private network IP instead of the public IP of the Server, requires the Server and Load Balancer to be in the same network. Only valid for target types `server` and `label_selector`. */ use_private_ip?: boolean; } /** Array of targets. */ export type CreateLoadBalancerRequestTargetsList = Array; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreateLoadBalancerRequestLabelsMap = { [key: string]: string | undefined }; export interface CreateLoadBalancerRequest { /** Name of the Load Balancer. */ name: string; /** ID or name of the Load Balancer type this Load Balancer should be created with. */ load_balancer_type: string; /** Algorithm of the Load Balancer. */ algorithm?: CreateLoadBalancerRequestAlgorithm; /** Array of services. */ services?: CreateLoadBalancerRequestServicesList; /** Array of targets. */ targets?: CreateLoadBalancerRequestTargetsList; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: CreateLoadBalancerRequestLabelsMap; /** Enable or disable the public interface of the Load Balancer. */ public_interface?: boolean; /** ID of the network the Load Balancer should be attached to on creation. */ network?: number; /** Name of network zone. */ network_zone?: string; /** ID or name of Location to create Load Balancer in. */ location?: string; } /** IP address (v4). */ export interface CreateLoadBalancerResponseLoadBalancerPublicNetIpv4 { /** IP address (v4) of this Load Balancer. */ ip: string | null; /** Reverse DNS PTR entry for the IPv4 address of this Load Balancer. */ dns_ptr: string | null; } /** IP address (v6). */ export interface CreateLoadBalancerResponseLoadBalancerPublicNetIpv6 { /** IP address (v6) of this Load Balancer. */ ip: string | null; /** Reverse DNS PTR entry for the IPv6 address of this Load Balancer. */ dns_ptr: string | null; } /** Public network information. */ export interface CreateLoadBalancerResponseLoadBalancerPublicNet { /** Public Interface enabled or not. */ enabled: boolean; /** IP address (v4). */ ipv4: CreateLoadBalancerResponseLoadBalancerPublicNetIpv4; /** IP address (v6). */ ipv6: CreateLoadBalancerResponseLoadBalancerPublicNetIpv6; } export interface CreateLoadBalancerResponseLoadBalancerPrivateNetItem { /** ID of the Network. */ network: number; /** IP address (v4) of this Load Balancer in this Network. */ ip: string; } /** Private networks information. */ export type CreateLoadBalancerResponseLoadBalancerPrivateNetList = Array; export interface CreateLoadBalancerResponseLoadBalancerLocation { /** ID of the [Location](#tag/locations). */ id: number; /** Unique identifier of the [Location](#tag/locations). */ name: string; /** Human readable description of the [Location](#tag/locations). */ description: string; /** Country the [Location](#tag/locations) resides in. ISO 3166-1 alpha-2 code of the country. */ country: string; /** Name of the closest city to the [Location](#tag/locations). City name or city name and state in short form. E.g. `Falkenstein` or `Ashburn, VA`. */ city: string; /** Latitude of the city closest to the [Location](#tag/locations). */ latitude: number; /** Longitude of the city closest to the [Location](#tag/locations). */ longitude: number; /** Name of the Network Zone this [Location](#tag/locations) resides in. */ network_zone: string; } /** Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated. */ export interface CreateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation { /** Date of the deprecated resource removal. Once this date is reached, the resource will not be returned by resource type "list" endpoint, and the resource can not be used to create new resources. For example, if this is an image, you can not create new servers with this image after the mentioned date. */ unavailable_after: string; /** Date of the deprecation announcement. */ announced: string; } /** Hourly price in this [Location](#tag/locations). */ export interface CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly { /** Price without VAT. */ net: string; /** Price with VAT added. */ gross: string; } /** Monthly price in this [Location](#tag/locations). */ export type CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceMonthly = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; /** Additional traffic price per TB in this [Location](#tag/locations). */ export type CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPricePerTbTraffic = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; export interface CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItem { /** Name of the [Location](#tag/locations) the price is for. */ location: string; /** Hourly price in this [Location](#tag/locations). */ price_hourly: CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; /** Monthly price in this [Location](#tag/locations). */ price_monthly: CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; /** Free traffic per month in bytes in this [Location](#tag/locations). */ included_traffic: number; /** Additional traffic price per TB in this [Location](#tag/locations). */ price_per_tb_traffic: CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; } /** Price per [Location](#tag/locations). */ export type CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesList = Array; export interface CreateLoadBalancerResponseLoadBalancerLoadBalancerType { /** ID of the Load Balancer type. */ id: number; /** Unique identifier of the Load Balancer type. */ name: string; /** Description of the Load Balancer type. */ description: string; /** Number of maximum simultaneous open connections. */ max_connections: number; /** Number of services a Load Balancer of this type can have. */ max_services: number; /** Number of targets a single Load Balancer can have. */ max_targets: number; /** Number of SSL Certificates that can be assigned to a single Load Balancer. */ max_assigned_certificates: number; /** **Deprecated:** This field is deprecated. Use the `deprecation` object instead. Point in time when the Load Balancer type is deprecated (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ deprecated: string | null; /** Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated. */ deprecation: CreateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation | null; /** Price per [Location](#tag/locations). */ prices: CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesList; } /** Protection configuration for the Resource. */ export interface CreateLoadBalancerResponseLoadBalancerProtection { /** Prevent the Resource from being deleted. */ delete: boolean; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreateLoadBalancerResponseLoadBalancerLabelsMap = { [key: string]: string | undefined }; export type CreateLoadBalancerResponseLoadBalancerServicesItem = | ServiceTCP | ServiceHTTPProtocol | ServiceHTTPSProtocol; /** List of services that belong to this Load Balancer. */ export type CreateLoadBalancerResponseLoadBalancerServicesList = Array; /** Type of the resource. */ export type TargetTypeServerType = "server" | "label_selector" | "ip"; /** Server where the traffic should be routed to. Only present for target type "server". */ export interface TargetTypeServerServer { /** ID of the Server. */ id: number; /** IP of the Server that the traffic is routed to. Either the Server's primary IPv4 or, if an IPv6 was specified when adding the target, an IPv6 within the Server's /64 subnet. */ ip: string; } export type TargetTypeServerHealthStatusItemStatus = "healthy" | "unhealthy" | "unknown"; /** Additional details about why the health check failed. Only present when `status` is `unhealthy`. */ export type TargetTypeServerHealthStatusItemDetail = | "unspecified" | "layer4_no_connection" | "layer4_timeout" | "layer7_timeout" | "unexpected_http_status" | "unexpected_http_content"; export interface TargetTypeServerHealthStatusItem { listen_port: number; status: TargetTypeServerHealthStatusItemStatus; /** Additional details about why the health check failed. Only present when `status` is `unhealthy`. */ detail?: TargetTypeServerHealthStatusItemDetail; /** HTTP status code returned by the target during the last health check. Only present when `status` is `unhealthy` and `detail` is `unexpected_http_status`. */ http_status_code?: number; } /** List of health statuses of the services on this target. Only present for target types "server" and "ip". */ export type TargetTypeServerHealthStatusList = Array; export interface TargetTypeServer { /** Type of the resource. */ type: TargetTypeServerType; /** Server where the traffic should be routed to. Only present for target type "server". */ server: TargetTypeServerServer; /** List of health statuses of the services on this target. Only present for target types "server" and "ip". */ health_status: TargetTypeServerHealthStatusList; /** Use the private network IP instead of the public IP. Only present for target types "server" and "label_selector". */ use_private_ip: boolean; } /** Type of the resource. */ export type TargetTypeLabelSelectorType = "server" | "label_selector" | "ip"; /** Label selector used to determine targets. Only present for target type "label_selector". */ export type TargetTypeLabelSelectorLabelSelector = CreateLoadBalancerRequestTargetsItemLabelSelector; /** Server where the traffic should be routed to. Only present for target type "server". */ export type TargetTypeLabelSelectorTargetsItemServer = TargetTypeServerServer; export type TargetTypeLabelSelectorTargetsItemHealthStatusItemStatus = | "healthy" | "unhealthy" | "unknown"; /** Additional details about why the health check failed. Only present when `status` is `unhealthy`. */ export type TargetTypeLabelSelectorTargetsItemHealthStatusItemDetail = | "unspecified" | "layer4_no_connection" | "layer4_timeout" | "layer7_timeout" | "unexpected_http_status" | "unexpected_http_content"; export interface TargetTypeLabelSelectorTargetsItemHealthStatusItem { listen_port: number; status: TargetTypeLabelSelectorTargetsItemHealthStatusItemStatus; /** Additional details about why the health check failed. Only present when `status` is `unhealthy`. */ detail?: TargetTypeLabelSelectorTargetsItemHealthStatusItemDetail; /** HTTP status code returned by the target during the last health check. Only present when `status` is `unhealthy` and `detail` is `unexpected_http_status`. */ http_status_code?: number; } /** List of health statuses of the services on this target. Only present for target types "server" and "ip". */ export type TargetTypeLabelSelectorTargetsItemHealthStatusList = Array; export interface TargetTypeLabelSelectorTargetsItem { /** Type of the resource. Here always "server". */ type: string; /** Server where the traffic should be routed to. Only present for target type "server". */ server: TargetTypeServerServer; /** List of health statuses of the services on this target. Only present for target types "server" and "ip". */ health_status: TargetTypeLabelSelectorTargetsItemHealthStatusList; /** Use the private network IP instead of the public IP. Only present for target types "server" and "label_selector". */ use_private_ip: boolean; } /** List of resolved label selector target Servers. */ export type TargetTypeLabelSelectorTargetsList = Array; export interface TargetTypeLabelSelector { /** Type of the resource. */ type: TargetTypeLabelSelectorType; /** Label selector used to determine targets. Only present for target type "label_selector". */ label_selector: CreateLoadBalancerRequestTargetsItemLabelSelector; /** List of resolved label selector target Servers. */ targets: TargetTypeLabelSelectorTargetsList; /** Use the private network IP instead of the public IP. Only present for target types "server" and "label_selector". */ use_private_ip: boolean; } /** Type of the resource. */ export type TargetTypeIPType = "server" | "label_selector" | "ip"; /** IP target where the traffic should be routed to. It is only possible to use the (Public or vSwitch) IPs of Hetzner Online Root Servers belonging to the project owner. IPs belonging to other users are blocked. Additionally IPs belonging to services provided by Hetzner Cloud (Servers, Load Balancers, ...) are blocked as well. Only present for target type `ip`. */ export type TargetTypeIPIp = CreateLoadBalancerRequestTargetsItemIp; export type TargetTypeIPHealthStatusItemStatus = "healthy" | "unhealthy" | "unknown"; /** Additional details about why the health check failed. Only present when `status` is `unhealthy`. */ export type TargetTypeIPHealthStatusItemDetail = | "unspecified" | "layer4_no_connection" | "layer4_timeout" | "layer7_timeout" | "unexpected_http_status" | "unexpected_http_content"; export interface TargetTypeIPHealthStatusItem { listen_port: number; status: TargetTypeIPHealthStatusItemStatus; /** Additional details about why the health check failed. Only present when `status` is `unhealthy`. */ detail?: TargetTypeIPHealthStatusItemDetail; /** HTTP status code returned by the target during the last health check. Only present when `status` is `unhealthy` and `detail` is `unexpected_http_status`. */ http_status_code?: number; } /** List of health statuses of the services on this target. Only present for target types "server" and "ip". */ export type TargetTypeIPHealthStatusList = Array; export interface TargetTypeIP { /** Type of the resource. */ type: TargetTypeIPType; /** IP target where the traffic should be routed to. It is only possible to use the (Public or vSwitch) IPs of Hetzner Online Root Servers belonging to the project owner. IPs belonging to other users are blocked. Additionally IPs belonging to services provided by Hetzner Cloud (Servers, Load Balancers, ...) are blocked as well. Only present for target type `ip`. */ ip: CreateLoadBalancerRequestTargetsItemIp; /** List of health statuses of the services on this target. Only present for target types "server" and "ip". */ health_status: TargetTypeIPHealthStatusList; } export type CreateLoadBalancerResponseLoadBalancerTargetsItem = | TargetTypeServer | TargetTypeLabelSelector | TargetTypeIP; /** List of targets that belong to this Load Balancer. */ export type CreateLoadBalancerResponseLoadBalancerTargetsList = Array; /** Type of the algorithm. */ export type CreateLoadBalancerResponseLoadBalancerAlgorithmType = | "round_robin" | "least_connections"; /** Algorithm of the Load Balancer. */ export interface CreateLoadBalancerResponseLoadBalancerAlgorithm { /** Type of the algorithm. */ type: CreateLoadBalancerResponseLoadBalancerAlgorithmType; } export interface CreateLoadBalancerResponseLoadBalancer { /** ID of the [Load Balancer](#tag/load-balancers). */ id: number; /** Name of the Resource. Must be unique per Project. */ name: string; /** Public network information. */ public_net: CreateLoadBalancerResponseLoadBalancerPublicNet; /** Private networks information. */ private_net: CreateLoadBalancerResponseLoadBalancerPrivateNetList; location: CreateLoadBalancerResponseLoadBalancerLocation; load_balancer_type: CreateLoadBalancerResponseLoadBalancerLoadBalancerType; /** Protection configuration for the Resource. */ protection: CreateLoadBalancerResponseLoadBalancerProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: CreateLoadBalancerResponseLoadBalancerLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** List of services that belong to this Load Balancer. */ services: CreateLoadBalancerResponseLoadBalancerServicesList; /** List of targets that belong to this Load Balancer. */ targets: CreateLoadBalancerResponseLoadBalancerTargetsList; /** Algorithm of the Load Balancer. */ algorithm: CreateLoadBalancerResponseLoadBalancerAlgorithm; /** Outbound Traffic for the current billing period in bytes. */ outgoing_traffic: number | null; /** Inbound Traffic for the current billing period in bytes. */ ingoing_traffic: number | null; /** Free Traffic for the current billing period in bytes. */ included_traffic: number; } /** Status of the Action. */ export type CreateLoadBalancerResponseActionStatus = "running" | "success" | "error"; export interface CreateLoadBalancerResponseActionResourcesItem { /** ID of the Resource. */ id: number; /** Type of the Resource. */ type: string; } /** Resources the Action relates to. */ export type CreateLoadBalancerResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export interface CreateLoadBalancerResponseActionError { /** Fixed error code for machines. */ code: string; /** Error message for humans. */ message: string; } export interface CreateLoadBalancerResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: CreateLoadBalancerResponseActionStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: CreateLoadBalancerResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: CreateLoadBalancerResponseActionError | null; } export interface CreateLoadBalancerResponse { load_balancer: CreateLoadBalancerResponseLoadBalancer; action: CreateLoadBalancerResponseAction; } export interface DeleteLoadBalancerRequest { /** ID of the Load Balancer. */ id: number; } export interface DeleteLoadBalancerResponse {} export interface GetLoadBalancerRequest { /** ID of the Load Balancer. */ id: number; } /** IP address (v4). */ export type GetLoadBalancerResponseLoadBalancerPublicNetIpv4 = CreateLoadBalancerResponseLoadBalancerPublicNetIpv4; /** IP address (v6). */ export type GetLoadBalancerResponseLoadBalancerPublicNetIpv6 = CreateLoadBalancerResponseLoadBalancerPublicNetIpv6; /** Public network information. */ export type GetLoadBalancerResponseLoadBalancerPublicNet = CreateLoadBalancerResponseLoadBalancerPublicNet; export type GetLoadBalancerResponseLoadBalancerPrivateNetItem = CreateLoadBalancerResponseLoadBalancerPrivateNetItem; /** Private networks information. */ export type GetLoadBalancerResponseLoadBalancerPrivateNetList = Array; export type GetLoadBalancerResponseLoadBalancerLocation = CreateLoadBalancerResponseLoadBalancerLocation; /** Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated. */ export type GetLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation; /** Hourly price in this [Location](#tag/locations). */ export type GetLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; /** Monthly price in this [Location](#tag/locations). */ export type GetLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceMonthly = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; /** Additional traffic price per TB in this [Location](#tag/locations). */ export type GetLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPricePerTbTraffic = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; export type GetLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItem = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItem; /** Price per [Location](#tag/locations). */ export type GetLoadBalancerResponseLoadBalancerLoadBalancerTypePricesList = Array; export interface GetLoadBalancerResponseLoadBalancerLoadBalancerType { /** ID of the Load Balancer type. */ id: number; /** Unique identifier of the Load Balancer type. */ name: string; /** Description of the Load Balancer type. */ description: string; /** Number of maximum simultaneous open connections. */ max_connections: number; /** Number of services a Load Balancer of this type can have. */ max_services: number; /** Number of targets a single Load Balancer can have. */ max_targets: number; /** Number of SSL Certificates that can be assigned to a single Load Balancer. */ max_assigned_certificates: number; /** **Deprecated:** This field is deprecated. Use the `deprecation` object instead. Point in time when the Load Balancer type is deprecated (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ deprecated: string | null; /** Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated. */ deprecation: CreateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation | null; /** Price per [Location](#tag/locations). */ prices: GetLoadBalancerResponseLoadBalancerLoadBalancerTypePricesList; } /** Protection configuration for the Resource. */ export type GetLoadBalancerResponseLoadBalancerProtection = CreateLoadBalancerResponseLoadBalancerProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type GetLoadBalancerResponseLoadBalancerLabelsMap = { [key: string]: string | undefined }; export type GetLoadBalancerResponseLoadBalancerServicesItem = | ServiceTCP | ServiceHTTPProtocol | ServiceHTTPSProtocol; /** List of services that belong to this Load Balancer. */ export type GetLoadBalancerResponseLoadBalancerServicesList = Array; export type GetLoadBalancerResponseLoadBalancerTargetsItem = | TargetTypeServer | TargetTypeLabelSelector | TargetTypeIP; /** List of targets that belong to this Load Balancer. */ export type GetLoadBalancerResponseLoadBalancerTargetsList = Array; /** Type of the algorithm. */ export type GetLoadBalancerResponseLoadBalancerAlgorithmType = "round_robin" | "least_connections"; /** Algorithm of the Load Balancer. */ export interface GetLoadBalancerResponseLoadBalancerAlgorithm { /** Type of the algorithm. */ type: GetLoadBalancerResponseLoadBalancerAlgorithmType; } export interface GetLoadBalancerResponseLoadBalancer { /** ID of the [Load Balancer](#tag/load-balancers). */ id: number; /** Name of the Resource. Must be unique per Project. */ name: string; /** Public network information. */ public_net: CreateLoadBalancerResponseLoadBalancerPublicNet; /** Private networks information. */ private_net: GetLoadBalancerResponseLoadBalancerPrivateNetList; location: CreateLoadBalancerResponseLoadBalancerLocation; load_balancer_type: GetLoadBalancerResponseLoadBalancerLoadBalancerType; /** Protection configuration for the Resource. */ protection: CreateLoadBalancerResponseLoadBalancerProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: GetLoadBalancerResponseLoadBalancerLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** List of services that belong to this Load Balancer. */ services: GetLoadBalancerResponseLoadBalancerServicesList; /** List of targets that belong to this Load Balancer. */ targets: GetLoadBalancerResponseLoadBalancerTargetsList; /** Algorithm of the Load Balancer. */ algorithm: GetLoadBalancerResponseLoadBalancerAlgorithm; /** Outbound Traffic for the current billing period in bytes. */ outgoing_traffic: number | null; /** Inbound Traffic for the current billing period in bytes. */ ingoing_traffic: number | null; /** Free Traffic for the current billing period in bytes. */ included_traffic: number; } export interface GetLoadBalancerResponse { load_balancer: GetLoadBalancerResponseLoadBalancer; } export type GetLoadBalancerMetricsRequestTypeItem = | "open_connections" | "connections_per_second" | "requests_per_second" | "bandwidth"; export type GetLoadBalancerMetricsRequestTypeList = Array< GetLoadBalancerMetricsRequestTypeItem | (string & {}) >; export interface GetLoadBalancerMetricsRequest { /** ID of the Load Balancer. */ id: number; /** Type of metrics to get. */ type: GetLoadBalancerMetricsRequestTypeList; /** Start of period to get Metrics for (must be in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ start: string; /** End of period to get Metrics for (must be in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ end: string; /** Resolution of results in seconds. */ step?: string; } export type GetLoadBalancerMetricsResponseMetricsTimeSeriesValueValuesItemList = Array; /** Metrics timestamps with values. */ export type GetLoadBalancerMetricsResponseMetricsTimeSeriesValueValuesList = Array; export interface GetLoadBalancerMetricsResponseMetricsTimeSeriesValue { /** Metrics timestamps with values. */ values: GetLoadBalancerMetricsResponseMetricsTimeSeriesValueValuesList; } /** Hash with timeseries information, containing the name of timeseries as key. */ export type GetLoadBalancerMetricsResponseMetricsTimeSeriesMap = { [key: string]: GetLoadBalancerMetricsResponseMetricsTimeSeriesValue | undefined; }; export interface GetLoadBalancerMetricsResponseMetrics { /** Start of period of metrics reported (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ start: string; /** End of period of metrics reported (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ end: string; /** Resolution of results in seconds. */ step: number; /** Hash with timeseries information, containing the name of timeseries as key. */ time_series: GetLoadBalancerMetricsResponseMetricsTimeSeriesMap; } export interface GetLoadBalancerMetricsResponse { metrics: GetLoadBalancerMetricsResponseMetrics; } export type ListLoadBalancersRequestSortItem = | "id" | "id:asc" | "id:desc" | "name" | "name:asc" | "name:desc" | "created" | "created:asc" | "created:desc"; export type ListLoadBalancersRequestSortList = Array< ListLoadBalancersRequestSortItem | (string & {}) >; export interface ListLoadBalancersRequest { /** Sort resources by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListLoadBalancersRequestSortList; /** Filter resources by their name. The response will only contain the resources matching exactly the specified name. */ name?: string; /** Filter resources by labels. The response will only contain resources matching the label selector. For more information, see "[Label Selector](#description/label-selector)". */ label_selector?: string; /** Page number to return. For more information, see "[Pagination](#description/pagination)". */ page?: number; /** Maximum number of entries returned per page. For more information, see "[Pagination](#description/pagination)". */ per_page?: number; } /** IP address (v4). */ export type ListLoadBalancersResponseLoadBalancersItemPublicNetIpv4 = CreateLoadBalancerResponseLoadBalancerPublicNetIpv4; /** IP address (v6). */ export type ListLoadBalancersResponseLoadBalancersItemPublicNetIpv6 = CreateLoadBalancerResponseLoadBalancerPublicNetIpv6; /** Public network information. */ export type ListLoadBalancersResponseLoadBalancersItemPublicNet = CreateLoadBalancerResponseLoadBalancerPublicNet; export type ListLoadBalancersResponseLoadBalancersItemPrivateNetItem = CreateLoadBalancerResponseLoadBalancerPrivateNetItem; /** Private networks information. */ export type ListLoadBalancersResponseLoadBalancersItemPrivateNetList = Array; export type ListLoadBalancersResponseLoadBalancersItemLocation = CreateLoadBalancerResponseLoadBalancerLocation; /** Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated. */ export type ListLoadBalancersResponseLoadBalancersItemLoadBalancerTypeDeprecation = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation; /** Hourly price in this [Location](#tag/locations). */ export type ListLoadBalancersResponseLoadBalancersItemLoadBalancerTypePricesItemPriceHourly = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; /** Monthly price in this [Location](#tag/locations). */ export type ListLoadBalancersResponseLoadBalancersItemLoadBalancerTypePricesItemPriceMonthly = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; /** Additional traffic price per TB in this [Location](#tag/locations). */ export type ListLoadBalancersResponseLoadBalancersItemLoadBalancerTypePricesItemPricePerTbTraffic = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; export type ListLoadBalancersResponseLoadBalancersItemLoadBalancerTypePricesItem = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItem; /** Price per [Location](#tag/locations). */ export type ListLoadBalancersResponseLoadBalancersItemLoadBalancerTypePricesList = Array; export interface ListLoadBalancersResponseLoadBalancersItemLoadBalancerType { /** ID of the Load Balancer type. */ id: number; /** Unique identifier of the Load Balancer type. */ name: string; /** Description of the Load Balancer type. */ description: string; /** Number of maximum simultaneous open connections. */ max_connections: number; /** Number of services a Load Balancer of this type can have. */ max_services: number; /** Number of targets a single Load Balancer can have. */ max_targets: number; /** Number of SSL Certificates that can be assigned to a single Load Balancer. */ max_assigned_certificates: number; /** **Deprecated:** This field is deprecated. Use the `deprecation` object instead. Point in time when the Load Balancer type is deprecated (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ deprecated: string | null; /** Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated. */ deprecation: CreateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation | null; /** Price per [Location](#tag/locations). */ prices: ListLoadBalancersResponseLoadBalancersItemLoadBalancerTypePricesList; } /** Protection configuration for the Resource. */ export type ListLoadBalancersResponseLoadBalancersItemProtection = CreateLoadBalancerResponseLoadBalancerProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type ListLoadBalancersResponseLoadBalancersItemLabelsMap = { [key: string]: string | undefined; }; export type ListLoadBalancersResponseLoadBalancersItemServicesItem = | ServiceTCP | ServiceHTTPProtocol | ServiceHTTPSProtocol; /** List of services that belong to this Load Balancer. */ export type ListLoadBalancersResponseLoadBalancersItemServicesList = Array; export type ListLoadBalancersResponseLoadBalancersItemTargetsItem = | TargetTypeServer | TargetTypeLabelSelector | TargetTypeIP; /** List of targets that belong to this Load Balancer. */ export type ListLoadBalancersResponseLoadBalancersItemTargetsList = Array; /** Type of the algorithm. */ export type ListLoadBalancersResponseLoadBalancersItemAlgorithmType = | "round_robin" | "least_connections"; /** Algorithm of the Load Balancer. */ export interface ListLoadBalancersResponseLoadBalancersItemAlgorithm { /** Type of the algorithm. */ type: ListLoadBalancersResponseLoadBalancersItemAlgorithmType; } export interface ListLoadBalancersResponseLoadBalancersItem { /** ID of the [Load Balancer](#tag/load-balancers). */ id: number; /** Name of the Resource. Must be unique per Project. */ name: string; /** Public network information. */ public_net: CreateLoadBalancerResponseLoadBalancerPublicNet; /** Private networks information. */ private_net: ListLoadBalancersResponseLoadBalancersItemPrivateNetList; location: CreateLoadBalancerResponseLoadBalancerLocation; load_balancer_type: ListLoadBalancersResponseLoadBalancersItemLoadBalancerType; /** Protection configuration for the Resource. */ protection: CreateLoadBalancerResponseLoadBalancerProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: ListLoadBalancersResponseLoadBalancersItemLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** List of services that belong to this Load Balancer. */ services: ListLoadBalancersResponseLoadBalancersItemServicesList; /** List of targets that belong to this Load Balancer. */ targets: ListLoadBalancersResponseLoadBalancersItemTargetsList; /** Algorithm of the Load Balancer. */ algorithm: ListLoadBalancersResponseLoadBalancersItemAlgorithm; /** Outbound Traffic for the current billing period in bytes. */ outgoing_traffic: number | null; /** Inbound Traffic for the current billing period in bytes. */ ingoing_traffic: number | null; /** Free Traffic for the current billing period in bytes. */ included_traffic: number; } export type ListLoadBalancersResponseLoadBalancersList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export interface ListLoadBalancersResponseMetaPagination { /** Current page number. */ page: number; /** Maximum number of entries returned per page. */ per_page: number; /** Page number of the previous page. Can be null if the current page is the first one. */ previous_page: number | null; /** Page number of the next page. Can be null if the current page is the last one. */ next_page: number | null; /** Page number of the last page available. Can be null if the current page is the last one. */ last_page: number | null; /** Total number of entries that exist for this query. Can be null if unknown. */ total_entries: number | null; } export interface ListLoadBalancersResponseMeta { /** See "[Pagination](#description/pagination)" for more information. */ pagination: ListLoadBalancersResponseMetaPagination; } export interface ListLoadBalancersResponse { load_balancers: ListLoadBalancersResponseLoadBalancersList; meta: ListLoadBalancersResponseMeta; } /** User-defined labels (`key/value` pairs) for the Resource. Note that the set of [Labels](#description/labels) provided in the request will overwrite the existing one. For more information, see "[Labels](#description/labels)". */ export type UpdateLoadBalancerRequestLabelsMap = { [key: string]: string | undefined }; export interface UpdateLoadBalancerRequest { /** ID of the Load Balancer. */ id: number; /** New Load Balancer name. */ name?: string; /** User-defined labels (`key/value` pairs) for the Resource. Note that the set of [Labels](#description/labels) provided in the request will overwrite the existing one. For more information, see "[Labels](#description/labels)". */ labels?: UpdateLoadBalancerRequestLabelsMap; } /** IP address (v4). */ export type UpdateLoadBalancerResponseLoadBalancerPublicNetIpv4 = CreateLoadBalancerResponseLoadBalancerPublicNetIpv4; /** IP address (v6). */ export type UpdateLoadBalancerResponseLoadBalancerPublicNetIpv6 = CreateLoadBalancerResponseLoadBalancerPublicNetIpv6; /** Public network information. */ export type UpdateLoadBalancerResponseLoadBalancerPublicNet = CreateLoadBalancerResponseLoadBalancerPublicNet; export type UpdateLoadBalancerResponseLoadBalancerPrivateNetItem = CreateLoadBalancerResponseLoadBalancerPrivateNetItem; /** Private networks information. */ export type UpdateLoadBalancerResponseLoadBalancerPrivateNetList = Array; export type UpdateLoadBalancerResponseLoadBalancerLocation = CreateLoadBalancerResponseLoadBalancerLocation; /** Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated. */ export type UpdateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation; /** Hourly price in this [Location](#tag/locations). */ export type UpdateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; /** Monthly price in this [Location](#tag/locations). */ export type UpdateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceMonthly = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; /** Additional traffic price per TB in this [Location](#tag/locations). */ export type UpdateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPricePerTbTraffic = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly; export type UpdateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItem = CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItem; /** Price per [Location](#tag/locations). */ export type UpdateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesList = Array; export interface UpdateLoadBalancerResponseLoadBalancerLoadBalancerType { /** ID of the Load Balancer type. */ id: number; /** Unique identifier of the Load Balancer type. */ name: string; /** Description of the Load Balancer type. */ description: string; /** Number of maximum simultaneous open connections. */ max_connections: number; /** Number of services a Load Balancer of this type can have. */ max_services: number; /** Number of targets a single Load Balancer can have. */ max_targets: number; /** Number of SSL Certificates that can be assigned to a single Load Balancer. */ max_assigned_certificates: number; /** **Deprecated:** This field is deprecated. Use the `deprecation` object instead. Point in time when the Load Balancer type is deprecated (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ deprecated: string | null; /** Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated. */ deprecation: CreateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation | null; /** Price per [Location](#tag/locations). */ prices: UpdateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesList; } /** Protection configuration for the Resource. */ export type UpdateLoadBalancerResponseLoadBalancerProtection = CreateLoadBalancerResponseLoadBalancerProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type UpdateLoadBalancerResponseLoadBalancerLabelsMap = { [key: string]: string | undefined }; export type UpdateLoadBalancerResponseLoadBalancerServicesItem = | ServiceTCP | ServiceHTTPProtocol | ServiceHTTPSProtocol; /** List of services that belong to this Load Balancer. */ export type UpdateLoadBalancerResponseLoadBalancerServicesList = Array; export type UpdateLoadBalancerResponseLoadBalancerTargetsItem = | TargetTypeServer | TargetTypeLabelSelector | TargetTypeIP; /** List of targets that belong to this Load Balancer. */ export type UpdateLoadBalancerResponseLoadBalancerTargetsList = Array; /** Type of the algorithm. */ export type UpdateLoadBalancerResponseLoadBalancerAlgorithmType = | "round_robin" | "least_connections"; /** Algorithm of the Load Balancer. */ export interface UpdateLoadBalancerResponseLoadBalancerAlgorithm { /** Type of the algorithm. */ type: UpdateLoadBalancerResponseLoadBalancerAlgorithmType; } export interface UpdateLoadBalancerResponseLoadBalancer { /** ID of the [Load Balancer](#tag/load-balancers). */ id: number; /** Name of the Resource. Must be unique per Project. */ name: string; /** Public network information. */ public_net: CreateLoadBalancerResponseLoadBalancerPublicNet; /** Private networks information. */ private_net: UpdateLoadBalancerResponseLoadBalancerPrivateNetList; location: CreateLoadBalancerResponseLoadBalancerLocation; load_balancer_type: UpdateLoadBalancerResponseLoadBalancerLoadBalancerType; /** Protection configuration for the Resource. */ protection: CreateLoadBalancerResponseLoadBalancerProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: UpdateLoadBalancerResponseLoadBalancerLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** List of services that belong to this Load Balancer. */ services: UpdateLoadBalancerResponseLoadBalancerServicesList; /** List of targets that belong to this Load Balancer. */ targets: UpdateLoadBalancerResponseLoadBalancerTargetsList; /** Algorithm of the Load Balancer. */ algorithm: UpdateLoadBalancerResponseLoadBalancerAlgorithm; /** Outbound Traffic for the current billing period in bytes. */ outgoing_traffic: number | null; /** Inbound Traffic for the current billing period in bytes. */ ingoing_traffic: number | null; /** Free Traffic for the current billing period in bytes. */ included_traffic: number; } export interface UpdateLoadBalancerResponse { load_balancer: UpdateLoadBalancerResponseLoadBalancer; } export type CreateLoadBalancerError = HetznerOpError; /** Create a Load Balancer Creates a Load Balancer. #### Operation specific errors */ export const createLoadBalancer: API.OperationMethod< CreateLoadBalancerRequest, CreateLoadBalancerResponse, CreateLoadBalancerError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(6, __c0, 6) as any as S.Schema, output: __S(14, __c0, 14) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type DeleteLoadBalancerError = HetznerOpError; /** Delete a Load Balancer Deletes a Load Balancer. */ export const deleteLoadBalancer: API.OperationMethod< DeleteLoadBalancerRequest, DeleteLoadBalancerResponse, DeleteLoadBalancerError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c2, 0) as any as S.Schema, output: __S(33, __c2, 1) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type GetLoadBalancerError = HetznerOpError; /** Get a Load Balancer Gets a specific Load Balancer object. */ export const getLoadBalancer: API.OperationMethod< GetLoadBalancerRequest, GetLoadBalancerResponse, GetLoadBalancerError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c3, 0) as any as S.Schema, output: __S(52, __c3, 4) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type GetLoadBalancerMetricsError = HetznerOpError; /** Get Metrics for a LoadBalancer You must specify the type of metric to get: `open_connections`, `connections_per_second`, `requests_per_second` or `bandwidth`. You can also specify more than one type by comma separation, e.g. `requests_per_second,bandwidth`. Depending on the type you will get different time series data: Metrics are available for the last 30 days only. If you do not provide the step argument we will automatically adjust it so that 200 samples are returned. We limit the number of samples to a maximum of 500 and will adjust the step parameter accordingly. */ export const getLoadBalancerMetrics: API.OperationMethod< GetLoadBalancerMetricsRequest, GetLoadBalancerMetricsResponse, GetLoadBalancerMetricsError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(64, __c4, 0) as any as S.Schema, output: __S(70, __c4, 6) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type ListLoadBalancersError = HetznerOpError; /** List Load Balancers Gets all existing Load Balancers that you have available. */ export const listLoadBalancers: API.PaginatedOperationMethod< ListLoadBalancersRequest, ListLoadBalancersResponse, ListLoadBalancersError, HetznerOpContext, ListLoadBalancersResponseLoadBalancersItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(96, __c6, 0) as any as S.Schema, output: __S(103, __c6, 7) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "meta.pagination.next_page", items: "load_balancers", pageSize: "per_page", } as const, }), paginatePageNumber, ) as any; export type UpdateLoadBalancerError = HetznerOpError; /** Update a Load Balancer Updates a Load Balancer. You can update a Load Balancer's name and a Load Balancer's labels. Note: if the Load Balancer object changes during the request, the response will be a "conflict" error. */ export const updateLoadBalancer: API.OperationMethod< UpdateLoadBalancerRequest, UpdateLoadBalancerResponse, UpdateLoadBalancerError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(112, __c7, 0) as any as S.Schema, output: __S(116, __c7, 4) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); // Schema builders: each runs one schema initializer, on that schema's first use. function __c0(j: number): any { switch (j) { case 0: return S.Array(S.Unknown); case 1: return S.suspend(() => S.Struct({ id: S.Number, ip: S.optional(S.String), }), ).annotate({ identifier: "CreateLoadBalancerRequestTargetsItemServer" }); case 2: return S.suspend(() => S.Struct({ selector: S.String, }), ).annotate({ identifier: "CreateLoadBalancerRequestTargetsItemLabelSelector" }); case 3: return S.suspend(() => S.Struct({ ip: S.String, }), ).annotate({ identifier: "CreateLoadBalancerRequestTargetsItemIp" }); case 4: return S.suspend(() => S.Struct({ type: S.String, server: S.optional(__S(1, __c0, 1)), label_selector: S.optional(__S(2, __c0, 2)), ip: S.optional(__S(3, __c0, 3)), use_private_ip: S.optional(S.Boolean), }), ).annotate({ identifier: "CreateLoadBalancerRequestTargetsItem" }); case 5: return S.Array(__S(4, __c0, 4)); case 6: return S.suspend(() => S.Struct({ name: S.String, load_balancer_type: S.String, algorithm: S.optional(__S(16, __c1, 0)), services: S.optional(__S(0, __c0, 0)), targets: S.optional(__S(5, __c0, 5)), labels: S.optional(__S(17, __c1, 1)), public_interface: S.optional(S.Boolean), network: S.optional(S.Number), network_zone: S.optional(S.String), location: S.optional(S.String), }).pipe(T.Http({ method: "POST", uri: "/load_balancers", code: 200 })), ).annotate({ identifier: "CreateLoadBalancerRequest" }); case 7: return S.Array(S.Unknown); case 8: return S.Array(S.Unknown); case 9: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, public_net: __S(19, __c1, 3), private_net: __S(21, __c1, 5), location: __S(22, __c1, 6), load_balancer_type: __S(27, __c1, 11), protection: __S(28, __c1, 12), labels: __S(17, __c1, 1), created: S.String, services: __S(7, __c0, 7), targets: __S(8, __c0, 8), algorithm: __S(16, __c1, 0), outgoing_traffic: S.NullOr(S.Number), ingoing_traffic: S.NullOr(S.Number), included_traffic: S.Number, }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancer" }); case 10: return S.suspend(() => S.Struct({ id: S.Number, type: S.String, }), ).annotate({ identifier: "CreateLoadBalancerResponseActionResourcesItem" }); case 11: return S.Array(__S(10, __c0, 10)); case 12: return S.suspend(() => S.Struct({ code: S.String, message: S.String, }), ).annotate({ identifier: "CreateLoadBalancerResponseActionError" }); case 13: return S.suspend(() => S.Struct({ id: S.Number, command: S.String, status: S.String, started: S.String, finished: S.NullOr(S.String), progress: S.Number, resources: __S(11, __c0, 11), error: S.NullOr(__S(12, __c0, 12)), }), ).annotate({ identifier: "CreateLoadBalancerResponseAction" }); case 14: return S.suspend(() => S.Struct({ load_balancer: __S(9, __c0, 9), action: __S(13, __c0, 13), }), ).annotate({ identifier: "CreateLoadBalancerResponse" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ type: S.String, }), ).annotate({ identifier: "CreateLoadBalancerRequestAlgorithm" }); case 1: return S.Record(S.String, S.String); case 2: return S.suspend(() => S.Struct({ ip: S.NullOr(S.String), dns_ptr: S.NullOr(S.String), }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancerPublicNetIpv4" }); case 3: return S.suspend(() => S.Struct({ enabled: S.Boolean, ipv4: __S(18, __c1, 2), ipv6: __S(18, __c1, 2), }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancerPublicNet" }); case 4: return S.suspend(() => S.Struct({ network: S.Number, ip: S.String, }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancerPrivateNetItem" }); case 5: return S.Array(__S(20, __c1, 4)); case 6: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, description: S.String, country: S.String, city: S.String, latitude: S.Number, longitude: S.Number, network_zone: S.String, }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancerLocation" }); case 7: return S.suspend(() => S.Struct({ unavailable_after: S.String, announced: S.String, }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancerLoadBalancerTypeDeprecation", }); case 8: return S.suspend(() => S.Struct({ net: S.String, gross: S.String, }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItemPriceHourly", }); case 9: return S.suspend(() => S.Struct({ location: S.String, price_hourly: __S(24, __c1, 8), price_monthly: __S(24, __c1, 8), included_traffic: S.Number, price_per_tb_traffic: __S(24, __c1, 8), }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancerLoadBalancerTypePricesItem", }); case 10: return S.Array(__S(25, __c1, 9)); case 11: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, description: S.String, max_connections: S.Number, max_services: S.Number, max_targets: S.Number, max_assigned_certificates: S.Number, deprecated: S.NullOr(S.String), deprecation: S.NullOr(__S(23, __c1, 7)), prices: __S(26, __c1, 10), }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancerLoadBalancerType" }); case 12: return S.suspend(() => S.Struct({ delete: S.Boolean, }), ).annotate({ identifier: "CreateLoadBalancerResponseLoadBalancerProtection" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), }).pipe(T.Http({ method: "DELETE", uri: "/load_balancers/{id}", code: 200 })), ).annotate({ identifier: "DeleteLoadBalancerRequest" }); case 1: return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteLoadBalancerResponse" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), }).pipe(T.Http({ method: "GET", uri: "/load_balancers/{id}", code: 200 })), ).annotate({ identifier: "GetLoadBalancerRequest" }); case 1: return S.Array(S.Unknown); case 2: return S.Array(S.Unknown); case 3: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, public_net: __S(19, __c1, 3), private_net: __S(21, __c1, 5), location: __S(22, __c1, 6), load_balancer_type: __S(27, __c1, 11), protection: __S(28, __c1, 12), labels: __S(17, __c1, 1), created: S.String, services: __S(49, __c3, 1), targets: __S(50, __c3, 2), algorithm: __S(16, __c1, 0), outgoing_traffic: S.NullOr(S.Number), ingoing_traffic: S.NullOr(S.Number), included_traffic: S.Number, }), ).annotate({ identifier: "GetLoadBalancerResponseLoadBalancer" }); case 4: return S.suspend(() => S.Struct({ load_balancer: __S(51, __c3, 3), }), ).annotate({ identifier: "GetLoadBalancerResponse" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), type: __S(80, __c5, 0).pipe(T.Query()), start: S.String.pipe(T.Query()), end: S.String.pipe(T.Query()), step: S.optional(S.String.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/load_balancers/{id}/metrics", code: 200 })), ).annotate({ identifier: "GetLoadBalancerMetricsRequest" }); case 1: return S.Array(S.Unknown); case 2: return S.Array(__S(65, __c4, 1)); case 3: return S.suspend(() => S.Struct({ values: __S(66, __c4, 2), }), ).annotate({ identifier: "GetLoadBalancerMetricsResponseMetricsTimeSeriesValue" }); case 4: return S.Record(S.String, __S(67, __c4, 3)); case 5: return S.suspend(() => S.Struct({ start: S.String, end: S.String, step: S.Number, time_series: __S(68, __c4, 4), }), ).annotate({ identifier: "GetLoadBalancerMetricsResponseMetrics" }); case 6: return S.suspend(() => S.Struct({ metrics: __S(69, __c4, 5), }), ).annotate({ identifier: "GetLoadBalancerMetricsResponse" }); } } function __c5(j: number): any { switch (j) { case 0: return S.Array(S.String); } } function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ sort: S.optional(__S(80, __c5, 0).pipe(T.Query())), name: S.optional(S.String.pipe(T.Query())), label_selector: S.optional(S.String.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/load_balancers", code: 200 })), ).annotate({ identifier: "ListLoadBalancersRequest" }); case 1: return S.Array(S.Unknown); case 2: return S.Array(S.Unknown); case 3: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, public_net: __S(19, __c1, 3), private_net: __S(21, __c1, 5), location: __S(22, __c1, 6), load_balancer_type: __S(27, __c1, 11), protection: __S(28, __c1, 12), labels: __S(17, __c1, 1), created: S.String, services: __S(97, __c6, 1), targets: __S(98, __c6, 2), algorithm: __S(16, __c1, 0), outgoing_traffic: S.NullOr(S.Number), ingoing_traffic: S.NullOr(S.Number), included_traffic: S.Number, }), ).annotate({ identifier: "ListLoadBalancersResponseLoadBalancersItem" }); case 4: return S.Array(__S(99, __c6, 3)); case 5: return S.suspend(() => S.Struct({ page: S.Number, per_page: S.Number, previous_page: S.NullOr(S.Number), next_page: S.NullOr(S.Number), last_page: S.NullOr(S.Number), total_entries: S.NullOr(S.Number), }), ).annotate({ identifier: "ListLoadBalancersResponseMetaPagination" }); case 6: return S.suspend(() => S.Struct({ pagination: __S(101, __c6, 5), }), ).annotate({ identifier: "ListLoadBalancersResponseMeta" }); case 7: return S.suspend(() => S.Struct({ load_balancers: __S(100, __c6, 4), meta: __S(102, __c6, 6), }), ).annotate({ identifier: "ListLoadBalancersResponse" }); } } function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), name: S.optional(S.String), labels: S.optional(__S(17, __c1, 1)), }).pipe(T.Http({ method: "PUT", uri: "/load_balancers/{id}", code: 200 })), ).annotate({ identifier: "UpdateLoadBalancerRequest" }); case 1: return S.Array(S.Unknown); case 2: return S.Array(S.Unknown); case 3: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, public_net: __S(19, __c1, 3), private_net: __S(21, __c1, 5), location: __S(22, __c1, 6), load_balancer_type: __S(27, __c1, 11), protection: __S(28, __c1, 12), labels: __S(17, __c1, 1), created: S.String, services: __S(113, __c7, 1), targets: __S(114, __c7, 2), algorithm: __S(16, __c1, 0), outgoing_traffic: S.NullOr(S.Number), ingoing_traffic: S.NullOr(S.Number), included_traffic: S.Number, }), ).annotate({ identifier: "UpdateLoadBalancerResponseLoadBalancer" }); case 4: return S.suspend(() => S.Struct({ load_balancer: __S(115, __c7, 3), }), ).annotate({ identifier: "UpdateLoadBalancerResponse" }); } } // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); }