Skip to main content

openapi_service_fabric/models/
container_code_package_properties.rs

1/*
2 * Service Fabric Client APIs
3 *
4 * Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services.
5 *
6 * The version of the OpenAPI document: 8.2
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ContainerCodePackageProperties : Describes a container and its runtime properties.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ContainerCodePackageProperties {
17    /// The name of the code package.
18    #[serde(rename = "name")]
19    pub name: String,
20    /// The Container image to use.
21    #[serde(rename = "image")]
22    pub image: String,
23    #[serde(
24        rename = "imageRegistryCredential",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub image_registry_credential: Option<Box<models::ImageRegistryCredential>>,
28    /// Override for the default entry point in the container.
29    #[serde(rename = "entryPoint", skip_serializing_if = "Option::is_none")]
30    pub entry_point: Option<String>,
31    /// Command array to execute within the container in exec form.
32    #[serde(rename = "commands", skip_serializing_if = "Option::is_none")]
33    pub commands: Option<Vec<String>>,
34    /// The environment variables to set in this container
35    #[serde(
36        rename = "environmentVariables",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub environment_variables: Option<Vec<models::EnvironmentVariable>>,
40    /// The settings to set in this container. The setting file path can be fetched from environment variable \"Fabric_SettingPath\". The path for Windows container is \"C:\\\\secrets\". The path for Linux container is \"/var/secrets\".
41    #[serde(rename = "settings", skip_serializing_if = "Option::is_none")]
42    pub settings: Option<Vec<models::Setting>>,
43    /// The labels to set in this container.
44    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
45    pub labels: Option<Vec<models::ContainerLabel>>,
46    /// The endpoints exposed by this container.
47    #[serde(rename = "endpoints", skip_serializing_if = "Option::is_none")]
48    pub endpoints: Option<Vec<models::EndpointProperties>>,
49    #[serde(rename = "resources")]
50    pub resources: Box<models::ResourceRequirements>,
51    /// Volumes to be attached to the container. The lifetime of these volumes is independent of the application's lifetime.
52    #[serde(rename = "volumeRefs", skip_serializing_if = "Option::is_none")]
53    pub volume_refs: Option<Vec<models::VolumeReference>>,
54    /// Volumes to be attached to the container. The lifetime of these volumes is scoped to the application's lifetime.
55    #[serde(rename = "volumes", skip_serializing_if = "Option::is_none")]
56    pub volumes: Option<Vec<models::ApplicationScopedVolume>>,
57    #[serde(rename = "diagnostics", skip_serializing_if = "Option::is_none")]
58    pub diagnostics: Option<Box<models::DiagnosticsRef>>,
59    /// A list of ReliableCollection resources used by this particular code package. Please refer to ReliableCollectionsRef for more details.
60    #[serde(
61        rename = "reliableCollectionsRefs",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub reliable_collections_refs: Option<Vec<models::ReliableCollectionsRef>>,
65    #[serde(rename = "instanceView", skip_serializing_if = "Option::is_none")]
66    pub instance_view: Option<Box<models::ContainerInstanceView>>,
67    /// An array of liveness probes for a code package. It determines when to restart a code package.
68    #[serde(rename = "livenessProbe", skip_serializing_if = "Option::is_none")]
69    pub liveness_probe: Option<Vec<models::Probe>>,
70    /// An array of readiness probes for a code package. It determines when to unpublish an endpoint.
71    #[serde(rename = "readinessProbe", skip_serializing_if = "Option::is_none")]
72    pub readiness_probe: Option<Vec<models::Probe>>,
73}
74
75impl ContainerCodePackageProperties {
76    /// Describes a container and its runtime properties.
77    pub fn new(
78        name: String,
79        image: String,
80        resources: models::ResourceRequirements,
81    ) -> ContainerCodePackageProperties {
82        ContainerCodePackageProperties {
83            name,
84            image,
85            image_registry_credential: None,
86            entry_point: None,
87            commands: None,
88            environment_variables: None,
89            settings: None,
90            labels: None,
91            endpoints: None,
92            resources: Box::new(resources),
93            volume_refs: None,
94            volumes: None,
95            diagnostics: None,
96            reliable_collections_refs: None,
97            instance_view: None,
98            liveness_probe: None,
99            readiness_probe: None,
100        }
101    }
102}