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, 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. By default, Varnish keeps connections open as long as it can.
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    /// Prefer IPv6 connections to origins for hostname backends.
68    #[serde(rename = "prefer_ipv6", skip_serializing_if = "Option::is_none")]
69    pub prefer_ipv6: Option<bool>,
70    /// 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.
71    #[serde(rename = "request_condition", skip_serializing_if = "Option::is_none")]
72    pub request_condition: Option<String>,
73    /// Value that when shared across backends will enable those backends to share the same health check.
74    #[serde(rename = "share_key", skip_serializing_if = "Option::is_none")]
75    pub share_key: Option<String>,
76    /// Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding).
77    #[serde(rename = "shield", skip_serializing_if = "Option::is_none")]
78    pub shield: Option<String>,
79    /// CA certificate attached to origin.
80    #[serde(rename = "ssl_ca_cert", skip_serializing_if = "Option::is_none")]
81    pub ssl_ca_cert: Option<String>,
82    /// Overrides `ssl_hostname`, but only for cert verification. Does not affect SNI at all.
83    #[serde(rename = "ssl_cert_hostname", skip_serializing_if = "Option::is_none")]
84    pub ssl_cert_hostname: Option<String>,
85    /// Be strict on checking SSL certs.
86    #[serde(rename = "ssl_check_cert", skip_serializing_if = "Option::is_none")]
87    pub ssl_check_cert: Option<bool>,
88    /// 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.
89    #[serde(rename = "ssl_ciphers", skip_serializing_if = "Option::is_none")]
90    pub ssl_ciphers: Option<String>,
91    /// Client certificate attached to origin.
92    #[serde(rename = "ssl_client_cert", skip_serializing_if = "Option::is_none")]
93    pub ssl_client_cert: Option<String>,
94    /// Client key attached to origin.
95    #[serde(rename = "ssl_client_key", skip_serializing_if = "Option::is_none")]
96    pub ssl_client_key: Option<String>,
97    /// Use `ssl_cert_hostname` and `ssl_sni_hostname` to configure certificate validation.
98    #[serde(rename = "ssl_hostname", skip_serializing_if = "Option::is_none")]
99    pub ssl_hostname: Option<String>,
100    /// Overrides `ssl_hostname`, but only for SNI in the handshake. Does not affect cert validation at all.
101    #[serde(rename = "ssl_sni_hostname", skip_serializing_if = "Option::is_none")]
102    pub ssl_sni_hostname: Option<String>,
103    /// Whether to enable TCP keepalives for backend connections. Varnish defaults to using keepalives if this is unspecified.
104    #[serde(rename = "tcp_keepalive_enable", skip_serializing_if = "Option::is_none")]
105    pub tcp_keepalive_enable: Option<bool>,
106    /// Interval in seconds between subsequent keepalive probes.
107    #[serde(rename = "tcp_keepalive_interval", skip_serializing_if = "Option::is_none")]
108    pub tcp_keepalive_interval: Option<i32>,
109    /// Number of unacknowledged probes to send before considering the connection dead.
110    #[serde(rename = "tcp_keepalive_probes", skip_serializing_if = "Option::is_none")]
111    pub tcp_keepalive_probes: Option<i32>,
112    /// Interval in seconds between the last data packet sent and the first keepalive probe.
113    #[serde(rename = "tcp_keepalive_time", skip_serializing_if = "Option::is_none")]
114    pub tcp_keepalive_time: Option<i32>,
115    /// Whether or not to require TLS for connections to this backend.
116    #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")]
117    pub use_ssl: Option<bool>,
118    /// 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.
119    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
120    pub weight: Option<i32>,
121    /// Date and time in ISO 8601 format.
122    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
123    pub created_at: Option<String>,
124    /// Date and time in ISO 8601 format.
125    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
126    pub deleted_at: Option<String>,
127    /// Date and time in ISO 8601 format.
128    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
129    pub updated_at: Option<String>,
130    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
131    pub service_id: Option<Box<String>>,
132    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
133    pub version: Option<Box<i32>>,
134    /// Indicates whether the version of the service this backend is attached to accepts edits.
135    #[serde(rename = "locked", skip_serializing_if = "Option::is_none")]
136    pub locked: Option<bool>,
137}
138
139impl BackendResponse {
140    pub fn new() -> BackendResponse {
141        BackendResponse {
142            address: None,
143            auto_loadbalance: None,
144            between_bytes_timeout: None,
145            client_cert: None,
146            comment: None,
147            connect_timeout: None,
148            first_byte_timeout: None,
149            healthcheck: None,
150            hostname: None,
151            ipv4: None,
152            ipv6: None,
153            keepalive_time: None,
154            max_conn: None,
155            max_tls_version: None,
156            min_tls_version: None,
157            name: None,
158            override_host: None,
159            port: None,
160            prefer_ipv6: None,
161            request_condition: None,
162            share_key: None,
163            shield: None,
164            ssl_ca_cert: None,
165            ssl_cert_hostname: None,
166            ssl_check_cert: None,
167            ssl_ciphers: None,
168            ssl_client_cert: None,
169            ssl_client_key: None,
170            ssl_hostname: None,
171            ssl_sni_hostname: None,
172            tcp_keepalive_enable: None,
173            tcp_keepalive_interval: None,
174            tcp_keepalive_probes: None,
175            tcp_keepalive_time: None,
176            use_ssl: None,
177            weight: None,
178            created_at: None,
179            deleted_at: None,
180            updated_at: None,
181            service_id: None,
182            version: None,
183            locked: None,
184        }
185    }
186}
187
188