fastly_api/models/backend.rs
1/*
2 * Fastly API
3 *
4 * Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
5 *
6 */
7
8
9
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct Backend {
13 /// A hostname, IPv4, or IPv6 address for the backend. This is the preferred way to specify the location of your backend.
14 #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
15 pub address: Option<String>,
16 /// Whether or not this backend should be automatically load balanced. If true, all backends with this setting that don't have a `request_condition` will be selected based on their `weight`.
17 #[serde(rename = "auto_loadbalance", skip_serializing_if = "Option::is_none")]
18 pub auto_loadbalance: Option<bool>,
19 /// Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`.
20 #[serde(rename = "between_bytes_timeout", skip_serializing_if = "Option::is_none")]
21 pub between_bytes_timeout: Option<i32>,
22 /// Unused.
23 #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")]
24 pub client_cert: Option<String>,
25 /// A freeform descriptive note.
26 #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
27 pub comment: Option<String>,
28 /// Maximum duration in milliseconds to wait for a connection to this backend to be established. If exceeded, the connection is aborted and a synthetic `503` response will be presented instead. May be set at runtime using `bereq.connect_timeout`.
29 #[serde(rename = "connect_timeout", skip_serializing_if = "Option::is_none")]
30 pub connect_timeout: Option<i32>,
31 /// Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. If exceeded, the connection is aborted and a synthetic `503` response will be presented instead. May be set at runtime using `bereq.first_byte_timeout`.
32 #[serde(rename = "first_byte_timeout", skip_serializing_if = "Option::is_none")]
33 pub first_byte_timeout: Option<i32>,
34 /// The name of the healthcheck to use with this backend.
35 #[serde(rename = "healthcheck", skip_serializing_if = "Option::is_none")]
36 pub healthcheck: Option<String>,
37 /// The hostname of the backend. May be used as an alternative to `address` to set the backend location.
38 #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
39 pub hostname: Option<String>,
40 /// IPv4 address of the backend. May be used as an alternative to `address` to set the backend location.
41 #[serde(rename = "ipv4", skip_serializing_if = "Option::is_none")]
42 pub ipv4: Option<String>,
43 /// IPv6 address of the backend. May be used as an alternative to `address` to set the backend location.
44 #[serde(rename = "ipv6", skip_serializing_if = "Option::is_none")]
45 pub ipv6: Option<String>,
46 /// How long in seconds to keep a persistent connection to the backend between requests.
47 #[serde(rename = "keepalive_time", skip_serializing_if = "Option::is_none")]
48 pub keepalive_time: Option<i32>,
49 /// Maximum number of concurrent connections this backend will accept.
50 #[serde(rename = "max_conn", skip_serializing_if = "Option::is_none")]
51 pub max_conn: Option<i32>,
52 /// Maximum allowed TLS version on SSL connections to this backend. If your backend server is not able to negotiate a connection meeting this constraint, a synthetic `503` error response will be generated.
53 #[serde(rename = "max_tls_version", skip_serializing_if = "Option::is_none")]
54 pub max_tls_version: Option<String>,
55 /// Minimum allowed TLS version on SSL connections to this backend. If your backend server is not able to negotiate a connection meeting this constraint, a synthetic `503` error response will be generated.
56 #[serde(rename = "min_tls_version", skip_serializing_if = "Option::is_none")]
57 pub min_tls_version: Option<String>,
58 /// The name of the backend.
59 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
60 pub name: Option<String>,
61 /// If set, will replace the client-supplied HTTP `Host` header on connections to this backend. Applied after VCL has been processed, so this setting will take precedence over changing `bereq.http.Host` in VCL.
62 #[serde(rename = "override_host", skip_serializing_if = "Option::is_none")]
63 pub override_host: Option<String>,
64 /// Port on which the backend server is listening for connections from Fastly. Setting `port` to 80 or 443 will also set `use_ssl` automatically (to false and true respectively), unless explicitly overridden by setting `use_ssl` in the same request.
65 #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
66 pub port: Option<i32>,
67 /// Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests.
68 #[serde(rename = "request_condition", skip_serializing_if = "Option::is_none")]
69 pub request_condition: Option<String>,
70 /// Value that when shared across backends will enable those backends to share the same health check.
71 #[serde(rename = "share_key", skip_serializing_if = "Option::is_none")]
72 pub share_key: Option<String>,
73 /// Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding).
74 #[serde(rename = "shield", skip_serializing_if = "Option::is_none")]
75 pub shield: Option<String>,
76 /// CA certificate attached to origin.
77 #[serde(rename = "ssl_ca_cert", skip_serializing_if = "Option::is_none")]
78 pub ssl_ca_cert: Option<String>,
79 /// Overrides `ssl_hostname`, but only for cert verification. Does not affect SNI at all.
80 #[serde(rename = "ssl_cert_hostname", skip_serializing_if = "Option::is_none")]
81 pub ssl_cert_hostname: Option<String>,
82 /// Be strict on checking SSL certs.
83 #[serde(rename = "ssl_check_cert", skip_serializing_if = "Option::is_none")]
84 pub ssl_check_cert: Option<bool>,
85 /// List of [OpenSSL ciphers](https://www.openssl.org/docs/man1.1.1/man1/ciphers.html) to support for connections to this origin. If your backend server is not able to negotiate a connection meeting this constraint, a synthetic `503` error response will be generated.
86 #[serde(rename = "ssl_ciphers", skip_serializing_if = "Option::is_none")]
87 pub ssl_ciphers: Option<String>,
88 /// Client certificate attached to origin.
89 #[serde(rename = "ssl_client_cert", skip_serializing_if = "Option::is_none")]
90 pub ssl_client_cert: Option<String>,
91 /// Client key attached to origin.
92 #[serde(rename = "ssl_client_key", skip_serializing_if = "Option::is_none")]
93 pub ssl_client_key: Option<String>,
94 /// Use `ssl_cert_hostname` and `ssl_sni_hostname` to configure certificate validation.
95 #[serde(rename = "ssl_hostname", skip_serializing_if = "Option::is_none")]
96 pub ssl_hostname: Option<String>,
97 /// Overrides `ssl_hostname`, but only for SNI in the handshake. Does not affect cert validation at all.
98 #[serde(rename = "ssl_sni_hostname", skip_serializing_if = "Option::is_none")]
99 pub ssl_sni_hostname: Option<String>,
100 /// Whether to enable TCP keepalives for backend connections. Varnish defaults to using keepalives if this is unspecified.
101 #[serde(rename = "tcp_keepalive_enable", skip_serializing_if = "Option::is_none")]
102 pub tcp_keepalive_enable: Option<bool>,
103 /// Interval in seconds between subsequent keepalive probes.
104 #[serde(rename = "tcp_keepalive_interval", skip_serializing_if = "Option::is_none")]
105 pub tcp_keepalive_interval: Option<i32>,
106 /// Number of unacknowledged probes to send before considering the connection dead.
107 #[serde(rename = "tcp_keepalive_probes", skip_serializing_if = "Option::is_none")]
108 pub tcp_keepalive_probes: Option<i32>,
109 /// Interval in seconds between the last data packet sent and the first keepalive probe.
110 #[serde(rename = "tcp_keepalive_time", skip_serializing_if = "Option::is_none")]
111 pub tcp_keepalive_time: Option<i32>,
112 /// Whether or not to require TLS for connections to this backend.
113 #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")]
114 pub use_ssl: Option<bool>,
115 /// Weight used to load balance this backend against others. May be any positive integer. If `auto_loadbalance` is true, the chance of this backend being selected is equal to its own weight over the sum of all weights for backends that have `auto_loadbalance` set to true.
116 #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
117 pub weight: Option<i32>,
118}
119
120impl Backend {
121 pub fn new() -> Backend {
122 Backend {
123 address: None,
124 auto_loadbalance: None,
125 between_bytes_timeout: None,
126 client_cert: None,
127 comment: None,
128 connect_timeout: None,
129 first_byte_timeout: None,
130 healthcheck: None,
131 hostname: None,
132 ipv4: None,
133 ipv6: None,
134 keepalive_time: None,
135 max_conn: None,
136 max_tls_version: None,
137 min_tls_version: None,
138 name: None,
139 override_host: None,
140 port: None,
141 request_condition: None,
142 share_key: None,
143 shield: None,
144 ssl_ca_cert: None,
145 ssl_cert_hostname: None,
146 ssl_check_cert: None,
147 ssl_ciphers: None,
148 ssl_client_cert: None,
149 ssl_client_key: None,
150 ssl_hostname: None,
151 ssl_sni_hostname: None,
152 tcp_keepalive_enable: None,
153 tcp_keepalive_interval: None,
154 tcp_keepalive_probes: None,
155 tcp_keepalive_time: None,
156 use_ssl: None,
157 weight: None,
158 }
159 }
160}
161
162