outscale_api/models/update_vm_request.rs
1/*
2 * 3DS OUTSCALE API
3 *
4 * Welcome to the OUTSCALE API documentation.<br /> The OUTSCALE API enables you to manage your resources in the OUTSCALE Cloud. This documentation describes the different actions available along with code examples.<br /><br /> Throttling: To protect against overloads, the number of identical requests allowed in a given time period is limited.<br /> Brute force: To protect against brute force attacks, the number of failed authentication attempts in a given time period is limited.<br /><br /> Note that the OUTSCALE Cloud is compatible with Amazon Web Services (AWS) APIs, but there are [differences in resource names](https://docs.outscale.com/en/userguide/About-the-APIs.html) between AWS and the OUTSCALE API.<br /> You can also manage your resources using the [Cockpit](https://docs.outscale.com/en/userguide/About-Cockpit.html) web interface.<br /><br /> An OpenAPI description of this API is also available for download: <button>[GitHub repository](https://github.com/outscale/osc-api)</button><br /> # Authentication Schemes ### Access Key/Secret Key The main way to authenticate your requests to the OUTSCALE API is to use an access key and a secret key.<br /> The mechanism behind this is based on AWS Signature Version 4, whose technical implementation details are described in [Signature of API Requests](https://docs.outscale.com/en/userguide/Signature-of-API-Requests.html).<br /><br /> In practice, the way to specify your access key and secret key depends on the tool or SDK you want to use to interact with the API.<br /> > For example, if you use OSC CLI: > 1. You need to create an **~/.osc/config.json** file to specify your access key, secret key, and the Region of your account. > 2. You then specify the `--profile` option when executing OSC CLI commands. > > For more information, see [Installing and Configuring OSC CLI](https://docs.outscale.com/en/userguide/Installing-and-Configuring-OSC-CLI.html). See the code samples in each section of this documentation for specific examples in different programming languages.<br /> For more information about access keys, see [About Access Keys](https://docs.outscale.com/en/userguide/About-Access-Keys.html). > If you try to sign requests with an invalid access key four times in a row, further authentication attempts will be prevented for 1 minute. This lockout time increases 1 minute every four failed attempts, for up to 10 minutes. ### Login/Password For certain API actions, you can also use basic authentication with the login (email address) and password of your TINA account.<br /> This is useful only in special circumstances, for example if you do not know your access key/secret key and want to retrieve them programmatically.<br /> In most cases, however, you can use the Cockpit web interface to retrieve them.<br /> > For example, if you use OSC CLI: > 1. You need to create an **~/.osc/config.json** file to specify the Region of your account, but you leave the access key value and secret key value empty (`""`). > 2. You then specify the `--profile`, `--authentication-method`, `--login`, and `--password` options when executing OSC CLI commands. See the code samples in each section of this documentation for specific examples in different programming languages. > If you try to sign requests with an invalid password four times in a row, further authentication attempts will be prevented for 1 minute. This lockout time increases 1 minute every four failed attempts, for up to 10 minutes. ### No Authentication A few API actions do not require any authentication. They are indicated as such in this documentation.<br /> ### Other Security Mechanisms In parallel with the authentication schemes, you can add other security mechanisms to your OUTSCALE account, for example to restrict API requests by IP or other criteria.<br /> For more information, see [Managing Your API Accesses](https://docs.outscale.com/en/userguide/Managing-Your-API-Accesses.html). # Pagination Tutorial You can learn more about the pagination methods for read calls in the dedicated [pagination tutorial](https://docs.outscale.com/en/userguide/Tutorial-Paginating-an-API-Request.html). # Error Codes Reference You can learn more about errors returned by the API in the dedicated [errors page](api-errors.html).
5 *
6 * The version of the OpenAPI document: 1.37.1
7 * Contact: support@outscale.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct UpdateVmRequest {
13 #[serde(rename = "ActionsOnNextBoot", skip_serializing_if = "Option::is_none")]
14 pub actions_on_next_boot: Option<Box<crate::models::ActionsOnNextBoot>>,
15 /// One or more block device mappings of the VM.
16 #[serde(
17 rename = "BlockDeviceMappings",
18 skip_serializing_if = "Option::is_none"
19 )]
20 pub block_device_mappings: Option<Vec<crate::models::BlockDeviceMappingVmUpdate>>,
21 /// This parameter is not available. It is present in our API for the sake of historical compatibility with AWS.
22 #[serde(rename = "BsuOptimized", skip_serializing_if = "Option::is_none")]
23 pub bsu_optimized: Option<bool>,
24 /// If true, you cannot delete the VM unless you change this parameter back to false.
25 #[serde(rename = "DeletionProtection", skip_serializing_if = "Option::is_none")]
26 pub deletion_protection: Option<bool>,
27 /// If true, checks whether you have the required permissions to perform the action.
28 #[serde(rename = "DryRun", skip_serializing_if = "Option::is_none")]
29 pub dry_run: Option<bool>,
30 /// (Net only) If true, the source/destination check is enabled. If false, it is disabled.
31 #[serde(
32 rename = "IsSourceDestChecked",
33 skip_serializing_if = "Option::is_none"
34 )]
35 pub is_source_dest_checked: Option<bool>,
36 /// The name of a keypair you want to associate with the VM.<br /> When you replace the keypair of a VM with another one, the metadata of the VM is modified to reflect the new public key, but the replacement is still not effective in the operating system of the VM. To complete the replacement and effectively apply the new keypair, you need to perform other actions inside the VM. For more information, see [Modifying the Keypair of a VM](https://docs.outscale.com/en/userguide/Modifying-the-Keypair-of-a-VM.html).
37 #[serde(rename = "KeypairName", skip_serializing_if = "Option::is_none")]
38 pub keypair_name: Option<String>,
39 /// (dedicated tenancy only) If true, nested virtualization is enabled. If false, it is disabled.
40 #[serde(
41 rename = "NestedVirtualization",
42 skip_serializing_if = "Option::is_none"
43 )]
44 pub nested_virtualization: Option<bool>,
45 /// The performance of the VM.
46 #[serde(rename = "Performance", skip_serializing_if = "Option::is_none")]
47 pub performance: Option<Performance>,
48 /// One or more IDs of security groups for the VM.
49 #[serde(rename = "SecurityGroupIds", skip_serializing_if = "Option::is_none")]
50 pub security_group_ids: Option<Vec<String>>,
51 /// The Base64-encoded MIME user data, limited to 500 kibibytes (KiB).
52 #[serde(rename = "UserData", skip_serializing_if = "Option::is_none")]
53 pub user_data: Option<String>,
54 /// The ID of the VM.
55 #[serde(rename = "VmId")]
56 pub vm_id: String,
57 /// The VM behavior when you stop it. If set to `stop`, the VM stops. If set to `restart`, the VM stops then automatically restarts. If set to `terminate`, the VM stops and is terminated.
58 #[serde(
59 rename = "VmInitiatedShutdownBehavior",
60 skip_serializing_if = "Option::is_none"
61 )]
62 pub vm_initiated_shutdown_behavior: Option<String>,
63 /// The type of VM. For more information, see [VM Types](https://docs.outscale.com/en/userguide/VM-Types.html).
64 #[serde(rename = "VmType", skip_serializing_if = "Option::is_none")]
65 pub vm_type: Option<String>,
66}
67
68impl UpdateVmRequest {
69 pub fn new(vm_id: String) -> UpdateVmRequest {
70 UpdateVmRequest {
71 actions_on_next_boot: None,
72 block_device_mappings: None,
73 bsu_optimized: None,
74 deletion_protection: None,
75 dry_run: None,
76 is_source_dest_checked: None,
77 keypair_name: None,
78 nested_virtualization: None,
79 performance: None,
80 security_group_ids: None,
81 user_data: None,
82 vm_id,
83 vm_initiated_shutdown_behavior: None,
84 vm_type: None,
85 }
86 }
87}
88
89/// The performance of the VM.
90#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
91pub enum Performance {
92 #[serde(rename = "medium")]
93 Medium,
94 #[serde(rename = "high")]
95 High,
96 #[serde(rename = "highest")]
97 Highest,
98}
99
100impl Default for Performance {
101 fn default() -> Performance {
102 Self::Medium
103 }
104}