hanzo_client/models/backend_status.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct BackendStatus {
16 /// Error is the failure text from a leg whose status is degraded — the reason a configured backend could not answer. Absent otherwise.
17 #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
18 pub error: Option<String>,
19 /// Hits is how many results this leg returned, counted BEFORE fusion, so it is not the number that survived into Fusion.Hits — fusion merges what both legs found and the caller's limit and offset then page it. 0 for a leg that did not run.
20 #[serde(rename = "hits", skip_serializing_if = "Option::is_none")]
21 pub hits: Option<i32>,
22 /// Name is which leg this reports: \"index\", the lexical store, \"vector\", the semantic one, or \"code\", the org's own repositories. Match.Backend uses the same three names.
23 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
24 pub name: Option<String>,
25 /// Status is one of ok, degraded, disabled, skipped — four distinct operational facts that are never collapsed. It ran and answered; it is configured and FAILED (Error says how, and only this one is a fault); this deployment never provisioned it; or the request's mode excluded it.
26 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
27 pub status: Option<String>,
28 /// TookMS is how long this leg took, in milliseconds, timed around its own call and excluding fusion. 0 for a leg that was skipped or is disabled, since nothing was called.
29 #[serde(rename = "took_ms", skip_serializing_if = "Option::is_none")]
30 pub took_ms: Option<i32>,
31}
32
33impl BackendStatus {
34 pub fn new() -> BackendStatus {
35 BackendStatus {
36 error: None,
37 hits: None,
38 name: None,
39 status: None,
40 took_ms: None,
41 }
42 }
43}
44