action hetzner_post_networks { label: "Create a Network" description: "Creates a network with the specified `ip_range`.\n\nYou may specify one or more `subnets`. You can also add more Subnets later by using the [add subnet action](https://docs.hetzner.cloud/#network-actions-add-a-subnet-to-a-network). If you do not specify an `ip_range` in the subnet we will automatically pick the first available /24 range for you.\n\nYou may specify one or more routes in `routes`. You can also add more routes later by using the [add route action](https://docs.hetzner.cloud/#network-actions-add-a-route-to-a-network).\n" provider: hetzner method: POST path: "/networks" encoding: json input: { type: "object" required: ["ip_range", "name"] properties: { ip_range: { type: "string" description: "IP range of the whole network which 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 with a /16 netmask." } labels: { type: "object" description: "User-defined labels (key-value pairs)" properties: { labelkey: { type: "string" description: "New label" } } } name: { type: "string" description: "Name of the network" } routes: { type: "array" description: "Array of routes set in this network. The destination of the route must be one of the private IPv4 ranges of RFC1918. The gateway must be a subnet/IP of the ip_range of the network object. The destination must not overlap with an existing ip_range in any subnets or with any destinations in other routes or with the first IP of the networks ip_range or with 172.31.1.1. The gateway cannot be the first IP of the networks ip_range and also cannot be 172.31.1.1." items: { type: "object" required: ["destination", "gateway"] properties: { destination: { type: "string" description: "Destination network or host of this route. Must not overlap with an existing ip_range in any subnets or with any destinations in other routes or with the first IP of the networks ip_range or with 172.31.1.1. Must be one of the private IPv4 ranges of RFC1918." } gateway: { type: "string" description: "Gateway for the route. Cannot be the first IP of the networks ip_range and also cannot be 172.31.1.1 as this IP is being used as a gateway for the public network interface of Servers." } } } } subnets: { type: "array" description: "Array of subnets allocated." items: { type: "object" required: ["type", "network_zone"] properties: { ip_range: { type: "string" description: "Range to allocate IPs from. Must be a Subnet of the ip_range of the parent network object and must not overlap with any other subnets or with any destinations in routes. Minimum Network size is /30. We suggest that you pick a bigger Network with a /24 netmask." } network_zone: { type: "string" description: "Name of Network zone. The Location object contains the `network_zone` property each Location belongs to." } type: { type: "string" description: "Type of Subnetwork" enum: ["cloud", "server", "vswitch"] } } } } } } output: { type: "object" properties: { network: { type: "object" required: ["created", "id", "ip_range", "labels", "name", "protection", "routes", "servers", "subnets"] properties: { created: { type: "string" description: "Point in time when the Network was created (in ISO-8601 format)" } id: { type: "integer" description: "ID of the Network" } ip_range: { type: "string" description: "IPv4 prefix of the whole Network" } labels: { type: "object" description: "User-defined labels (key-value pairs)" } load_balancers: { type: "array" description: "Array of IDs of Load Balancers attached to this Network" items: { type: "integer" } } name: { type: "string" description: "Name of the Network" } protection: { type: "object" description: "Protection configuration for the Network" required: ["delete"] properties: { delete: { type: "boolean" description: "If true, prevents the Network from being deleted" } } } routes: { type: "array" description: "Array of routes set in this Network" items: { type: "object" required: ["destination", "gateway"] properties: { destination: { type: "string" description: "Destination network or host of this route. Must not overlap with an existing ip_range in any subnets or with any destinations in other routes or with the first IP of the networks ip_range or with 172.31.1.1. Must be one of the private IPv4 ranges of RFC1918." } gateway: { type: "string" description: "Gateway for the route. Cannot be the first IP of the networks ip_range and also cannot be 172.31.1.1 as this IP is being used as a gateway for the public network interface of Servers." } } } } servers: { type: "array" description: "Array of IDs of Servers attached to this Network" items: { type: "integer" } } subnets: { type: "array" description: "Array subnets allocated in this Network" items: { type: "object" required: ["type", "network_zone", "gateway"] properties: { gateway: { type: "string" description: "Gateway for Servers attached to this subnet. For subnets of type Server this is always the first IP of the network IP range." } ip_range: { type: "string" description: "Range to allocate IPs from. Must be a Subnet of the ip_range of the parent network object and must not overlap with any other subnets or with any destinations in routes. Minimum Network size is /30. We suggest that you pick a bigger Network with a /24 netmask." } network_zone: { type: "string" description: "Name of Network zone. The Location object contains the `network_zone` property each Location belongs to." } type: { type: "string" description: "Type of Subnetwork" enum: ["cloud", "server", "vswitch"] } } } } } } } } }