fastly_api/models/server.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 Server {
13 /// Weight (`1-100`) used to load balance this server against others.
14 #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
15 pub weight: Option<i32>,
16 /// Maximum number of connections. If the value is `0`, it inherits the value from pool's `max_conn_default`.
17 #[serde(rename = "max_conn", skip_serializing_if = "Option::is_none")]
18 pub max_conn: Option<i32>,
19 /// Port number. Setting port `443` does not force TLS. Set `use_tls` in pool to force TLS.
20 #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
21 pub port: Option<i32>,
22 /// A hostname, IPv4, or IPv6 address for the server. Required.
23 #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
24 pub address: Option<String>,
25 /// A freeform descriptive note.
26 #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
27 pub comment: Option<String>,
28 /// Allows servers to be enabled and disabled in a pool.
29 #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")]
30 pub disabled: Option<bool>,
31 /// The hostname to override the Host header. Defaults to `null` meaning no override of the Host header if not set. This setting can also be added to a Pool definition. However, the server setting will override the Pool setting.
32 #[serde(rename = "override_host", skip_serializing_if = "Option::is_none")]
33 pub override_host: Option<String>,
34}
35
36impl Server {
37 pub fn new() -> Server {
38 Server {
39 weight: None,
40 max_conn: None,
41 port: None,
42 address: None,
43 comment: None,
44 disabled: None,
45 override_host: None,
46 }
47 }
48}
49
50