fastly_api/models/backend_response.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 BackendResponse {
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, for Delivery services, the response received so far will be considered complete and the fetch will end. For Compute services, timeout expiration is treated as a failure of the backend connection, and an error is generated. 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 /// Maximum duration in milliseconds to wait for the entire response to be received 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.fetch_timeout`.
35 #[serde(rename = "fetch_timeout", skip_serializing_if = "Option::is_none")]
36 pub fetch_timeout: Option<i32>,
37 /// The name of the healthcheck to use with this backend.
38 #[serde(rename = "healthcheck", skip_serializing_if = "Option::is_none")]
39 pub healthcheck: Option<String>,
40 /// The hostname of the backend. May be used as an alternative to `address` to set the backend location.
41 #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
42 pub hostname: Option<String>,
43 /// IPv4 address of the backend. May be used as an alternative to `address` to set the backend location.
44 #[serde(rename = "ipv4", skip_serializing_if = "Option::is_none")]
45 pub ipv4: Option<String>,
46 /// IPv6 address of the backend. May be used as an alternative to `address` to set the backend location.
47 #[serde(rename = "ipv6", skip_serializing_if = "Option::is_none")]
48 pub ipv6: Option<String>,
49 /// How long in seconds to keep a persistent connection to the backend between requests. By default, Varnish keeps connections open as long as it can.
50 #[serde(rename = "keepalive_time", skip_serializing_if = "Option::is_none")]
51 pub keepalive_time: Option<i32>,
52 /// Maximum number of concurrent connections this backend will accept.
53 #[serde(rename = "max_conn", skip_serializing_if = "Option::is_none")]
54 pub max_conn: Option<i32>,
55 /// 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.
56 #[serde(rename = "max_tls_version", skip_serializing_if = "Option::is_none")]
57 pub max_tls_version: Option<String>,
58 /// 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.
59 #[serde(rename = "min_tls_version", skip_serializing_if = "Option::is_none")]
60 pub min_tls_version: Option<String>,
61 /// The name of the backend.
62 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
63 pub name: Option<String>,
64 /// 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.
65 #[serde(rename = "override_host", skip_serializing_if = "Option::is_none")]
66 pub override_host: Option<String>,
67 /// 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.
68 #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
69 pub port: Option<i32>,
70 /// Prefer IPv6 connections to origins for hostname backends. Default is 'false' for Delivery services and 'true' for Compute services.
71 #[serde(rename = "prefer_ipv6", skip_serializing_if = "Option::is_none")]
72 pub prefer_ipv6: Option<bool>,
73 /// 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.
74 #[serde(rename = "request_condition", skip_serializing_if = "Option::is_none")]
75 pub request_condition: Option<String>,
76 /// Value that when shared across backends will enable those backends to share the same health check.
77 #[serde(rename = "share_key", skip_serializing_if = "Option::is_none")]
78 pub share_key: Option<String>,
79 /// Identifier of the POP to use as a [shield](https://www.fastly.com/documentation/guides/getting-started/hosts/shielding/).
80 #[serde(rename = "shield", skip_serializing_if = "Option::is_none")]
81 pub shield: Option<String>,
82 /// CA certificate attached to origin.
83 #[serde(rename = "ssl_ca_cert", skip_serializing_if = "Option::is_none")]
84 pub ssl_ca_cert: Option<String>,
85 /// Overrides `ssl_hostname`, but only for cert verification. Does not affect SNI at all.
86 #[serde(rename = "ssl_cert_hostname", skip_serializing_if = "Option::is_none")]
87 pub ssl_cert_hostname: Option<String>,
88 /// Be strict on checking SSL certs.
89 #[serde(rename = "ssl_check_cert", skip_serializing_if = "Option::is_none")]
90 pub ssl_check_cert: Option<bool>,
91 /// 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.
92 #[serde(rename = "ssl_ciphers", skip_serializing_if = "Option::is_none")]
93 pub ssl_ciphers: Option<String>,
94 /// Client certificate attached to origin.
95 #[serde(rename = "ssl_client_cert", skip_serializing_if = "Option::is_none")]
96 pub ssl_client_cert: Option<String>,
97 /// Client key attached to origin.
98 #[serde(rename = "ssl_client_key", skip_serializing_if = "Option::is_none")]
99 pub ssl_client_key: Option<String>,
100 /// Use `ssl_cert_hostname` and `ssl_sni_hostname` to configure certificate validation.
101 #[serde(rename = "ssl_hostname", skip_serializing_if = "Option::is_none")]
102 pub ssl_hostname: Option<String>,
103 /// Overrides `ssl_hostname`, but only for SNI in the handshake. Does not affect cert validation at all.
104 #[serde(rename = "ssl_sni_hostname", skip_serializing_if = "Option::is_none")]
105 pub ssl_sni_hostname: Option<String>,
106 /// Whether to enable TCP keepalives for backend connections. Varnish defaults to using keepalives if this is unspecified.
107 #[serde(rename = "tcp_keepalive_enable", skip_serializing_if = "Option::is_none")]
108 pub tcp_keepalive_enable: Option<bool>,
109 /// Interval in seconds between subsequent keepalive probes.
110 #[serde(rename = "tcp_keepalive_interval", skip_serializing_if = "Option::is_none")]
111 pub tcp_keepalive_interval: Option<i32>,
112 /// Number of unacknowledged probes to send before considering the connection dead.
113 #[serde(rename = "tcp_keepalive_probes", skip_serializing_if = "Option::is_none")]
114 pub tcp_keepalive_probes: Option<i32>,
115 /// Interval in seconds between the last data packet sent and the first keepalive probe.
116 #[serde(rename = "tcp_keepalive_time", skip_serializing_if = "Option::is_none")]
117 pub tcp_keepalive_time: Option<i32>,
118 /// Whether or not to require TLS for connections to this backend.
119 #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")]
120 pub use_ssl: Option<bool>,
121 /// 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.
122 #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
123 pub weight: Option<i32>,
124 /// Date and time in ISO 8601 format.
125 #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
126 pub created_at: Option<String>,
127 /// Date and time in ISO 8601 format.
128 #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
129 pub deleted_at: Option<String>,
130 /// Date and time in ISO 8601 format.
131 #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
132 pub updated_at: Option<String>,
133 #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
134 pub service_id: Option<Box<String>>,
135 #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
136 pub version: Option<Box<i32>>,
137 /// Indicates whether the version of the service this backend is attached to accepts edits.
138 #[serde(rename = "locked", skip_serializing_if = "Option::is_none")]
139 pub locked: Option<bool>,
140}
141
142impl BackendResponse {
143 pub fn new() -> BackendResponse {
144 BackendResponse {
145 address: None,
146 auto_loadbalance: None,
147 between_bytes_timeout: None,
148 client_cert: None,
149 comment: None,
150 connect_timeout: None,
151 first_byte_timeout: None,
152 fetch_timeout: None,
153 healthcheck: None,
154 hostname: None,
155 ipv4: None,
156 ipv6: None,
157 keepalive_time: None,
158 max_conn: None,
159 max_tls_version: None,
160 min_tls_version: None,
161 name: None,
162 override_host: None,
163 port: None,
164 prefer_ipv6: None,
165 request_condition: None,
166 share_key: None,
167 shield: None,
168 ssl_ca_cert: None,
169 ssl_cert_hostname: None,
170 ssl_check_cert: None,
171 ssl_ciphers: None,
172 ssl_client_cert: None,
173 ssl_client_key: None,
174 ssl_hostname: None,
175 ssl_sni_hostname: None,
176 tcp_keepalive_enable: None,
177 tcp_keepalive_interval: None,
178 tcp_keepalive_probes: None,
179 tcp_keepalive_time: None,
180 use_ssl: None,
181 weight: None,
182 created_at: None,
183 deleted_at: None,
184 updated_at: None,
185 service_id: None,
186 version: None,
187 locked: None,
188 }
189 }
190}
191
192