tembo_api_client/models/
app_service.rs

1/*
2 * Tembo Cloud
3 *
4 * Platform API for Tembo Cloud             </br>             </br>             To find a Tembo Data API, please find it here:             </br>             </br>             [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/)
5 *
6 * The version of the OpenAPI document: v1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// AppService : AppService significantly extends the functionality of your Tembo Postgres instance by running tools and software built by the Postgres open source community.  **Example**: This will configure and install a Postgrest container along side the Postgres instance, install pg_graphql extension, and configure the ingress routing to expose the Postgrest service.  ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: trunk_installs: - name: pg_graphql version: 1.2.0 extensions: - name: pg_graphql locations: - database: postgres enabled: true  appServices: - name: postgrest image: postgrest/postgrest:latest
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AppService {
17    /// Defines the arguments to pass into the container if needed. You define this in the same manner as you would for all Kubernetes containers. See the [Kubernetes docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container).
18    #[serde(
19        rename = "args",
20        default,
21        with = "::serde_with::rust::double_option",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub args: Option<Option<Vec<String>>>,
25    /// Defines the command into the container if needed. You define this in the same manner as you would for all Kubernetes containers. See the [Kubernetes docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container).
26    #[serde(
27        rename = "command",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub command: Option<Option<Vec<String>>>,
33    /// Defines the environment variables to pass into the container if needed. You define this in the same manner as you would for all Kubernetes containers. See the [Kubernetes docs](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container).
34    #[serde(
35        rename = "env",
36        default,
37        with = "::serde_with::rust::double_option",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub env: Option<Option<Vec<models::EnvVar>>>,
41    /// Defines the container image to use for the appService.
42    #[serde(rename = "image")]
43    pub image: String,
44    #[serde(
45        rename = "metrics",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub metrics: Option<Option<Box<models::AppMetrics>>>,
51    /// Defines the ingress middeware configuration for the appService. This is specifically configured for the ingress controller Traefik.
52    #[serde(
53        rename = "middlewares",
54        default,
55        with = "::serde_with::rust::double_option",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub middlewares: Option<Option<Vec<models::Middleware>>>,
59    /// Defines the name of the appService.
60    #[serde(rename = "name")]
61    pub name: String,
62    #[serde(
63        rename = "probes",
64        default,
65        with = "::serde_with::rust::double_option",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub probes: Option<Option<Box<models::Probes>>>,
69    #[serde(rename = "resources", skip_serializing_if = "Option::is_none")]
70    pub resources: Option<Box<models::ResourceRequirements>>,
71    /// Defines the routing configuration for the appService.
72    #[serde(
73        rename = "routing",
74        default,
75        with = "::serde_with::rust::double_option",
76        skip_serializing_if = "Option::is_none"
77    )]
78    pub routing: Option<Option<Vec<models::Routing>>>,
79    #[serde(
80        rename = "storage",
81        default,
82        with = "::serde_with::rust::double_option",
83        skip_serializing_if = "Option::is_none"
84    )]
85    pub storage: Option<Option<Box<models::StorageConfig>>>,
86}
87
88impl AppService {
89    /// AppService significantly extends the functionality of your Tembo Postgres instance by running tools and software built by the Postgres open source community.  **Example**: This will configure and install a Postgrest container along side the Postgres instance, install pg_graphql extension, and configure the ingress routing to expose the Postgrest service.  ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: trunk_installs: - name: pg_graphql version: 1.2.0 extensions: - name: pg_graphql locations: - database: postgres enabled: true  appServices: - name: postgrest image: postgrest/postgrest:latest
90    pub fn new(image: String, name: String) -> AppService {
91        AppService {
92            args: None,
93            command: None,
94            env: None,
95            image,
96            metrics: None,
97            middlewares: None,
98            name,
99            probes: None,
100            resources: None,
101            routing: None,
102            storage: None,
103        }
104    }
105}