forked from microsoft/mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComputeOptionDefinitions.cs
More file actions
369 lines (309 loc) · 15.1 KB
/
ComputeOptionDefinitions.cs
File metadata and controls
369 lines (309 loc) · 15.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Azure.Mcp.Tools.Compute.Options;
public static class ComputeOptionDefinitions
{
public const string VmNameName = "vm-name";
public const string VmssNameName = "vmss-name";
public const string InstanceIdName = "instance-id";
public const string LocationName = "location";
public const string DiskName = "disk-name";
public const string SizeGbName = "size-gb";
public const string SkuName = "sku";
public const string OsTypeName = "os-type";
public const string ZoneName = "zone";
public const string HyperVGenerationName = "hyper-v-generation";
public const string DiskIopsReadWriteName = "disk-iops-read-write";
public const string DiskMbpsReadWriteName = "disk-mbps-read-write";
public const string MaxSharesName = "max-shares";
public const string NetworkAccessPolicyName = "network-access-policy";
public const string EnableBurstingName = "enable-bursting";
public const string SourceName = "source";
public const string TagsName = "tags";
public const string DiskEncryptionSetName = "disk-encryption-set";
public const string EncryptionTypeName = "encryption-type";
public const string DiskAccessIdName = "disk-access";
public const string TierName = "tier";
public const string GalleryImageReferenceName = "gallery-image-reference";
public const string GalleryImageReferenceLunName = "gallery-image-reference-lun";
public const string UploadTypeName = "upload-type";
public const string UploadSizeBytesName = "upload-size-bytes";
public const string SecurityTypeName = "security-type";
public static readonly Option<string> Source = new($"--{SourceName}")
{
Description = "Source to create the disk from, including a resource ID of a snapshot or disk, or a blob URI of a VHD. When a source is provided, --size-gb is optional and defaults to the source size.",
Required = false
};
public const string VmSizeName = "vm-size";
public const string ImageName = "image";
public const string AdminUsernameName = "admin-username";
public const string AdminPasswordName = "admin-password";
public const string SshPublicKeyName = "ssh-public-key";
public const string VirtualNetworkName = "virtual-network";
public const string SubnetName = "subnet";
public const string PublicIpAddressName = "public-ip-address";
public const string NetworkSecurityGroupName = "network-security-group";
public const string NoPublicIpName = "no-public-ip";
public const string SourceAddressPrefixName = "source-address-prefix";
public const string OsDiskSizeGbName = "os-disk-size-gb";
public const string OsDiskTypeName = "os-disk-type";
public static readonly Option<string> Disk = new($"--{DiskName}", "--name")
{
Description = "The name of the disk",
Required = false
};
public static readonly Option<int> SizeGb = new($"--{SizeGbName}", "-z")
{
Description = "Size of the disk in GB. Max size: 4095 GB.",
Required = false
};
public static readonly Option<string> Sku = new($"--{SkuName}")
{
Description = "Underlying storage SKU. Accepted values: Premium_LRS, PremiumV2_LRS, Premium_ZRS, StandardSSD_LRS, StandardSSD_ZRS, Standard_LRS, UltraSSD_LRS.",
Required = false
};
public static readonly Option<string> OsType = new($"--{OsTypeName}")
{
Description = "The Operating System type of the disk. Accepted values: Linux, Windows.",
Required = false
};
public static readonly Option<string> Zone = new($"--{ZoneName}")
{
Description = "Availability zone into which to provision the resource.",
Required = false
};
public static readonly Option<string> HyperVGeneration = new($"--{HyperVGenerationName}")
{
Description = "The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Accepted values: V1, V2.",
Required = false
};
public static readonly Option<long> DiskIopsReadWrite = new($"--{DiskIopsReadWriteName}")
{
Description = "The number of IOPS allowed for this disk. Only settable for UltraSSD disks.",
Required = false
};
public static readonly Option<long> DiskMbpsReadWrite = new($"--{DiskMbpsReadWriteName}")
{
Description = "The bandwidth allowed for this disk in MBps. Only settable for UltraSSD disks.",
Required = false
};
public static readonly Option<int> MaxShares = new($"--{MaxSharesName}")
{
Description = "The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a shared disk.",
Required = false
};
public static readonly Option<string> NetworkAccessPolicy = new($"--{NetworkAccessPolicyName}")
{
Description = "Policy for accessing the disk via network. Accepted values: AllowAll, AllowPrivate, DenyAll.",
Required = false
};
public static readonly Option<string> EnableBursting = new($"--{EnableBurstingName}")
{
Description = "Enable on-demand bursting beyond the provisioned performance target of the disk. Does not apply to Ultra disks. Accepted values: true, false.",
Required = false
};
public static readonly Option<string> Tags = new($"--{TagsName}")
{
Description = "Space-separated tags in 'key=value' format. Use '' to clear existing tags.",
Required = false
};
public static readonly Option<string> DiskEncryptionSet = new($"--{DiskEncryptionSetName}")
{
Description = "Resource ID of the disk encryption set to use for enabling encryption at rest.",
Required = false
};
public static readonly Option<string> EncryptionType = new($"--{EncryptionTypeName}")
{
Description = "Encryption type of the disk. Accepted values: EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey.",
Required = false
};
public static readonly Option<string> DiskAccessId = new($"--{DiskAccessIdName}")
{
Description = "Resource ID of the disk access resource for using private endpoints on disks.",
Required = false
};
public static readonly Option<string> Tier = new($"--{TierName}")
{
Description = "Performance tier of the disk (e.g., P10, P15, P20, P30, P40, P50, P60, P70, P80). Applicable to Premium SSD disks only.",
Required = false
};
public static readonly Option<string> UploadType = new($"--{UploadTypeName}")
{
Description = "Type of upload for the disk. Accepted values: Upload, UploadWithSecurityData. When specified, the disk is created in a ReadyToUpload state.",
Required = false
};
public static readonly Option<long> UploadSizeBytes = new($"--{UploadSizeBytesName}")
{
Description = "The size in bytes (including the VHD footer of 512 bytes) of the content to be uploaded. Required when --upload-type is specified.",
Required = false
};
public static readonly Option<string> SecurityType = new($"--{SecurityTypeName}")
{
Description = "Security type of the managed disk. Accepted values: ConfidentialVM_DiskEncryptedWithCustomerKey, ConfidentialVM_DiskEncryptedWithPlatformKey, ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey, Standard, TrustedLaunch. Required when --upload-type is UploadWithSecurityData.",
Required = false
};
public static readonly Option<string> GalleryImageReference = new($"--{GalleryImageReferenceName}")
{
Description = "Resource ID of a Shared Image Gallery image version to use as the source for the disk. Format: /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery}/images/{image}/versions/{version}.",
Required = false
};
public static readonly Option<int?> GalleryImageReferenceLun = new($"--{GalleryImageReferenceLunName}")
{
Description = "LUN (Logical Unit Number) of the data disk in the gallery image version. If specified, the disk is created from the data disk at this LUN. If not specified, the disk is created from the OS disk of the image.",
Required = false
};
public static readonly Option<string> VmName = new($"--{VmNameName}", "--name")
{
Description = "The name of the virtual machine",
Required = false
};
public static readonly Option<bool> InstanceView = new("--instance-view")
{
Description = "Include instance view details (only available when retrieving a specific VM)",
Required = false
};
public static readonly Option<string> VmssName = new($"--{VmssNameName}", "--name")
{
Description = "The name of the virtual machine scale set",
Required = false
};
public static readonly Option<string> InstanceId = new($"--{InstanceIdName}")
{
Description = "The instance ID of the virtual machine in the scale set",
Required = false
};
public static readonly Option<string> Location = new($"--{LocationName}", "-l")
{
Description = "The Azure region/location. Defaults to the resource group's location if not specified.",
Required = false
};
public static readonly Option<string> VmSize = new($"--{VmSizeName}", "--size")
{
Description = "The VM size (e.g., Standard_D2s_v3, Standard_B2s). Defaults to Standard_DS1_v2 if not specified",
Required = false
};
public static readonly Option<string> Image = new($"--{ImageName}")
{
Description = "The OS image to use. Can be URN (publisher:offer:sku:version) or alias like 'Ubuntu2404', 'Win2022Datacenter'. Defaults to Ubuntu 24.04 LTS",
Required = false
};
public static readonly Option<string> AdminUsername = new($"--{AdminUsernameName}")
{
Description = "The admin username for the VM. Required for VM creation",
Required = false
};
public static readonly Option<string> AdminPassword = new($"--{AdminPasswordName}")
{
Description = "The admin password for Windows VMs or when SSH key is not provided for Linux VMs",
Required = false
};
public static readonly Option<string> SshPublicKey = new($"--{SshPublicKeyName}")
{
Description = "SSH public key for Linux VMs. Can be the key content or path to a file",
Required = false
};
public static readonly Option<string> VirtualNetwork = new($"--{VirtualNetworkName}", "--vnet")
{
Description = "Name of an existing virtual network to use. If not specified, a new one will be created",
Required = false
};
public static readonly Option<string> Subnet = new($"--{SubnetName}")
{
Description = "Name of the subnet within the virtual network",
Required = false
};
public static readonly Option<string> PublicIpAddress = new($"--{PublicIpAddressName}")
{
Description = "Name of the public IP address to use or create",
Required = false
};
public static readonly Option<string> NetworkSecurityGroup = new($"--{NetworkSecurityGroupName}", "--nsg")
{
Description = "Name of the network security group to use or create",
Required = false
};
public static readonly Option<bool> NoPublicIp = new($"--{NoPublicIpName}")
{
Description = "Do not create or assign a public IP address",
Required = false
};
public static readonly Option<string> SourceAddressPrefix = new($"--{SourceAddressPrefixName}")
{
Description = "Source IP address range for NSG inbound rules (e.g., '203.0.113.0/24' or a specific IP). Defaults to '*' (any source)",
Required = false
};
public static readonly Option<int> OsDiskSizeGb = new($"--{OsDiskSizeGbName}")
{
Description = "OS disk size in GB. Defaults based on image requirements",
Required = false
};
public static readonly Option<string> OsDiskType = new($"--{OsDiskTypeName}")
{
Description = "OS disk type: 'Premium_LRS', 'StandardSSD_LRS', 'Standard_LRS'. Defaults based on VM size",
Required = false
};
// VMSS-specific options
public const string InstanceCountName = "instance-count";
public const string UpgradePolicyName = "upgrade-policy";
public static readonly Option<int> InstanceCount = new($"--{InstanceCountName}")
{
Description = "Number of VM instances in the scale set. Default is 2",
Required = false
};
public static readonly Option<string> UpgradePolicy = new($"--{UpgradePolicyName}")
{
Description = "Upgrade policy mode: 'Automatic', 'Manual', or 'Rolling'. Default is 'Manual'",
Required = false
};
public const string CapacityName = "capacity";
public static readonly Option<int?> Capacity = new($"--{CapacityName}")
{
Description = "Number of VM instances (capacity) in the scale set",
Required = false
};
// Additional VMSS update options
public const string OverprovisionName = "overprovision";
public const string EnableAutoOsUpgradeName = "enable-auto-os-upgrade";
public const string ScaleInPolicyName = "scale-in-policy";
public static readonly Option<bool?> Overprovision = new($"--{OverprovisionName}")
{
Description = "Enable or disable overprovisioning. When enabled, Azure provisions more VMs than requested and deletes extra VMs after deployment",
Required = false
};
public static readonly Option<bool?> EnableAutoOsUpgrade = new($"--{EnableAutoOsUpgradeName}")
{
Description = "Enable automatic OS image upgrades. Requires health probes or Application Health extension",
Required = false
};
public static readonly Option<string> ScaleInPolicy = new($"--{ScaleInPolicyName}")
{
Description = "Scale-in policy to determine which VMs to remove: 'Default', 'NewestVM', or 'OldestVM'",
Required = false
};
// Delete options
public const string ForceDeletionName = "force-deletion";
public static readonly Option<bool> ForceDeletion = new($"--{ForceDeletionName}")
{
Description = "Force delete the resource even if it is in a running or failed state (passes forceDeletion=true to the Azure API)",
Required = false
};
// VM update options
public const string LicenseTypeName = "license-type";
public const string BootDiagnosticsName = "boot-diagnostics";
public const string UserDataName = "user-data";
public static readonly Option<string> LicenseType = new($"--{LicenseTypeName}")
{
Description = "License type for Azure Hybrid Benefit: 'Windows_Server', 'Windows_Client', 'RHEL_BYOS', 'SLES_BYOS', or 'None' to disable",
Required = false
};
public static readonly Option<string> BootDiagnostics = new($"--{BootDiagnosticsName}")
{
Description = "Enable or disable boot diagnostics: 'true' or 'false'",
Required = false
};
public static readonly Option<string> UserData = new($"--{UserDataName}")
{
Description = "Base64-encoded user data for the VM. Use to update custom data scripts",
Required = false
};
}