Skip to main content

oci_rust_sdk/core/models/
instance.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use std::collections::HashMap;
4
5#[allow(unused_imports)]
6use super::*;
7/// A compute host. The image used to launch the instance determines its operating system and other software. The shape specified during the launch process determines the number of CPUs and memory allocated to the instance. <p> When you launch an instance, it is automatically attached to a virtual network interface card (VNIC), called the *primary VNIC*. The VNIC has a private IP address from the subnet's CIDR. You can either assign a private IP address of your choice or let Oracle automatically assign one. You can choose whether the instance has a public IP address. To retrieve the addresses, use the {@link #listVnicAttachments(ListVnicAttachmentsRequest) listVnicAttachments} operation to get the VNIC ID for the instance, and then call {@link #getVnic(GetVnicRequest) getVnic} with the VNIC ID. <p> For more information, see [Overview of the Compute Service](https://docs.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm). <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). <p> *Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct Instance {
11    /// The availability domain the instance is running in. <p> Example: {@code Uocm:PHX-AD-1}
12    pub availability_domain: String,
13
14    /// The OCID of the compartment that contains the instance.
15    pub compartment_id: String,
16
17    /// The OCID of the instance.
18    pub id: String,
19
20    /// The current state of the instance.
21    pub lifecycle_state: InstanceLifecycleState,
22
23    /// The region that contains the availability domain the instance is running in. <p> For the us-phoenix-1 and us-ashburn-1 regions, {@code phx} and {@code iad} are returned, respectively. For all other regions, the full region name is returned. <p> Examples: {@code phx}, {@code eu-frankfurt-1}
24    pub region: String,
25
26    /// The shape of the instance. The shape determines the number of CPUs and the amount of memory allocated to the instance. You can enumerate all available shapes by calling {@link #listShapes(ListShapesRequest) listShapes}.
27    pub shape: String,
28
29    /// The date and time the instance was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). <p> Example: {@code 2016-08-25T21:10:29.600Z}
30    pub time_created: DateTime<Utc>,
31
32    /// The OCID of the compute capacity reservation this instance is launched under. When this field contains an empty string or is null, the instance is not currently in a capacity reservation. For more information, see [Capacity Reservations](https://docs.oracle.com/iaas/Content/Compute/Tasks/reserve-capacity.htm#default).
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub capacity_reservation_id: Option<String>,
35
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub placement_constraint_details: Option<HostGroupPlacementConstraintDetails>,
38
39    /// Whether AI enterprise is enabled on the instance.
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub is_aienterprise_enabled: Option<bool>,
42
43    /// The OCID of the cluster placement group of the instance.
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub cluster_placement_group_id: Option<String>,
46
47    /// The OCID of the dedicated virtual machine host that the instance is placed on.
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub dedicated_vm_host_id: Option<String>,
50
51    /// 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\"}}}
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub defined_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
54
55    /// [Security attributes](https://docs.oracle.com/iaas/Content/zero-trust-packet-routing/zpr-artifacts.htm#security-attributes) are labels for a resource that can be referenced in a [Zero Trust Packet Routing](https://docs.oracle.com/iaas/Content/zero-trust-packet-routing/overview.htm) (ZPR) policy to control access to ZPR-supported resources. <p> Example: {@code {\"Oracle-DataSecurity-ZPR\": {\"MaxEgressCount\": {\"value\":\"42\",\"mode\":\"audit\"}}}}
56    #[serde(skip_serializing_if = "Option::is_none")]
57    pub security_attributes: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
58
59    /// The lifecycle state of the {@code securityAttributes}
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub security_attributes_state: Option<InstanceSecurityAttributesState>,
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    /// Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the {@code metadata} object. <p> They are distinguished from {@code metadata} fields in that these can be nested JSON objects (whereas {@code metadata} fields are string/string maps only).
68    #[serde(skip_serializing_if = "Option::is_none")]
69    pub extended_metadata: Option<HashMap<String, serde_json::Value>>,
70
71    /// The name of the fault domain the instance is running in. <p> A fault domain is a grouping of hardware and infrastructure within an availability domain. Each availability domain contains three fault domains. Fault domains let you distribute your instances so that they are not on the same physical hardware within a single availability domain. A hardware failure or Compute hardware maintenance that affects one fault domain does not affect instances in other fault domains. <p> If you do not specify the fault domain, the system selects one for you. <p> Example: {@code FAULT-DOMAIN-1}
72    #[serde(skip_serializing_if = "Option::is_none")]
73    pub fault_domain: Option<String>,
74
75    /// 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\"}}
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub freeform_tags: Option<HashMap<String, String>>,
78
79    /// Deprecated. Use {@code sourceDetails} instead.
80    #[serde(skip_serializing_if = "Option::is_none")]
81    pub image_id: Option<String>,
82
83    /// When a bare metal or virtual machine instance boots, the iPXE firmware that runs on the instance is configured to run an iPXE script to continue the boot process. <p> If you want more control over the boot process, you can provide your own custom iPXE script that will run when the instance boots. Be aware that the same iPXE script will run every time an instance boots, not only after the initial LaunchInstance call. <p> The default iPXE script connects to the instance's local boot volume over iSCSI and performs a network boot. If you use a custom iPXE script and want to network-boot from the instance's local boot volume over iSCSI the same way as the default iPXE script, use the following iSCSI IP address: 169.254.0.2, and boot volume IQN: iqn.2015-02.oracle.boot. <p> If your instance boot volume attachment type is paravirtualized, the boot volume is attached to the instance through virtio-scsi and no iPXE script is used. If your instance boot volume attachment type is paravirtualized and you use custom iPXE to network boot into your instance, the primary boot volume is attached as a data volume through virtio-scsi drive. <p> For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). <p> For more information about iPXE, see http://ipxe.org.
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub ipxe_script: Option<String>,
86
87    /// Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * {@code NATIVE} - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. * {@code EMULATED} - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller. * {@code PARAVIRTUALIZED} - VM instances launch with paravirtualized devices using VirtIO drivers. * {@code CUSTOM} - VM instances launch with custom configuration settings specified in the {@code LaunchOptions} parameter.
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub launch_mode: Option<InstanceLaunchMode>,
90
91    #[serde(skip_serializing_if = "Option::is_none")]
92    pub launch_options: Option<LaunchOptions>,
93
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub instance_options: Option<InstanceOptions>,
96
97    #[serde(skip_serializing_if = "Option::is_none")]
98    pub availability_config: Option<InstanceAvailabilityConfig>,
99
100    #[serde(skip_serializing_if = "Option::is_none")]
101    pub preemptible_instance_config: Option<PreemptibleInstanceConfigDetails>,
102
103    /// Custom metadata that you provide.
104    #[serde(skip_serializing_if = "Option::is_none")]
105    pub metadata: Option<HashMap<String, String>>,
106
107    #[serde(skip_serializing_if = "Option::is_none")]
108    pub shape_config: Option<InstanceShapeConfig>,
109
110    /// Whether the instance\u2019s OCPUs and memory are distributed across multiple NUMA nodes.
111    #[serde(skip_serializing_if = "Option::is_none")]
112    pub is_cross_numa_node: Option<bool>,
113
114    #[serde(skip_serializing_if = "Option::is_none")]
115    pub source_details: Option<InstanceSourceViaImageDetails>,
116
117    /// System tags for this resource. Each key is predefined and scoped to a namespace. Example: {@code {\"foo-namespace\": {\"bar-key\": \"value\"}}}
118    #[serde(skip_serializing_if = "Option::is_none")]
119    pub system_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
120
121    #[serde(skip_serializing_if = "Option::is_none")]
122    pub agent_config: Option<InstanceAgentConfig>,
123
124    /// The date and time the instance is expected to be stopped / started,  in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). After that time if instance hasn't been rebooted, Oracle will reboot the instance within 24 hours of the due time. Regardless of how the instance was stopped, the flag will be reset to empty as soon as instance reaches Stopped state. Example: {@code 2018-05-25T21:10:29.600Z}
125    #[serde(skip_serializing_if = "Option::is_none")]
126    pub time_maintenance_reboot_due: Option<DateTime<Utc>>,
127
128    #[serde(skip_serializing_if = "Option::is_none")]
129    pub platform_config: Option<AmdMilanBmPlatformConfig>,
130
131    /// The OCID of the Instance Configuration used to source launch details for this instance. Any other fields supplied in the instance launch request override the details stored in the Instance Configuration for this instance launch.
132    #[serde(skip_serializing_if = "Option::is_none")]
133    pub instance_configuration_id: Option<String>,
134
135    /// List of licensing configurations associated with the instance.
136    #[serde(skip_serializing_if = "Option::is_none")]
137    pub licensing_configs: Option<Vec<LicensingConfig>>,
138}
139
140/// Required fields for Instance
141pub struct InstanceRequired {
142    /// The availability domain the instance is running in. <p> Example: {@code Uocm:PHX-AD-1}
143    pub availability_domain: String,
144
145    /// The OCID of the compartment that contains the instance.
146    pub compartment_id: String,
147
148    /// The OCID of the instance.
149    pub id: String,
150
151    /// The current state of the instance.
152    pub lifecycle_state: InstanceLifecycleState,
153
154    /// The region that contains the availability domain the instance is running in. <p> For the us-phoenix-1 and us-ashburn-1 regions, {@code phx} and {@code iad} are returned, respectively. For all other regions, the full region name is returned. <p> Examples: {@code phx}, {@code eu-frankfurt-1}
155    pub region: String,
156
157    /// The shape of the instance. The shape determines the number of CPUs and the amount of memory allocated to the instance. You can enumerate all available shapes by calling {@link #listShapes(ListShapesRequest) listShapes}.
158    pub shape: String,
159
160    /// The date and time the instance was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). <p> Example: {@code 2016-08-25T21:10:29.600Z}
161    pub time_created: DateTime<Utc>,
162}
163
164impl Instance {
165    /// Create a new Instance with required fields
166    pub fn new(required: InstanceRequired) -> Self {
167        Self {
168            availability_domain: required.availability_domain,
169
170            compartment_id: required.compartment_id,
171
172            id: required.id,
173
174            lifecycle_state: required.lifecycle_state,
175
176            region: required.region,
177
178            shape: required.shape,
179
180            time_created: required.time_created,
181
182            capacity_reservation_id: None,
183
184            placement_constraint_details: None,
185
186            is_aienterprise_enabled: None,
187
188            cluster_placement_group_id: None,
189
190            dedicated_vm_host_id: None,
191
192            defined_tags: None,
193
194            security_attributes: None,
195
196            security_attributes_state: None,
197
198            display_name: None,
199
200            extended_metadata: None,
201
202            fault_domain: None,
203
204            freeform_tags: None,
205
206            image_id: None,
207
208            ipxe_script: None,
209
210            launch_mode: None,
211
212            launch_options: None,
213
214            instance_options: None,
215
216            availability_config: None,
217
218            preemptible_instance_config: None,
219
220            metadata: None,
221
222            shape_config: None,
223
224            is_cross_numa_node: None,
225
226            source_details: None,
227
228            system_tags: None,
229
230            agent_config: None,
231
232            time_maintenance_reboot_due: None,
233
234            platform_config: None,
235
236            instance_configuration_id: None,
237
238            licensing_configs: None,
239        }
240    }
241
242    /// Set availability_domain
243    pub fn set_availability_domain(mut self, value: String) -> Self {
244        self.availability_domain = value;
245        self
246    }
247
248    /// Set capacity_reservation_id
249    pub fn set_capacity_reservation_id(mut self, value: Option<String>) -> Self {
250        self.capacity_reservation_id = value;
251        self
252    }
253
254    /// Set compartment_id
255    pub fn set_compartment_id(mut self, value: String) -> Self {
256        self.compartment_id = value;
257        self
258    }
259
260    /// Set placement_constraint_details
261    pub fn set_placement_constraint_details(
262        mut self,
263        value: Option<HostGroupPlacementConstraintDetails>,
264    ) -> Self {
265        self.placement_constraint_details = value;
266        self
267    }
268
269    /// Set is_aienterprise_enabled
270    pub fn set_is_aienterprise_enabled(mut self, value: Option<bool>) -> Self {
271        self.is_aienterprise_enabled = value;
272        self
273    }
274
275    /// Set cluster_placement_group_id
276    pub fn set_cluster_placement_group_id(mut self, value: Option<String>) -> Self {
277        self.cluster_placement_group_id = value;
278        self
279    }
280
281    /// Set dedicated_vm_host_id
282    pub fn set_dedicated_vm_host_id(mut self, value: Option<String>) -> Self {
283        self.dedicated_vm_host_id = value;
284        self
285    }
286
287    /// Set defined_tags
288    pub fn set_defined_tags(
289        mut self,
290        value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
291    ) -> Self {
292        self.defined_tags = value;
293        self
294    }
295
296    /// Set security_attributes
297    pub fn set_security_attributes(
298        mut self,
299        value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
300    ) -> Self {
301        self.security_attributes = value;
302        self
303    }
304
305    /// Set security_attributes_state
306    pub fn set_security_attributes_state(
307        mut self,
308        value: Option<InstanceSecurityAttributesState>,
309    ) -> Self {
310        self.security_attributes_state = value;
311        self
312    }
313
314    /// Set display_name
315    pub fn set_display_name(mut self, value: Option<String>) -> Self {
316        self.display_name = value;
317        self
318    }
319
320    /// Set extended_metadata
321    pub fn set_extended_metadata(
322        mut self,
323        value: Option<HashMap<String, serde_json::Value>>,
324    ) -> Self {
325        self.extended_metadata = value;
326        self
327    }
328
329    /// Set fault_domain
330    pub fn set_fault_domain(mut self, value: Option<String>) -> Self {
331        self.fault_domain = value;
332        self
333    }
334
335    /// Set freeform_tags
336    pub fn set_freeform_tags(mut self, value: Option<HashMap<String, String>>) -> Self {
337        self.freeform_tags = value;
338        self
339    }
340
341    /// Set id
342    pub fn set_id(mut self, value: String) -> Self {
343        self.id = value;
344        self
345    }
346
347    /// Set image_id
348    pub fn set_image_id(mut self, value: Option<String>) -> Self {
349        self.image_id = value;
350        self
351    }
352
353    /// Set ipxe_script
354    pub fn set_ipxe_script(mut self, value: Option<String>) -> Self {
355        self.ipxe_script = value;
356        self
357    }
358
359    /// Set launch_mode
360    pub fn set_launch_mode(mut self, value: Option<InstanceLaunchMode>) -> Self {
361        self.launch_mode = value;
362        self
363    }
364
365    /// Set launch_options
366    pub fn set_launch_options(mut self, value: Option<LaunchOptions>) -> Self {
367        self.launch_options = value;
368        self
369    }
370
371    /// Set instance_options
372    pub fn set_instance_options(mut self, value: Option<InstanceOptions>) -> Self {
373        self.instance_options = value;
374        self
375    }
376
377    /// Set availability_config
378    pub fn set_availability_config(mut self, value: Option<InstanceAvailabilityConfig>) -> Self {
379        self.availability_config = value;
380        self
381    }
382
383    /// Set preemptible_instance_config
384    pub fn set_preemptible_instance_config(
385        mut self,
386        value: Option<PreemptibleInstanceConfigDetails>,
387    ) -> Self {
388        self.preemptible_instance_config = value;
389        self
390    }
391
392    /// Set lifecycle_state
393    pub fn set_lifecycle_state(mut self, value: InstanceLifecycleState) -> Self {
394        self.lifecycle_state = value;
395        self
396    }
397
398    /// Set metadata
399    pub fn set_metadata(mut self, value: Option<HashMap<String, String>>) -> Self {
400        self.metadata = value;
401        self
402    }
403
404    /// Set region
405    pub fn set_region(mut self, value: String) -> Self {
406        self.region = value;
407        self
408    }
409
410    /// Set shape
411    pub fn set_shape(mut self, value: String) -> Self {
412        self.shape = value;
413        self
414    }
415
416    /// Set shape_config
417    pub fn set_shape_config(mut self, value: Option<InstanceShapeConfig>) -> Self {
418        self.shape_config = value;
419        self
420    }
421
422    /// Set is_cross_numa_node
423    pub fn set_is_cross_numa_node(mut self, value: Option<bool>) -> Self {
424        self.is_cross_numa_node = value;
425        self
426    }
427
428    /// Set source_details
429    pub fn set_source_details(mut self, value: Option<InstanceSourceViaImageDetails>) -> Self {
430        self.source_details = value;
431        self
432    }
433
434    /// Set system_tags
435    pub fn set_system_tags(
436        mut self,
437        value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
438    ) -> Self {
439        self.system_tags = value;
440        self
441    }
442
443    /// Set time_created
444    pub fn set_time_created(mut self, value: DateTime<Utc>) -> Self {
445        self.time_created = value;
446        self
447    }
448
449    /// Set agent_config
450    pub fn set_agent_config(mut self, value: Option<InstanceAgentConfig>) -> Self {
451        self.agent_config = value;
452        self
453    }
454
455    /// Set time_maintenance_reboot_due
456    pub fn set_time_maintenance_reboot_due(mut self, value: Option<DateTime<Utc>>) -> Self {
457        self.time_maintenance_reboot_due = value;
458        self
459    }
460
461    /// Set platform_config
462    pub fn set_platform_config(mut self, value: Option<AmdMilanBmPlatformConfig>) -> Self {
463        self.platform_config = value;
464        self
465    }
466
467    /// Set instance_configuration_id
468    pub fn set_instance_configuration_id(mut self, value: Option<String>) -> Self {
469        self.instance_configuration_id = value;
470        self
471    }
472
473    /// Set licensing_configs
474    pub fn set_licensing_configs(mut self, value: Option<Vec<LicensingConfig>>) -> Self {
475        self.licensing_configs = value;
476        self
477    }
478
479    /// Set capacity_reservation_id (unwraps Option)
480    pub fn with_capacity_reservation_id(mut self, value: impl Into<String>) -> Self {
481        self.capacity_reservation_id = Some(value.into());
482        self
483    }
484
485    /// Set placement_constraint_details (unwraps Option)
486    pub fn with_placement_constraint_details(
487        mut self,
488        value: HostGroupPlacementConstraintDetails,
489    ) -> Self {
490        self.placement_constraint_details = Some(value);
491        self
492    }
493
494    /// Set is_aienterprise_enabled (unwraps Option)
495    pub fn with_is_aienterprise_enabled(mut self, value: bool) -> Self {
496        self.is_aienterprise_enabled = Some(value);
497        self
498    }
499
500    /// Set cluster_placement_group_id (unwraps Option)
501    pub fn with_cluster_placement_group_id(mut self, value: impl Into<String>) -> Self {
502        self.cluster_placement_group_id = Some(value.into());
503        self
504    }
505
506    /// Set dedicated_vm_host_id (unwraps Option)
507    pub fn with_dedicated_vm_host_id(mut self, value: impl Into<String>) -> Self {
508        self.dedicated_vm_host_id = Some(value.into());
509        self
510    }
511
512    /// Set defined_tags (unwraps Option)
513    pub fn with_defined_tags(
514        mut self,
515        value: HashMap<String, HashMap<String, serde_json::Value>>,
516    ) -> Self {
517        self.defined_tags = Some(value);
518        self
519    }
520
521    /// Set security_attributes (unwraps Option)
522    pub fn with_security_attributes(
523        mut self,
524        value: HashMap<String, HashMap<String, serde_json::Value>>,
525    ) -> Self {
526        self.security_attributes = Some(value);
527        self
528    }
529
530    /// Set security_attributes_state (unwraps Option)
531    pub fn with_security_attributes_state(
532        mut self,
533        value: InstanceSecurityAttributesState,
534    ) -> Self {
535        self.security_attributes_state = Some(value);
536        self
537    }
538
539    /// Set display_name (unwraps Option)
540    pub fn with_display_name(mut self, value: impl Into<String>) -> Self {
541        self.display_name = Some(value.into());
542        self
543    }
544
545    /// Set extended_metadata (unwraps Option)
546    pub fn with_extended_metadata(mut self, value: HashMap<String, serde_json::Value>) -> Self {
547        self.extended_metadata = Some(value);
548        self
549    }
550
551    /// Set fault_domain (unwraps Option)
552    pub fn with_fault_domain(mut self, value: impl Into<String>) -> Self {
553        self.fault_domain = Some(value.into());
554        self
555    }
556
557    /// Set freeform_tags (unwraps Option)
558    pub fn with_freeform_tags(mut self, value: HashMap<String, String>) -> Self {
559        self.freeform_tags = Some(value);
560        self
561    }
562
563    /// Set image_id (unwraps Option)
564    pub fn with_image_id(mut self, value: impl Into<String>) -> Self {
565        self.image_id = Some(value.into());
566        self
567    }
568
569    /// Set ipxe_script (unwraps Option)
570    pub fn with_ipxe_script(mut self, value: impl Into<String>) -> Self {
571        self.ipxe_script = Some(value.into());
572        self
573    }
574
575    /// Set launch_mode (unwraps Option)
576    pub fn with_launch_mode(mut self, value: InstanceLaunchMode) -> Self {
577        self.launch_mode = Some(value);
578        self
579    }
580
581    /// Set launch_options (unwraps Option)
582    pub fn with_launch_options(mut self, value: LaunchOptions) -> Self {
583        self.launch_options = Some(value);
584        self
585    }
586
587    /// Set instance_options (unwraps Option)
588    pub fn with_instance_options(mut self, value: InstanceOptions) -> Self {
589        self.instance_options = Some(value);
590        self
591    }
592
593    /// Set availability_config (unwraps Option)
594    pub fn with_availability_config(mut self, value: InstanceAvailabilityConfig) -> Self {
595        self.availability_config = Some(value);
596        self
597    }
598
599    /// Set preemptible_instance_config (unwraps Option)
600    pub fn with_preemptible_instance_config(
601        mut self,
602        value: PreemptibleInstanceConfigDetails,
603    ) -> Self {
604        self.preemptible_instance_config = Some(value);
605        self
606    }
607
608    /// Set metadata (unwraps Option)
609    pub fn with_metadata(mut self, value: HashMap<String, String>) -> Self {
610        self.metadata = Some(value);
611        self
612    }
613
614    /// Set shape_config (unwraps Option)
615    pub fn with_shape_config(mut self, value: InstanceShapeConfig) -> Self {
616        self.shape_config = Some(value);
617        self
618    }
619
620    /// Set is_cross_numa_node (unwraps Option)
621    pub fn with_is_cross_numa_node(mut self, value: bool) -> Self {
622        self.is_cross_numa_node = Some(value);
623        self
624    }
625
626    /// Set source_details (unwraps Option)
627    pub fn with_source_details(mut self, value: InstanceSourceViaImageDetails) -> Self {
628        self.source_details = Some(value);
629        self
630    }
631
632    /// Set system_tags (unwraps Option)
633    pub fn with_system_tags(
634        mut self,
635        value: HashMap<String, HashMap<String, serde_json::Value>>,
636    ) -> Self {
637        self.system_tags = Some(value);
638        self
639    }
640
641    /// Set agent_config (unwraps Option)
642    pub fn with_agent_config(mut self, value: InstanceAgentConfig) -> Self {
643        self.agent_config = Some(value);
644        self
645    }
646
647    /// Set time_maintenance_reboot_due (unwraps Option)
648    pub fn with_time_maintenance_reboot_due(mut self, value: DateTime<Utc>) -> Self {
649        self.time_maintenance_reboot_due = Some(value);
650        self
651    }
652
653    /// Set platform_config (unwraps Option)
654    pub fn with_platform_config(mut self, value: AmdMilanBmPlatformConfig) -> Self {
655        self.platform_config = Some(value);
656        self
657    }
658
659    /// Set instance_configuration_id (unwraps Option)
660    pub fn with_instance_configuration_id(mut self, value: impl Into<String>) -> Self {
661        self.instance_configuration_id = Some(value.into());
662        self
663    }
664
665    /// Set licensing_configs (unwraps Option)
666    pub fn with_licensing_configs(mut self, value: Vec<LicensingConfig>) -> Self {
667        self.licensing_configs = Some(value);
668        self
669    }
670}