hcloud/models/route.rs
1/*
2 * Hetzner Cloud API
3 *
4 * Copied from the official API documentation for the Public Hetzner Cloud.
5 *
6 * The version of the OpenAPI document: 0.28.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Route : Request for POST https://api.hetzner.cloud/v1/networks/{id}/actions/add_route | Request for POST https://api.hetzner.cloud/v1/networks/{id}/actions/delete_route
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Route {
17 /// 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.
18 #[serde(rename = "destination")]
19 pub destination: String,
20 /// 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.
21 #[serde(rename = "gateway")]
22 pub gateway: String,
23}
24
25impl Route {
26 /// Request for POST https://api.hetzner.cloud/v1/networks/{id}/actions/add_route | Request for POST https://api.hetzner.cloud/v1/networks/{id}/actions/delete_route
27 pub fn new(destination: String, gateway: String) -> Route {
28 Route {
29 destination,
30 gateway,
31 }
32 }
33}