Skip to main content

oci_rust_sdk/core/models/
virtual_circuit.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use std::collections::HashMap;
4
5#[allow(unused_imports)]
6use super::*;
7/// For use with Oracle Cloud Infrastructure FastConnect. <p> A virtual circuit is an isolated network path that runs over one or more physical network connections to provide a single, logical connection between the edge router on the customer's existing network and Oracle Cloud Infrastructure. *Private* virtual circuits support private peering, and *public* virtual circuits support public peering. For more information, see [FastConnect Overview](https://docs.oracle.com/iaas/Content/Network/Concepts/fastconnect.htm). <p> Each virtual circuit is made up of information shared between a customer, Oracle, and a provider (if the customer is using FastConnect via a provider). Who fills in a given property of a virtual circuit depends on whether the BGP session related to that virtual circuit goes from the customer's edge router to Oracle, or from the provider's edge router to Oracle. Also, in the case where the customer is using a provider, values for some of the properties may not be present immediately, but may get filled in as the provider and Oracle each do their part to provision the virtual circuit. <p> To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies](https://docs.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm).
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct VirtualCircuit {
11    /// The provisioned data rate of the connection. To get a list of the available bandwidth levels (that is, shapes), see {@link #listFastConnectProviderVirtualCircuitBandwidthShapes(ListFastConnectProviderVirtualCircuitBandwidthShapesRequest) listFastConnectProviderVirtualCircuitBandwidthShapes}. <p> Example: {@code 10 Gbps}
12    #[serde(skip_serializing_if = "Option::is_none")]
13    pub bandwidth_shape_name: Option<String>,
14
15    /// Deprecated. Instead use the information in {@link FastConnectProviderService}.
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub bgp_management: Option<VirtualCircuitBgpManagement>,
18
19    /// The state of the Ipv4 BGP session associated with the virtual circuit.
20    #[serde(skip_serializing_if = "Option::is_none")]
21    pub bgp_session_state: Option<VirtualCircuitBgpSessionState>,
22
23    /// The state of the Ipv6 BGP session associated with the virtual circuit.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    pub bgp_ipv6_session_state: Option<VirtualCircuitBgpIpv6SessionState>,
26
27    /// The [OCID](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the virtual circuit.
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub compartment_id: Option<String>,
30
31    /// An array of mappings, each containing properties for a cross-connect or cross-connect group that is associated with this virtual circuit.
32    #[serde(skip_serializing_if = "Option::is_none")]
33    pub cross_connect_mappings: Option<Vec<CrossConnectMapping>>,
34
35    /// The routing policy sets how routing information about the Oracle cloud is shared over a public virtual circuit. Policies available are: {@code ORACLE_SERVICE_NETWORK}, {@code REGIONAL}, {@code MARKET_LEVEL}, and {@code GLOBAL}. See [Route Filtering](https://docs.oracle.com/iaas/Content/Network/Concepts/routingonprem.htm#route_filtering) for details. By default, routing information is shared for all routes in the same market.
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub routing_policy: Option<Vec<VirtualCircuitRoutingPolicy>>,
38
39    /// Set to {@code ENABLED} (the default) to activate the BGP session of the virtual circuit, set to {@code DISABLED} to deactivate the virtual circuit.
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub bgp_admin_state: Option<VirtualCircuitBgpAdminState>,
42
43    /// Set to {@code true} to enable BFD for IPv4 BGP peering, or set to {@code false} to disable BFD. If this is not set, the default is {@code false}.
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub is_bfd_enabled: Option<bool>,
46
47    /// Set to {@code true} for the virtual circuit to carry only encrypted traffic, or set to {@code false} for the virtual circuit to carry unencrypted traffic. If this is not set, the default is {@code false}.
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub is_transport_mode: Option<bool>,
50
51    /// Deprecated. Instead use {@code customerAsn}. If you specify values for both, the request will be rejected. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub customer_bgp_asn: Option<i64>,
54
55    /// The BGP ASN of the network at the other end of the BGP session from Oracle. If the session is between the customer's edge router and Oracle, the value is the customer's ASN. If the BGP session is between the provider's edge router and Oracle, the value is the provider's ASN. Can be a 2-byte or 4-byte ASN. Uses \"asplain\" format. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
56    #[serde(skip_serializing_if = "Option::is_none")]
57    pub customer_asn: Option<i64>,
58
59    /// 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\"}}}
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub defined_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
62
63    /// A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub display_name: Option<String>,
66
67    /// 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\"}}
68    #[serde(skip_serializing_if = "Option::is_none")]
69    pub freeform_tags: Option<HashMap<String, String>>,
70
71    /// The [OCID](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the customer's {@link Drg} that this virtual circuit uses. Applicable only to private virtual circuits.
72    #[serde(skip_serializing_if = "Option::is_none")]
73    pub gateway_id: Option<String>,
74
75    /// The virtual circuit's Oracle ID ([OCID](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)).
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub id: Option<String>,
78
79    /// The virtual circuit's current state. For information about the different states, see [FastConnect Overview](https://docs.oracle.com/iaas/Content/Network/Concepts/fastconnect.htm).
80    #[serde(skip_serializing_if = "Option::is_none")]
81    pub lifecycle_state: Option<VirtualCircuitLifecycleState>,
82
83    /// The Oracle BGP ASN. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub oracle_bgp_asn: Option<i64>,
86
87    /// Deprecated. Instead use {@code providerServiceId}.
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub provider_name: Option<String>,
90
91    /// The [OCID](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the service offered by the provider (if the customer is connecting via a provider).
92    #[serde(skip_serializing_if = "Option::is_none")]
93    pub provider_service_id: Option<String>,
94
95    /// The service key name offered by the provider (if the customer is connecting via a provider).
96    #[serde(skip_serializing_if = "Option::is_none")]
97    pub provider_service_key_name: Option<String>,
98
99    /// Deprecated. Instead use {@code providerServiceId}.
100    #[serde(skip_serializing_if = "Option::is_none")]
101    pub provider_service_name: Option<String>,
102
103    /// The provider's state in relation to this virtual circuit (if the customer is connecting via a provider). ACTIVE means the provider has provisioned the virtual circuit from their end. INACTIVE means the provider has not yet provisioned the virtual circuit, or has de-provisioned it.
104    #[serde(skip_serializing_if = "Option::is_none")]
105    pub provider_state: Option<VirtualCircuitProviderState>,
106
107    /// For a public virtual circuit. The public IP prefixes (CIDRs) the customer wants to advertise across the connection. All prefix sizes are allowed.
108    #[serde(skip_serializing_if = "Option::is_none")]
109    pub public_prefixes: Option<Vec<String>>,
110
111    /// Provider-supplied reference information about this virtual circuit (if the customer is connecting via a provider).
112    #[serde(skip_serializing_if = "Option::is_none")]
113    pub reference_comment: Option<String>,
114
115    /// The Oracle Cloud Infrastructure region where this virtual circuit is located.
116    #[serde(skip_serializing_if = "Option::is_none")]
117    pub region: Option<String>,
118
119    /// Provider service type.
120    #[serde(skip_serializing_if = "Option::is_none")]
121    pub service_type: Option<VirtualCircuitServiceType>,
122
123    /// The date and time the virtual circuit was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). <p> Example: {@code 2016-08-25T21:10:29.600Z}
124    #[serde(skip_serializing_if = "Option::is_none")]
125    pub time_created: Option<DateTime<Utc>>,
126
127    /// Whether the virtual circuit supports private or public peering. For more information, see [FastConnect Overview](https://docs.oracle.com/iaas/Content/Network/Concepts/fastconnect.htm).
128    #[serde(rename = "type")]
129    #[serde(skip_serializing_if = "Option::is_none")]
130    pub r#type: Option<VirtualCircuitType>,
131
132    /// The layer 3 IP MTU to use on this virtual circuit.
133    #[serde(skip_serializing_if = "Option::is_none")]
134    pub ip_mtu: Option<VirtualCircuitIpMtu>,
135
136    #[serde(skip_serializing_if = "Option::is_none")]
137    pub virtual_circuit_redundancy_metadata: Option<VirtualCircuitRedundancyMetadata>,
138}
139
140impl VirtualCircuit {
141    /// Create a new VirtualCircuit
142    pub fn new() -> Self {
143        Self {
144            bandwidth_shape_name: None,
145
146            bgp_management: None,
147
148            bgp_session_state: None,
149
150            bgp_ipv6_session_state: None,
151
152            compartment_id: None,
153
154            cross_connect_mappings: None,
155
156            routing_policy: None,
157
158            bgp_admin_state: None,
159
160            is_bfd_enabled: None,
161
162            is_transport_mode: None,
163
164            customer_bgp_asn: None,
165
166            customer_asn: None,
167
168            defined_tags: None,
169
170            display_name: None,
171
172            freeform_tags: None,
173
174            gateway_id: None,
175
176            id: None,
177
178            lifecycle_state: None,
179
180            oracle_bgp_asn: None,
181
182            provider_name: None,
183
184            provider_service_id: None,
185
186            provider_service_key_name: None,
187
188            provider_service_name: None,
189
190            provider_state: None,
191
192            public_prefixes: None,
193
194            reference_comment: None,
195
196            region: None,
197
198            service_type: None,
199
200            time_created: None,
201
202            r#type: None,
203
204            ip_mtu: None,
205
206            virtual_circuit_redundancy_metadata: None,
207        }
208    }
209
210    /// Set bandwidth_shape_name
211    pub fn set_bandwidth_shape_name(mut self, value: Option<String>) -> Self {
212        self.bandwidth_shape_name = value;
213        self
214    }
215
216    /// Set bgp_management
217    pub fn set_bgp_management(mut self, value: Option<VirtualCircuitBgpManagement>) -> Self {
218        self.bgp_management = value;
219        self
220    }
221
222    /// Set bgp_session_state
223    pub fn set_bgp_session_state(mut self, value: Option<VirtualCircuitBgpSessionState>) -> Self {
224        self.bgp_session_state = value;
225        self
226    }
227
228    /// Set bgp_ipv6_session_state
229    pub fn set_bgp_ipv6_session_state(
230        mut self,
231        value: Option<VirtualCircuitBgpIpv6SessionState>,
232    ) -> Self {
233        self.bgp_ipv6_session_state = value;
234        self
235    }
236
237    /// Set compartment_id
238    pub fn set_compartment_id(mut self, value: Option<String>) -> Self {
239        self.compartment_id = value;
240        self
241    }
242
243    /// Set cross_connect_mappings
244    pub fn set_cross_connect_mappings(mut self, value: Option<Vec<CrossConnectMapping>>) -> Self {
245        self.cross_connect_mappings = value;
246        self
247    }
248
249    /// Set routing_policy
250    pub fn set_routing_policy(mut self, value: Option<Vec<VirtualCircuitRoutingPolicy>>) -> Self {
251        self.routing_policy = value;
252        self
253    }
254
255    /// Set bgp_admin_state
256    pub fn set_bgp_admin_state(mut self, value: Option<VirtualCircuitBgpAdminState>) -> Self {
257        self.bgp_admin_state = value;
258        self
259    }
260
261    /// Set is_bfd_enabled
262    pub fn set_is_bfd_enabled(mut self, value: Option<bool>) -> Self {
263        self.is_bfd_enabled = value;
264        self
265    }
266
267    /// Set is_transport_mode
268    pub fn set_is_transport_mode(mut self, value: Option<bool>) -> Self {
269        self.is_transport_mode = value;
270        self
271    }
272
273    /// Set customer_bgp_asn
274    pub fn set_customer_bgp_asn(mut self, value: Option<i64>) -> Self {
275        self.customer_bgp_asn = value;
276        self
277    }
278
279    /// Set customer_asn
280    pub fn set_customer_asn(mut self, value: Option<i64>) -> Self {
281        self.customer_asn = value;
282        self
283    }
284
285    /// Set defined_tags
286    pub fn set_defined_tags(
287        mut self,
288        value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
289    ) -> Self {
290        self.defined_tags = value;
291        self
292    }
293
294    /// Set display_name
295    pub fn set_display_name(mut self, value: Option<String>) -> Self {
296        self.display_name = value;
297        self
298    }
299
300    /// Set freeform_tags
301    pub fn set_freeform_tags(mut self, value: Option<HashMap<String, String>>) -> Self {
302        self.freeform_tags = value;
303        self
304    }
305
306    /// Set gateway_id
307    pub fn set_gateway_id(mut self, value: Option<String>) -> Self {
308        self.gateway_id = value;
309        self
310    }
311
312    /// Set id
313    pub fn set_id(mut self, value: Option<String>) -> Self {
314        self.id = value;
315        self
316    }
317
318    /// Set lifecycle_state
319    pub fn set_lifecycle_state(mut self, value: Option<VirtualCircuitLifecycleState>) -> Self {
320        self.lifecycle_state = value;
321        self
322    }
323
324    /// Set oracle_bgp_asn
325    pub fn set_oracle_bgp_asn(mut self, value: Option<i64>) -> Self {
326        self.oracle_bgp_asn = value;
327        self
328    }
329
330    /// Set provider_name
331    pub fn set_provider_name(mut self, value: Option<String>) -> Self {
332        self.provider_name = value;
333        self
334    }
335
336    /// Set provider_service_id
337    pub fn set_provider_service_id(mut self, value: Option<String>) -> Self {
338        self.provider_service_id = value;
339        self
340    }
341
342    /// Set provider_service_key_name
343    pub fn set_provider_service_key_name(mut self, value: Option<String>) -> Self {
344        self.provider_service_key_name = value;
345        self
346    }
347
348    /// Set provider_service_name
349    pub fn set_provider_service_name(mut self, value: Option<String>) -> Self {
350        self.provider_service_name = value;
351        self
352    }
353
354    /// Set provider_state
355    pub fn set_provider_state(mut self, value: Option<VirtualCircuitProviderState>) -> Self {
356        self.provider_state = value;
357        self
358    }
359
360    /// Set public_prefixes
361    pub fn set_public_prefixes(mut self, value: Option<Vec<String>>) -> Self {
362        self.public_prefixes = value;
363        self
364    }
365
366    /// Set reference_comment
367    pub fn set_reference_comment(mut self, value: Option<String>) -> Self {
368        self.reference_comment = value;
369        self
370    }
371
372    /// Set region
373    pub fn set_region(mut self, value: Option<String>) -> Self {
374        self.region = value;
375        self
376    }
377
378    /// Set service_type
379    pub fn set_service_type(mut self, value: Option<VirtualCircuitServiceType>) -> Self {
380        self.service_type = value;
381        self
382    }
383
384    /// Set time_created
385    pub fn set_time_created(mut self, value: Option<DateTime<Utc>>) -> Self {
386        self.time_created = value;
387        self
388    }
389
390    /// Set r#type
391    pub fn set_type(mut self, value: Option<VirtualCircuitType>) -> Self {
392        self.r#type = value;
393        self
394    }
395
396    /// Set ip_mtu
397    pub fn set_ip_mtu(mut self, value: Option<VirtualCircuitIpMtu>) -> Self {
398        self.ip_mtu = value;
399        self
400    }
401
402    /// Set virtual_circuit_redundancy_metadata
403    pub fn set_virtual_circuit_redundancy_metadata(
404        mut self,
405        value: Option<VirtualCircuitRedundancyMetadata>,
406    ) -> Self {
407        self.virtual_circuit_redundancy_metadata = value;
408        self
409    }
410
411    /// Set bandwidth_shape_name (unwraps Option)
412    pub fn with_bandwidth_shape_name(mut self, value: impl Into<String>) -> Self {
413        self.bandwidth_shape_name = Some(value.into());
414        self
415    }
416
417    /// Set bgp_management (unwraps Option)
418    pub fn with_bgp_management(mut self, value: VirtualCircuitBgpManagement) -> Self {
419        self.bgp_management = Some(value);
420        self
421    }
422
423    /// Set bgp_session_state (unwraps Option)
424    pub fn with_bgp_session_state(mut self, value: VirtualCircuitBgpSessionState) -> Self {
425        self.bgp_session_state = Some(value);
426        self
427    }
428
429    /// Set bgp_ipv6_session_state (unwraps Option)
430    pub fn with_bgp_ipv6_session_state(mut self, value: VirtualCircuitBgpIpv6SessionState) -> Self {
431        self.bgp_ipv6_session_state = Some(value);
432        self
433    }
434
435    /// Set compartment_id (unwraps Option)
436    pub fn with_compartment_id(mut self, value: impl Into<String>) -> Self {
437        self.compartment_id = Some(value.into());
438        self
439    }
440
441    /// Set cross_connect_mappings (unwraps Option)
442    pub fn with_cross_connect_mappings(mut self, value: Vec<CrossConnectMapping>) -> Self {
443        self.cross_connect_mappings = Some(value);
444        self
445    }
446
447    /// Set routing_policy (unwraps Option)
448    pub fn with_routing_policy(mut self, value: Vec<VirtualCircuitRoutingPolicy>) -> Self {
449        self.routing_policy = Some(value);
450        self
451    }
452
453    /// Set bgp_admin_state (unwraps Option)
454    pub fn with_bgp_admin_state(mut self, value: VirtualCircuitBgpAdminState) -> Self {
455        self.bgp_admin_state = Some(value);
456        self
457    }
458
459    /// Set is_bfd_enabled (unwraps Option)
460    pub fn with_is_bfd_enabled(mut self, value: bool) -> Self {
461        self.is_bfd_enabled = Some(value);
462        self
463    }
464
465    /// Set is_transport_mode (unwraps Option)
466    pub fn with_is_transport_mode(mut self, value: bool) -> Self {
467        self.is_transport_mode = Some(value);
468        self
469    }
470
471    /// Set customer_bgp_asn (unwraps Option)
472    pub fn with_customer_bgp_asn(mut self, value: i64) -> Self {
473        self.customer_bgp_asn = Some(value);
474        self
475    }
476
477    /// Set customer_asn (unwraps Option)
478    pub fn with_customer_asn(mut self, value: i64) -> Self {
479        self.customer_asn = Some(value);
480        self
481    }
482
483    /// Set defined_tags (unwraps Option)
484    pub fn with_defined_tags(
485        mut self,
486        value: HashMap<String, HashMap<String, serde_json::Value>>,
487    ) -> Self {
488        self.defined_tags = Some(value);
489        self
490    }
491
492    /// Set display_name (unwraps Option)
493    pub fn with_display_name(mut self, value: impl Into<String>) -> Self {
494        self.display_name = Some(value.into());
495        self
496    }
497
498    /// Set freeform_tags (unwraps Option)
499    pub fn with_freeform_tags(mut self, value: HashMap<String, String>) -> Self {
500        self.freeform_tags = Some(value);
501        self
502    }
503
504    /// Set gateway_id (unwraps Option)
505    pub fn with_gateway_id(mut self, value: impl Into<String>) -> Self {
506        self.gateway_id = Some(value.into());
507        self
508    }
509
510    /// Set id (unwraps Option)
511    pub fn with_id(mut self, value: impl Into<String>) -> Self {
512        self.id = Some(value.into());
513        self
514    }
515
516    /// Set lifecycle_state (unwraps Option)
517    pub fn with_lifecycle_state(mut self, value: VirtualCircuitLifecycleState) -> Self {
518        self.lifecycle_state = Some(value);
519        self
520    }
521
522    /// Set oracle_bgp_asn (unwraps Option)
523    pub fn with_oracle_bgp_asn(mut self, value: i64) -> Self {
524        self.oracle_bgp_asn = Some(value);
525        self
526    }
527
528    /// Set provider_name (unwraps Option)
529    pub fn with_provider_name(mut self, value: impl Into<String>) -> Self {
530        self.provider_name = Some(value.into());
531        self
532    }
533
534    /// Set provider_service_id (unwraps Option)
535    pub fn with_provider_service_id(mut self, value: impl Into<String>) -> Self {
536        self.provider_service_id = Some(value.into());
537        self
538    }
539
540    /// Set provider_service_key_name (unwraps Option)
541    pub fn with_provider_service_key_name(mut self, value: impl Into<String>) -> Self {
542        self.provider_service_key_name = Some(value.into());
543        self
544    }
545
546    /// Set provider_service_name (unwraps Option)
547    pub fn with_provider_service_name(mut self, value: impl Into<String>) -> Self {
548        self.provider_service_name = Some(value.into());
549        self
550    }
551
552    /// Set provider_state (unwraps Option)
553    pub fn with_provider_state(mut self, value: VirtualCircuitProviderState) -> Self {
554        self.provider_state = Some(value);
555        self
556    }
557
558    /// Set public_prefixes (unwraps Option)
559    pub fn with_public_prefixes(mut self, value: Vec<String>) -> Self {
560        self.public_prefixes = Some(value);
561        self
562    }
563
564    /// Set reference_comment (unwraps Option)
565    pub fn with_reference_comment(mut self, value: impl Into<String>) -> Self {
566        self.reference_comment = Some(value.into());
567        self
568    }
569
570    /// Set region (unwraps Option)
571    pub fn with_region(mut self, value: impl Into<String>) -> Self {
572        self.region = Some(value.into());
573        self
574    }
575
576    /// Set service_type (unwraps Option)
577    pub fn with_service_type(mut self, value: VirtualCircuitServiceType) -> Self {
578        self.service_type = Some(value);
579        self
580    }
581
582    /// Set time_created (unwraps Option)
583    pub fn with_time_created(mut self, value: DateTime<Utc>) -> Self {
584        self.time_created = Some(value);
585        self
586    }
587
588    /// Set r#type (unwraps Option)
589    pub fn with_type(mut self, value: VirtualCircuitType) -> Self {
590        self.r#type = Some(value);
591        self
592    }
593
594    /// Set ip_mtu (unwraps Option)
595    pub fn with_ip_mtu(mut self, value: VirtualCircuitIpMtu) -> Self {
596        self.ip_mtu = Some(value);
597        self
598    }
599
600    /// Set virtual_circuit_redundancy_metadata (unwraps Option)
601    pub fn with_virtual_circuit_redundancy_metadata(
602        mut self,
603        value: VirtualCircuitRedundancyMetadata,
604    ) -> Self {
605        self.virtual_circuit_redundancy_metadata = Some(value);
606        self
607    }
608}
609
610impl Default for VirtualCircuit {
611    fn default() -> Self {
612        Self::new()
613    }
614}