Skip to main content

oci_rust_sdk/core/models/
instance_console_connection.rs

1use serde::{Deserialize, Serialize};
2use std::collections::HashMap;
3
4#[allow(unused_imports)]
5use super::*;
6/// The {@code InstanceConsoleConnection} API provides you with console access to Compute instances, enabling you to troubleshoot malfunctioning instances remotely. <p> For more information about instance console connections, see [Troubleshooting Instances Using Instance Console Connections](https://docs.oracle.com/iaas/Content/Compute/References/serialconsole.htm).
7#[derive(Debug, Clone, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct InstanceConsoleConnection {
10    /// The OCID of the compartment to contain the console connection.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub compartment_id: Option<String>,
13
14    /// The SSH connection string for the console connection.
15    #[serde(skip_serializing_if = "Option::is_none")]
16    pub connection_string: Option<String>,
17
18    /// Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). <p> Example: {@code {\"Operations\": {\"CostCenter\": \"42\"}}}
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub defined_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
21
22    /// The SSH public key's fingerprint for client authentication to the console connection.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub fingerprint: Option<String>,
25
26    /// Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). <p> Example: {@code {\"Department\": \"Finance\"}}
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub freeform_tags: Option<HashMap<String, String>>,
29
30    /// The OCID of the console connection.
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub id: Option<String>,
33
34    /// The OCID of the instance the console connection connects to.
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub instance_id: Option<String>,
37
38    /// The current state of the console connection.
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub lifecycle_state: Option<InstanceConsoleConnectionLifecycleState>,
41
42    /// The SSH public key's fingerprint for the console connection service host.
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub service_host_key_fingerprint: Option<String>,
45
46    /// The SSH connection string for the SSH tunnel used to connect to the console connection over VNC.
47    #[serde(skip_serializing_if = "Option::is_none")]
48    pub vnc_connection_string: Option<String>,
49}
50
51impl InstanceConsoleConnection {
52    /// Create a new InstanceConsoleConnection
53    pub fn new() -> Self {
54        Self {
55            compartment_id: None,
56
57            connection_string: None,
58
59            defined_tags: None,
60
61            fingerprint: None,
62
63            freeform_tags: None,
64
65            id: None,
66
67            instance_id: None,
68
69            lifecycle_state: None,
70
71            service_host_key_fingerprint: None,
72
73            vnc_connection_string: None,
74        }
75    }
76
77    /// Set compartment_id
78    pub fn set_compartment_id(mut self, value: Option<String>) -> Self {
79        self.compartment_id = value;
80        self
81    }
82
83    /// Set connection_string
84    pub fn set_connection_string(mut self, value: Option<String>) -> Self {
85        self.connection_string = value;
86        self
87    }
88
89    /// Set defined_tags
90    pub fn set_defined_tags(
91        mut self,
92        value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
93    ) -> Self {
94        self.defined_tags = value;
95        self
96    }
97
98    /// Set fingerprint
99    pub fn set_fingerprint(mut self, value: Option<String>) -> Self {
100        self.fingerprint = value;
101        self
102    }
103
104    /// Set freeform_tags
105    pub fn set_freeform_tags(mut self, value: Option<HashMap<String, String>>) -> Self {
106        self.freeform_tags = value;
107        self
108    }
109
110    /// Set id
111    pub fn set_id(mut self, value: Option<String>) -> Self {
112        self.id = value;
113        self
114    }
115
116    /// Set instance_id
117    pub fn set_instance_id(mut self, value: Option<String>) -> Self {
118        self.instance_id = value;
119        self
120    }
121
122    /// Set lifecycle_state
123    pub fn set_lifecycle_state(
124        mut self,
125        value: Option<InstanceConsoleConnectionLifecycleState>,
126    ) -> Self {
127        self.lifecycle_state = value;
128        self
129    }
130
131    /// Set service_host_key_fingerprint
132    pub fn set_service_host_key_fingerprint(mut self, value: Option<String>) -> Self {
133        self.service_host_key_fingerprint = value;
134        self
135    }
136
137    /// Set vnc_connection_string
138    pub fn set_vnc_connection_string(mut self, value: Option<String>) -> Self {
139        self.vnc_connection_string = value;
140        self
141    }
142
143    /// Set compartment_id (unwraps Option)
144    pub fn with_compartment_id(mut self, value: impl Into<String>) -> Self {
145        self.compartment_id = Some(value.into());
146        self
147    }
148
149    /// Set connection_string (unwraps Option)
150    pub fn with_connection_string(mut self, value: impl Into<String>) -> Self {
151        self.connection_string = Some(value.into());
152        self
153    }
154
155    /// Set defined_tags (unwraps Option)
156    pub fn with_defined_tags(
157        mut self,
158        value: HashMap<String, HashMap<String, serde_json::Value>>,
159    ) -> Self {
160        self.defined_tags = Some(value);
161        self
162    }
163
164    /// Set fingerprint (unwraps Option)
165    pub fn with_fingerprint(mut self, value: impl Into<String>) -> Self {
166        self.fingerprint = Some(value.into());
167        self
168    }
169
170    /// Set freeform_tags (unwraps Option)
171    pub fn with_freeform_tags(mut self, value: HashMap<String, String>) -> Self {
172        self.freeform_tags = Some(value);
173        self
174    }
175
176    /// Set id (unwraps Option)
177    pub fn with_id(mut self, value: impl Into<String>) -> Self {
178        self.id = Some(value.into());
179        self
180    }
181
182    /// Set instance_id (unwraps Option)
183    pub fn with_instance_id(mut self, value: impl Into<String>) -> Self {
184        self.instance_id = Some(value.into());
185        self
186    }
187
188    /// Set lifecycle_state (unwraps Option)
189    pub fn with_lifecycle_state(mut self, value: InstanceConsoleConnectionLifecycleState) -> Self {
190        self.lifecycle_state = Some(value);
191        self
192    }
193
194    /// Set service_host_key_fingerprint (unwraps Option)
195    pub fn with_service_host_key_fingerprint(mut self, value: impl Into<String>) -> Self {
196        self.service_host_key_fingerprint = Some(value.into());
197        self
198    }
199
200    /// Set vnc_connection_string (unwraps Option)
201    pub fn with_vnc_connection_string(mut self, value: impl Into<String>) -> Self {
202        self.vnc_connection_string = Some(value.into());
203        self
204    }
205}
206
207impl Default for InstanceConsoleConnection {
208    fn default() -> Self {
209        Self::new()
210    }
211}