import * as API from "@distilled.cloud/core/api"; import { type HetznerOpError, type HetznerOpContext } from "../protocol.ts"; export type { HetznerOpError, HetznerOpContext }; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreateNetworkRequestLabelsMap = { [key: string]: string | undefined; }; /** Type of subnet. */ export type CreateNetworkRequestSubnetsItemType = "cloud" | "server" | "vswitch"; export interface CreateNetworkRequestSubnetsItem { /** Type of subnet. */ type: CreateNetworkRequestSubnetsItemType | (string & {}); /** IP range of the subnet. Uses CIDR notation. Must be a subnet of the parent [Networks](#tag/networks) `ip_range`. Must not overlap with any other subnets or with any destinations in routes. Minimum network size is /30. We highly recommend that you pick a larger subnet with a /24 netmask. */ ip_range?: string; /** Name of the [Network Zone](#tag/network-zones). The [Location](#tag/locations) contains the `network_zone` property it belongs to. */ network_zone: string; /** ID of the robot vSwitch. Must only be supplied for subnets of type `vswitch`. */ vswitch_id?: number; } /** Array of subnets to allocate. */ export type CreateNetworkRequestSubnetsList = Array; export interface CreateNetworkRequestRoutesItem { /** Destination network or host of the route. Packages addressed for IPs matching the destination IP prefix will be send to the specified gateway. Must be one of * private IPv4 ranges of RFC1918 * or `0.0.0.0/0`. Must not overlap with * an existing ip_range in any subnets * or with any destinations in other routes * or with `172.31.1.1`. `172.31.1.1` is being used as a gateway for the public network interface of [Servers](#tag/servers). */ destination: string; /** Gateway of the route. Packages addressed for the specified destination will be send to this IP address. Cannot be * the first IP of the networks ip_range, * an IP behind a vSwitch or * `172.31.1.1`. `172.31.1.1` is being used as a gateway for the public network interface of [Servers](#tag/servers). */ gateway: string; } /** Array of routes set in this [Network](#tag/networks). */ export type CreateNetworkRequestRoutesList = Array; export interface CreateNetworkRequest { /** Name of the [Network](#tag/networks). */ name: string; /** IP range of the [Network](#tag/networks). Uses CIDR notation. Must span all included subnets. Must be one of the private IPv4 ranges of RFC1918. Minimum network size is /24. We highly recommend that you pick a larger [Network](#tag/networks) with a /16 netmask. */ ip_range: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: CreateNetworkRequestLabelsMap; /** Array of subnets to allocate. */ subnets?: CreateNetworkRequestSubnetsList; /** Array of routes set in this [Network](#tag/networks). */ routes?: CreateNetworkRequestRoutesList; /** Toggle to expose routes to the [Networks](#tag/networks) vSwitch. Indicates if the routes from this [Network](#tag/networks) should be exposed to the vSwitch in this [Network](#tag/networks). Only takes effect if a [vSwitch is setup](https://docs.hetzner.com/cloud/networks/connect-dedi-vswitch) in this [Network](#tag/networks). */ expose_routes_to_vswitch?: boolean; } /** Type of subnet. */ export type CreateNetworkResponseNetworkSubnetsItemType = "cloud" | "server" | "vswitch"; export interface CreateNetworkResponseNetworkSubnetsItem { /** Type of subnet. */ type: CreateNetworkResponseNetworkSubnetsItemType; /** IP range of the subnet. Uses CIDR notation. */ ip_range?: string; /** Name of the [Network Zone](#tag/network-zones). The [Location](#tag/locations) contains the `network_zone` property it belongs to. */ network_zone: string; /** Gateway for [Servers](#tag/servers) attached to this subnet. For subnets of type `server` this is always the first IP of the subnets IP range. */ gateway: string; /** ID of the robot vSwitch if the subnet is of type `vswitch`. */ vswitch_id?: number | null; } /** List of subnets allocated in this [Network](#tag/networks). */ export type CreateNetworkResponseNetworkSubnetsList = Array; export type CreateNetworkResponseNetworkRoutesItem = CreateNetworkRequestRoutesItem; /** Array of routes set in this [Network](#tag/networks). */ export type CreateNetworkResponseNetworkRoutesList = Array; /** Array of IDs of [Servers](#tag/servers) attached to this [Network](#tag/networks). */ export type CreateNetworkResponseNetworkServersList = Array; /** Array of IDs of [Load Balancers](#tag/load-balancers) attached to this [Network](#tag/networks). */ export type CreateNetworkResponseNetworkLoadBalancersList = Array; /** Protection configuration for the Resource. */ export interface CreateNetworkResponseNetworkProtection { /** 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 CreateNetworkResponseNetworkLabelsMap = { [key: string]: string | undefined; }; export interface CreateNetworkResponseNetwork { /** ID of the [Network](#tag/networks). */ id: number; /** Name of the [Network](#tag/networks). */ name: string; /** IP range of the [Network](#tag/networks). Uses CIDR notation. */ ip_range: string; /** List of subnets allocated in this [Network](#tag/networks). */ subnets: CreateNetworkResponseNetworkSubnetsList; /** Array of routes set in this [Network](#tag/networks). */ routes: CreateNetworkResponseNetworkRoutesList; /** Array of IDs of [Servers](#tag/servers) attached to this [Network](#tag/networks). */ servers: CreateNetworkResponseNetworkServersList; /** Array of IDs of [Load Balancers](#tag/load-balancers) attached to this [Network](#tag/networks). */ load_balancers?: CreateNetworkResponseNetworkLoadBalancersList; /** Protection configuration for the Resource. */ protection: CreateNetworkResponseNetworkProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: CreateNetworkResponseNetworkLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Indicates if the routes from this [Network](#tag/networks) should be exposed to the vSwitch connection. */ expose_routes_to_vswitch: boolean; } export interface CreateNetworkResponse { network?: CreateNetworkResponseNetwork; } export interface DeleteNetworkRequest { /** ID of the Network. */ id: number; } export interface DeleteNetworkResponse { } export interface GetNetworkRequest { /** ID of the Network. */ id: number; } /** Type of subnet. */ export type GetNetworkResponseNetworkSubnetsItemType = "cloud" | "server" | "vswitch"; export interface GetNetworkResponseNetworkSubnetsItem { /** Type of subnet. */ type: GetNetworkResponseNetworkSubnetsItemType; /** IP range of the subnet. Uses CIDR notation. */ ip_range?: string; /** Name of the [Network Zone](#tag/network-zones). The [Location](#tag/locations) contains the `network_zone` property it belongs to. */ network_zone: string; /** Gateway for [Servers](#tag/servers) attached to this subnet. For subnets of type `server` this is always the first IP of the subnets IP range. */ gateway: string; /** ID of the robot vSwitch if the subnet is of type `vswitch`. */ vswitch_id?: number | null; } /** List of subnets allocated in this [Network](#tag/networks). */ export type GetNetworkResponseNetworkSubnetsList = Array; export type GetNetworkResponseNetworkRoutesItem = CreateNetworkRequestRoutesItem; /** Array of routes set in this [Network](#tag/networks). */ export type GetNetworkResponseNetworkRoutesList = Array; /** Array of IDs of [Servers](#tag/servers) attached to this [Network](#tag/networks). */ export type GetNetworkResponseNetworkServersList = Array; /** Array of IDs of [Load Balancers](#tag/load-balancers) attached to this [Network](#tag/networks). */ export type GetNetworkResponseNetworkLoadBalancersList = Array; /** Protection configuration for the Resource. */ export type GetNetworkResponseNetworkProtection = CreateNetworkResponseNetworkProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type GetNetworkResponseNetworkLabelsMap = { [key: string]: string | undefined; }; export interface GetNetworkResponseNetwork { /** ID of the [Network](#tag/networks). */ id: number; /** Name of the [Network](#tag/networks). */ name: string; /** IP range of the [Network](#tag/networks). Uses CIDR notation. */ ip_range: string; /** List of subnets allocated in this [Network](#tag/networks). */ subnets: GetNetworkResponseNetworkSubnetsList; /** Array of routes set in this [Network](#tag/networks). */ routes: GetNetworkResponseNetworkRoutesList; /** Array of IDs of [Servers](#tag/servers) attached to this [Network](#tag/networks). */ servers: GetNetworkResponseNetworkServersList; /** Array of IDs of [Load Balancers](#tag/load-balancers) attached to this [Network](#tag/networks). */ load_balancers?: GetNetworkResponseNetworkLoadBalancersList; /** Protection configuration for the Resource. */ protection: CreateNetworkResponseNetworkProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: GetNetworkResponseNetworkLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Indicates if the routes from this [Network](#tag/networks) should be exposed to the vSwitch connection. */ expose_routes_to_vswitch: boolean; } export interface GetNetworkResponse { network?: GetNetworkResponseNetwork; } /** Type of the resource attached to the [Network](#tag/networks). */ export type ListNetworkMembersRequestTypeItem = "server" | "load_balancer"; export type ListNetworkMembersRequestTypeList = Array; export type ListNetworkMembersRequestSubnetList = Array; /** Status of the resource within the [Network](#tag/networks). */ export type ListNetworkMembersRequestStatusItem = "ok" | "attaching" | "detaching" | "updating" | "error"; export type ListNetworkMembersRequestStatusList = Array; export type ListNetworkMembersRequestSortItem = "id" | "id:asc" | "id:desc" | "type" | "type:asc" | "type:desc" | "status" | "status:asc" | "status:desc" | "ip" | "ip:asc" | "ip:desc"; export type ListNetworkMembersRequestSortList = Array; export interface ListNetworkMembersRequest { /** ID of the Network. */ id: number; /** Filter members by type. May be used multiple times. The response will only contain members matching the specified types. */ type?: ListNetworkMembersRequestTypeList; /** Filter members by the subnet they are attached to. May be used multiple times. The response will only contain members attached to the subnets with the specified IP ranges. Uses CIDR notation. */ subnet?: ListNetworkMembersRequestSubnetList; /** Filter members by status. May be used multiple times. The response will only contain members matching the specified statuses. */ status?: ListNetworkMembersRequestStatusList; /** Sort resources by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListNetworkMembersRequestSortList; /** 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; } /** Type of the resource attached to the [Network](#tag/networks). */ export type ListNetworkMembersResponseMembersItemType = "server" | "load_balancer"; /** Status of the resource within the [Network](#tag/networks). */ export type ListNetworkMembersResponseMembersItemStatus = "ok" | "attaching" | "detaching" | "updating" | "error"; /** Additional IP addresses of the resource within the [Network](#tag/networks). */ export type ListNetworkMembersResponseMembersItemAliasIpsList = Array; export interface ListNetworkMembersResponseMembersItem { /** Type of the resource attached to the [Network](#tag/networks). */ type: ListNetworkMembersResponseMembersItemType; /** ID of the attached resource. */ id: number; /** IP address of the resource within the [Network](#tag/networks). */ ip: string; /** Status of the resource within the [Network](#tag/networks). */ status: ListNetworkMembersResponseMembersItemStatus; /** Additional IP addresses of the resource within the [Network](#tag/networks). */ alias_ips: ListNetworkMembersResponseMembersItemAliasIpsList; /** IP range of the subnet the resource is attached to. Uses CIDR notation. */ subnet: string; } export type ListNetworkMembersResponseMembersList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export interface ListNetworkMembersResponseMetaPagination { /** 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 ListNetworkMembersResponseMeta { /** See "[Pagination](#description/pagination)" for more information. */ pagination: ListNetworkMembersResponseMetaPagination; } export interface ListNetworkMembersResponse { members: ListNetworkMembersResponseMembersList; meta: ListNetworkMembersResponseMeta; } export type ListNetworksRequestSortItem = "id" | "id:asc" | "id:desc" | "name" | "name:asc" | "name:desc" | "created" | "created:asc" | "created:desc"; export type ListNetworksRequestSortList = Array; export interface ListNetworksRequest { /** Sort resources by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListNetworksRequestSortList; /** 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; } /** Type of subnet. */ export type ListNetworksResponseNetworksItemSubnetsItemType = "cloud" | "server" | "vswitch"; export interface ListNetworksResponseNetworksItemSubnetsItem { /** Type of subnet. */ type: ListNetworksResponseNetworksItemSubnetsItemType; /** IP range of the subnet. Uses CIDR notation. */ ip_range?: string; /** Name of the [Network Zone](#tag/network-zones). The [Location](#tag/locations) contains the `network_zone` property it belongs to. */ network_zone: string; /** Gateway for [Servers](#tag/servers) attached to this subnet. For subnets of type `server` this is always the first IP of the subnets IP range. */ gateway: string; /** ID of the robot vSwitch if the subnet is of type `vswitch`. */ vswitch_id?: number | null; } /** List of subnets allocated in this [Network](#tag/networks). */ export type ListNetworksResponseNetworksItemSubnetsList = Array; export type ListNetworksResponseNetworksItemRoutesItem = CreateNetworkRequestRoutesItem; /** Array of routes set in this [Network](#tag/networks). */ export type ListNetworksResponseNetworksItemRoutesList = Array; /** Array of IDs of [Servers](#tag/servers) attached to this [Network](#tag/networks). */ export type ListNetworksResponseNetworksItemServersList = Array; /** Array of IDs of [Load Balancers](#tag/load-balancers) attached to this [Network](#tag/networks). */ export type ListNetworksResponseNetworksItemLoadBalancersList = Array; /** Protection configuration for the Resource. */ export type ListNetworksResponseNetworksItemProtection = CreateNetworkResponseNetworkProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type ListNetworksResponseNetworksItemLabelsMap = { [key: string]: string | undefined; }; export interface ListNetworksResponseNetworksItem { /** ID of the [Network](#tag/networks). */ id: number; /** Name of the [Network](#tag/networks). */ name: string; /** IP range of the [Network](#tag/networks). Uses CIDR notation. */ ip_range: string; /** List of subnets allocated in this [Network](#tag/networks). */ subnets: ListNetworksResponseNetworksItemSubnetsList; /** Array of routes set in this [Network](#tag/networks). */ routes: ListNetworksResponseNetworksItemRoutesList; /** Array of IDs of [Servers](#tag/servers) attached to this [Network](#tag/networks). */ servers: ListNetworksResponseNetworksItemServersList; /** Array of IDs of [Load Balancers](#tag/load-balancers) attached to this [Network](#tag/networks). */ load_balancers?: ListNetworksResponseNetworksItemLoadBalancersList; /** Protection configuration for the Resource. */ protection: CreateNetworkResponseNetworkProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: ListNetworksResponseNetworksItemLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Indicates if the routes from this [Network](#tag/networks) should be exposed to the vSwitch connection. */ expose_routes_to_vswitch: boolean; } export type ListNetworksResponseNetworksList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export type ListNetworksResponseMetaPagination = ListNetworkMembersResponseMetaPagination; export type ListNetworksResponseMeta = ListNetworkMembersResponseMeta; export interface ListNetworksResponse { networks: ListNetworksResponseNetworksList; meta: ListNetworkMembersResponseMeta; } /** 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 UpdateNetworkRequestLabelsMap = { [key: string]: string | undefined; }; export interface UpdateNetworkRequest { /** ID of the Network. */ id: number; /** New [Network](#tag/networks) 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?: UpdateNetworkRequestLabelsMap; /** Toggle to expose routes to the [Networks](#tag/networks) vSwitch. Indicates if the routes from this [Network](#tag/networks) should be exposed to the vSwitch in this [Network](#tag/networks). Only takes effect if a [vSwitch is setup](https://docs.hetzner.com/cloud/networks/connect-dedi-vswitch) in this [Network](#tag/networks). */ expose_routes_to_vswitch?: boolean; } /** Type of subnet. */ export type UpdateNetworkResponseNetworkSubnetsItemType = "cloud" | "server" | "vswitch"; export interface UpdateNetworkResponseNetworkSubnetsItem { /** Type of subnet. */ type: UpdateNetworkResponseNetworkSubnetsItemType; /** IP range of the subnet. Uses CIDR notation. */ ip_range?: string; /** Name of the [Network Zone](#tag/network-zones). The [Location](#tag/locations) contains the `network_zone` property it belongs to. */ network_zone: string; /** Gateway for [Servers](#tag/servers) attached to this subnet. For subnets of type `server` this is always the first IP of the subnets IP range. */ gateway: string; /** ID of the robot vSwitch if the subnet is of type `vswitch`. */ vswitch_id?: number | null; } /** List of subnets allocated in this [Network](#tag/networks). */ export type UpdateNetworkResponseNetworkSubnetsList = Array; export type UpdateNetworkResponseNetworkRoutesItem = CreateNetworkRequestRoutesItem; /** Array of routes set in this [Network](#tag/networks). */ export type UpdateNetworkResponseNetworkRoutesList = Array; /** Array of IDs of [Servers](#tag/servers) attached to this [Network](#tag/networks). */ export type UpdateNetworkResponseNetworkServersList = Array; /** Array of IDs of [Load Balancers](#tag/load-balancers) attached to this [Network](#tag/networks). */ export type UpdateNetworkResponseNetworkLoadBalancersList = Array; /** Protection configuration for the Resource. */ export type UpdateNetworkResponseNetworkProtection = CreateNetworkResponseNetworkProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type UpdateNetworkResponseNetworkLabelsMap = { [key: string]: string | undefined; }; export interface UpdateNetworkResponseNetwork { /** ID of the [Network](#tag/networks). */ id: number; /** Name of the [Network](#tag/networks). */ name: string; /** IP range of the [Network](#tag/networks). Uses CIDR notation. */ ip_range: string; /** List of subnets allocated in this [Network](#tag/networks). */ subnets: UpdateNetworkResponseNetworkSubnetsList; /** Array of routes set in this [Network](#tag/networks). */ routes: UpdateNetworkResponseNetworkRoutesList; /** Array of IDs of [Servers](#tag/servers) attached to this [Network](#tag/networks). */ servers: UpdateNetworkResponseNetworkServersList; /** Array of IDs of [Load Balancers](#tag/load-balancers) attached to this [Network](#tag/networks). */ load_balancers?: UpdateNetworkResponseNetworkLoadBalancersList; /** Protection configuration for the Resource. */ protection: CreateNetworkResponseNetworkProtection; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: UpdateNetworkResponseNetworkLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Indicates if the routes from this [Network](#tag/networks) should be exposed to the vSwitch connection. */ expose_routes_to_vswitch: boolean; } export interface UpdateNetworkResponse { network?: UpdateNetworkResponseNetwork; } export type CreateNetworkError = HetznerOpError; /** Create a Network Creates a [Network](#tag/networks). The provided `ip_range` can only be extended later on, but not reduced. Subnets can be added now or later on using the [add subnet action](#tag/network-actions/add_network_subnet). If you do not specify an `ip_range` for the subnet the first available /24 range will be used. Routes can be added now or later by using the [add route action](#tag/network-actions/add_network_route). */ export declare const createNetwork: API.OperationMethod; export type DeleteNetworkError = HetznerOpError; /** Delete a Network Deletes a [Network](#tag/networks). Attached resources will be detached automatically. */ export declare const deleteNetwork: API.OperationMethod; export type GetNetworkError = HetznerOpError; /** Get a Network Get a specific [Network](#tag/networks). */ export declare const getNetwork: API.OperationMethod; export type ListNetworkMembersError = HetznerOpError; /** List Members of a Network List the resources attached to a specific [Network](#tag/networks). Use the provided URI parameters to modify the result. */ export declare const listNetworkMembers: API.PaginatedOperationMethod; export type ListNetworksError = HetznerOpError; /** List Networks List multiple [Networks](#tag/networks). Use the provided URI parameters to modify the result. */ export declare const listNetworks: API.PaginatedOperationMethod; export type UpdateNetworkError = HetznerOpError; /** Update a Network Update a [Network](#tag/networks). If a change is currently being performed on this [Network](#tag/networks), a error response with code `conflict` will be returned. */ export declare const updateNetwork: API.OperationMethod; //# sourceMappingURL=networks.d.ts.map