fastly_api/models/
logging_elasticsearch_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 LoggingElasticsearchResponse {
13    /// The name for the real-time logging configuration.
14    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
15    pub name: Option<String>,
16    /// Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. 
17    #[serde(rename = "placement", skip_serializing_if = "Option::is_none")]
18    pub placement: Option<Placement>,
19    /// The name of an existing condition in the configured endpoint, or leave blank to always execute.
20    #[serde(rename = "response_condition", skip_serializing_if = "Option::is_none")]
21    pub response_condition: Option<String>,
22    /// A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). Must produce valid JSON that Elasticsearch can ingest.
23    #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
24    pub format: Option<String>,
25    /// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
26    #[serde(rename = "log_processing_region", skip_serializing_if = "Option::is_none")]
27    pub log_processing_region: Option<LogProcessingRegion>,
28    /// The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. 
29    #[serde(rename = "format_version", skip_serializing_if = "Option::is_none")]
30    pub format_version: Option<FormatVersion>,
31    /// A secure certificate to authenticate a server with. Must be in PEM format.
32    #[serde(rename = "tls_ca_cert", skip_serializing_if = "Option::is_none")]
33    pub tls_ca_cert: Option<String>,
34    /// The client certificate used to make authenticated requests. Must be in PEM format.
35    #[serde(rename = "tls_client_cert", skip_serializing_if = "Option::is_none")]
36    pub tls_client_cert: Option<String>,
37    /// The client private key used to make authenticated requests. Must be in PEM format.
38    #[serde(rename = "tls_client_key", skip_serializing_if = "Option::is_none")]
39    pub tls_client_key: Option<String>,
40    /// The hostname to verify the server's certificate. This should be one of the Subject Alternative Name (SAN) fields for the certificate. Common Names (CN) are not supported.
41    #[serde(rename = "tls_hostname", skip_serializing_if = "Option::is_none")]
42    pub tls_hostname: Option<String>,
43    /// The maximum number of logs sent in one request. Defaults `0` for unbounded.
44    #[serde(rename = "request_max_entries", skip_serializing_if = "Option::is_none")]
45    pub request_max_entries: Option<i32>,
46    /// The maximum number of bytes sent in one request. Defaults `0` for unbounded.
47    #[serde(rename = "request_max_bytes", skip_serializing_if = "Option::is_none")]
48    pub request_max_bytes: Option<i32>,
49    /// The name of the Elasticsearch index to send documents (logs) to. The index must follow the Elasticsearch [index format rules](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html). We support [strftime](https://www.man7.org/linux/man-pages/man3/strftime.3.html) interpolated variables inside braces prefixed with a pound symbol. For example, `#{%F}` will interpolate as `YYYY-MM-DD` with today's date.
50    #[serde(rename = "index", skip_serializing_if = "Option::is_none")]
51    pub index: Option<String>,
52    /// The URL to stream logs to. Must use HTTPS.
53    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
54    pub url: Option<String>,
55    /// The ID of the Elasticsearch ingest pipeline to apply pre-process transformations to before indexing. Learn more about creating a pipeline in the [Elasticsearch docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html).
56    #[serde(rename = "pipeline", skip_serializing_if = "Option::is_none")]
57    pub pipeline: Option<String>,
58    /// Basic Auth username.
59    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
60    pub user: Option<String>,
61    /// Basic Auth password.
62    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
63    pub password: Option<String>,
64    /// Date and time in ISO 8601 format.
65    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
66    pub created_at: Option<String>,
67    /// Date and time in ISO 8601 format.
68    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
69    pub deleted_at: Option<String>,
70    /// Date and time in ISO 8601 format.
71    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
72    pub updated_at: Option<String>,
73    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
74    pub service_id: Option<Box<String>>,
75    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
76    pub version: Option<Box<String>>,
77}
78
79impl LoggingElasticsearchResponse {
80    pub fn new() -> LoggingElasticsearchResponse {
81        LoggingElasticsearchResponse {
82            name: None,
83            placement: None,
84            response_condition: None,
85            format: None,
86            log_processing_region: None,
87            format_version: None,
88            tls_ca_cert: None,
89            tls_client_cert: None,
90            tls_client_key: None,
91            tls_hostname: None,
92            request_max_entries: None,
93            request_max_bytes: None,
94            index: None,
95            url: None,
96            pipeline: None,
97            user: None,
98            password: None,
99            created_at: None,
100            deleted_at: None,
101            updated_at: None,
102            service_id: None,
103            version: None,
104        }
105    }
106}
107
108/// Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. 
109#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
110pub enum Placement {
111    #[serde(rename = "none")]
112    None,
113    #[serde(rename = "null")]
114    Null,
115}
116
117impl Default for Placement {
118    fn default() -> Placement {
119        Self::None
120    }
121}
122/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
123#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
124pub enum LogProcessingRegion {
125    #[serde(rename = "none")]
126    None,
127    #[serde(rename = "eu")]
128    Eu,
129    #[serde(rename = "us")]
130    Us,
131}
132
133impl Default for LogProcessingRegion {
134    fn default() -> LogProcessingRegion {
135        Self::None
136    }
137}
138/// The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. 
139#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
140pub enum FormatVersion {
141    #[serde(rename = "1")]
142    V1,
143    #[serde(rename = "2")]
144    V2,
145}
146
147impl Default for FormatVersion {
148    fn default() -> FormatVersion {
149        Self::V1
150    }
151}
152