UNPKG

azure-cli

Version:

Microsoft Azure Cross Platform Command Line tool

554 lines (548 loc) 28.2 kB
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; const models = require('./index'); /** * Describes a Virtual Machine. * * @extends models['Resource'] */ class VirtualMachine extends models['Resource'] { /** * Create a VirtualMachine. * @member {object} [plan] Specifies information about the marketplace image * used to create the virtual machine. This element is only used for * marketplace images. Before you can use a marketplace image from an API, * you must enable the image for programmatic use. In the Azure portal, find * the marketplace image that you want to use and then click **Want to deploy * programmatically, Get Started ->**. Enter any required information and * then click **Save**. * @member {string} [plan.name] The plan ID. * @member {string} [plan.publisher] The publisher ID. * @member {string} [plan.product] Specifies the product of the image from * the marketplace. This is the same value as Offer under the imageReference * element. * @member {string} [plan.promotionCode] The promotion code. * @member {object} [hardwareProfile] Specifies the hardware settings for the * virtual machine. * @member {string} [hardwareProfile.vmSize] Specifies the size of the * virtual machine. For more information about virtual machine sizes, see * [Sizes for virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * <br><br> The available VM sizes depend on region and availability set. For * a list of available sizes use these APIs: <br><br> [List all available * virtual machine sizes in an availability * set](virtualmachines-list-sizes-availability-set.md) <br><br> [List all * available virtual machine sizes in a * region](virtualmachines-list-sizes-region.md) <br><br> [List all available * virtual machine sizes for * resizing](virtualmachines-list-sizes-for-resizing.md). Possible values * include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', * 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', * 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', * 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', * 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', * 'Standard_A8m_v2', 'Standard_D1', 'Standard_D2', 'Standard_D3', * 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', * 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', * 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', * 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', * 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', * 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', * 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', * 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', * 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_F1', * 'Standard_F2', 'Standard_F4', 'Standard_F8', 'Standard_F16', * 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', * 'Standard_F16s', 'Standard_G1', 'Standard_G2', 'Standard_G3', * 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', * 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_H8', * 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', * 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', * 'Standard_L32s', 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', * 'Standard_NC24r', 'Standard_NV6', 'Standard_NV12', 'Standard_NV24' * @member {object} [storageProfile] Specifies the storage settings for the * virtual machine disks. * @member {object} [storageProfile.imageReference] Specifies information * about the image to use. You can specify information about platform images, * marketplace images, or virtual machine images. This element is required * when you want to use a platform image, marketplace image, or virtual * machine image, but is not used in other creation operations. * @member {string} [storageProfile.imageReference.publisher] The image * publisher. * @member {string} [storageProfile.imageReference.offer] Specifies the offer * of the platform image or marketplace image used to create the virtual * machine. * @member {string} [storageProfile.imageReference.sku] The image SKU. * @member {string} [storageProfile.imageReference.version] Specifies the * version of the platform image or marketplace image used to create the * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the * latest version of an image available at deploy time. Even if you use * 'latest', the VM image will not automatically update after deploy time * even if a new version becomes available. * @member {object} [storageProfile.osDisk] Specifies information about the * operating system disk used by the virtual machine. <br><br> For more * information about disks, see [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * @member {string} [storageProfile.osDisk.osType] This property allows you * to specify the type of the OS that is included in the disk if creating a * VM from user-image or a specialized VHD. <br><br> Possible values are: * <br><br> **Windows** <br><br> **Linux**. Possible values include: * 'Windows', 'Linux' * @member {object} [storageProfile.osDisk.encryptionSettings] Specifies the * encryption settings for the OS Disk. <br><br> Minimum api-version: * 2015-06-15 * @member {object} * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey] Specifies the * location of the disk encryption key, which is a Key Vault Secret. * @member {string} * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl] The * URL referencing a secret in a Key Vault. * @member {object} * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] * The relative URL of the Key Vault containing the secret. * @member {string} * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault.id] * Resource Id * @member {object} * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey] Specifies the * location of the key encryption key in Key Vault. * @member {string} * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] The URL * referencing a key encryption key in Key Vault. * @member {object} * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault] * The relative URL of the Key Vault containing the key. * @member {string} * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault.id] * Resource Id * @member {boolean} [storageProfile.osDisk.encryptionSettings.enabled] * Specifies whether disk encryption should be enabled on the virtual * machine. * @member {string} [storageProfile.osDisk.name] The disk name. * @member {object} [storageProfile.osDisk.vhd] The virtual hard disk. * @member {string} [storageProfile.osDisk.vhd.uri] Specifies the virtual * hard disk's uri. * @member {object} [storageProfile.osDisk.image] The source user image * virtual hard disk. The virtual hard disk will be copied before being * attached to the virtual machine. If SourceImage is provided, the * destination virtual hard drive must not exist. * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual * hard disk's uri. * @member {string} [storageProfile.osDisk.caching] Specifies the caching * requirements. <br><br> Possible values are: <br><br> **None** <br><br> * **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard * storage. ReadOnly for Premium storage**. Possible values include: 'None', * 'ReadOnly', 'ReadWrite' * @member {string} [storageProfile.osDisk.createOption] Specifies how the * virtual machine should be created.<br><br> Possible values are:<br><br> * **Attach** \u2013 This value is used when you are using a specialized disk * to create the virtual machine.<br><br> **FromImage** \u2013 This value is * used when you are using an image to create the virtual machine. If you are * using a platform image, you also use the imageReference element described * above. If you are using a marketplace image, you also use the plan * element previously described. Possible values include: 'fromImage', * 'empty', 'attach' * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of * an empty data disk in gigabytes. This element can be used to overwrite the * name of the disk in a virtual machine image. <br><br> This value cannot be * larger than 1023 GB * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] * Specifies the storage account type for the managed disk. Possible values * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', * 'Premium_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that * are used to add a data disk to a virtual machine. <br><br> For more * information about disks, see [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * @member {object} [osProfile] Specifies the operating system settings for * the virtual machine. * @member {string} [osProfile.computerName] Specifies the host OS name of * the virtual machine. <br><br> **Max-length (Windows):** 15 characters * <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming * conventions and restrictions see [Azure infrastructure services * implementation * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). * @member {string} [osProfile.adminUsername] Specifies the name of the * administrator account. <br><br> **Windows-only restriction:** Cannot end * in "." <br><br> **Disallowed values:** "administrator", "admin", "user", * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", * "guest", "john", "owner", "root", "server", "sql", "support", * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> * **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** * 64 characters <br><br> **Max-length (Windows):** 20 characters * <br><br><li> For root access to the Linux VM, see [Using root privileges * on Linux virtual machines in * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> * For a list of built-in system users on Linux that should not be used in * this field, see [Selecting User Names for Linux on * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * @member {string} [osProfile.adminPassword] Specifies the password of the * administrator account. <br><br> **Minimum-length (Windows):** 8 characters * <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length * (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters * <br><br> **Complexity requirements:** 3 out of 4 conditions below need to * be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a * digit <br> Has a special character (Regex match [\W_]) <br><br> * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", * "iloveyou!" <br><br> For resetting the password, see [How to reset the * Remote Desktop service or its login password in a Windows * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) * <br><br> For resetting root password, see [Manage users, SSH, and check or * repair disks on Azure Linux VMs using the VMAccess * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) * @member {string} [osProfile.customData] Specifies a base-64 encoded string * of custom data. The base-64 encoded string is decoded to a binary array * that is saved as a file on the Virtual Machine. The maximum length of the * binary array is 65535 bytes. <br><br> For using cloud-init for your VM, * see [Using cloud-init to customize a Linux VM during * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * @member {object} [osProfile.windowsConfiguration] Specifies Windows * operating system settings on the virtual machine. * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] * Indicates whether virtual machine agent should be provisioned on the * virtual machine. <br><br> When this property is not specified in the * request body, default behavior is to set it to true. This will ensure * that VM Agent is installed on the VM so that extensions can be added to * the VM later. * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] * Indicates whether virtual machine is enabled for automatic updates. * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the * time zone of the virtual machine. e.g. "Pacific Standard Time" * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] * Specifies additional base-64 encoded XML formatted information that can be * included in the Unattend.xml file, which is used by Windows Setup. * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the * Windows Remote Management listeners. This enables remote Windows * PowerShell. * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list * of Windows Remote Management listeners * @member {object} [osProfile.linuxConfiguration] Specifies the Linux * operating system settings on the virtual machine. <br><br>For a list of * supported Linux distributions, see [Linux on Azure-Endorsed * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * <br><br> For running non-endorsed distributions, see [Information for * Non-Endorsed * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * @member {boolean} * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies * whether password authentication should be disabled. * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. * @member {array} [osProfile.secrets] Specifies set of certificates that * should be installed onto the virtual machine. * @member {object} [networkProfile] Specifies the network interfaces of the * virtual machine. * @member {array} [networkProfile.networkInterfaces] Specifies the list of * resource Ids for the network interfaces associated with the virtual * machine. * @member {object} [diagnosticsProfile] Specifies the boot diagnostic * settings state. <br><br>Minimum api-version: 2015-06-15. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is * a debugging feature which allows you to view Console Output and Screenshot * to diagnose VM status. <br><br> For Linux Virtual Machines, you can easily * view the output of your console log. <br><br> For both Windows and Linux * virtual machines, Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether * boot diagnostics should be enabled on the Virtual Machine. * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of * the storage account to use for placing the console output and screenshot. * @member {object} [availabilitySet] Specifies information about the * availability set that the virtual machine should be assigned to. Virtual * machines specified in the same availability set are allocated to different * nodes to maximize availability. For more information about availability * sets, see [Manage the availability of virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * <br><br> For more information on Azure planned maintainance, see [Planned * maintenance for virtual machines in * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) * <br><br> Currently, a VM can only be added to availability set at creation * time. An existing VM cannot be added to an availability set. * @member {string} [availabilitySet.id] Resource Id * @member {string} [provisioningState] The provisioning state, which only * appears in the response. * @member {object} [instanceView] The virtual machine instance view. * @member {number} [instanceView.platformUpdateDomain] Specifies the update * domain of the virtual machine. * @member {number} [instanceView.platformFaultDomain] Specifies the fault * domain of the virtual machine. * @member {string} [instanceView.rdpThumbPrint] The Remote desktop * certificate thumbprint. * @member {object} [instanceView.vmAgent] The VM Agent running on the * virtual machine. * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full * version. * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual * machine extension handler instance view. * @member {array} [instanceView.vmAgent.statuses] The resource status * information. * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance * Operation status on the virtual machine. * @member {boolean} * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] * True, if customer is allowed to perform Maintenance. * @member {date} * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] * Start Time for the Pre Maintenance Window. * @member {date} * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowEndTime] End * Time for the Pre Maintenance Window. * @member {date} * [instanceView.maintenanceRedeployStatus.maintenanceWindowStartTime] Start * Time for the Maintenance Window. * @member {date} * [instanceView.maintenanceRedeployStatus.maintenanceWindowEndTime] End Time * for the Maintenance Window. * @member {string} * [instanceView.maintenanceRedeployStatus.lastOperationResultCode] The Last * Maintenance Operation Result Code. Possible values include: 'None', * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' * @member {string} * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message * returned for the last Maintenance Operation. * @member {array} [instanceView.disks] The virtual machine disk information. * @member {array} [instanceView.extensions] The extensions information. * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot * to diagnose VM status. <br><br> For Linux Virtual Machines, you can easily * view the output of your console log. <br><br> For both Windows and Linux * virtual machines, Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] * The console screenshot blob URI. * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] * The Linux serial console log blob Uri. * @member {array} [instanceView.statuses] The resource status information. * @member {string} [licenseType] Specifies that the image or disk that is * being used was licensed on-premises. This element is only used for images * that contain the Windows Server operating system. <br><br> Possible values * are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this * element is included in a request for an update, the value must match the * initial value. This value cannot be updated. <br><br> For more * information, see [Azure Hybrid Use Benefit for Windows * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) * <br><br> Minimum api-version: 2015-06-15 * @member {string} [vmId] Specifies the VM unique ID which is a 128-bits * identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can * be read using platform BIOS commands. * @member {array} [resources] The virtual machine child extension resources. * @member {object} [identity] The identity of the virtual machine, if * configured. * @member {string} [identity.principalId] The principal id of virtual * machine identity. * @member {string} [identity.tenantId] The tenant id associated with the * virtual machine. * @member {string} [identity.type] The type of identity used for the virtual * machine. Currently, the only supported type is 'SystemAssigned', which * implicitly creates an identity. Possible values include: 'SystemAssigned' * @member {array} [zones] The virtual machine zones. */ constructor() { super(); } /** * Defines the metadata of VirtualMachine * * @returns {object} metadata of VirtualMachine * */ mapper() { return { required: false, serializedName: 'VirtualMachine', type: { name: 'Composite', className: 'VirtualMachine', modelProperties: { id: { required: false, readOnly: true, serializedName: 'id', type: { name: 'String' } }, name: { required: false, readOnly: true, serializedName: 'name', type: { name: 'String' } }, type: { required: false, readOnly: true, serializedName: 'type', type: { name: 'String' } }, location: { required: true, serializedName: 'location', type: { name: 'String' } }, tags: { required: false, serializedName: 'tags', type: { name: 'Dictionary', value: { required: false, serializedName: 'StringElementType', type: { name: 'String' } } } }, plan: { required: false, serializedName: 'plan', type: { name: 'Composite', className: 'Plan' } }, hardwareProfile: { required: false, serializedName: 'properties.hardwareProfile', type: { name: 'Composite', className: 'HardwareProfile' } }, storageProfile: { required: false, serializedName: 'properties.storageProfile', type: { name: 'Composite', className: 'StorageProfile' } }, osProfile: { required: false, serializedName: 'properties.osProfile', type: { name: 'Composite', className: 'OSProfile' } }, networkProfile: { required: false, serializedName: 'properties.networkProfile', type: { name: 'Composite', className: 'NetworkProfile' } }, diagnosticsProfile: { required: false, serializedName: 'properties.diagnosticsProfile', type: { name: 'Composite', className: 'DiagnosticsProfile' } }, availabilitySet: { required: false, serializedName: 'properties.availabilitySet', type: { name: 'Composite', className: 'SubResource' } }, provisioningState: { required: false, readOnly: true, serializedName: 'properties.provisioningState', type: { name: 'String' } }, instanceView: { required: false, readOnly: true, serializedName: 'properties.instanceView', type: { name: 'Composite', className: 'VirtualMachineInstanceView' } }, licenseType: { required: false, serializedName: 'properties.licenseType', type: { name: 'String' } }, vmId: { required: false, readOnly: true, serializedName: 'properties.vmId', type: { name: 'String' } }, resources: { required: false, readOnly: true, serializedName: 'resources', type: { name: 'Sequence', element: { required: false, serializedName: 'VirtualMachineExtensionElementType', type: { name: 'Composite', className: 'VirtualMachineExtension' } } } }, identity: { required: false, serializedName: 'identity', type: { name: 'Composite', className: 'VirtualMachineIdentity' } }, zones: { required: false, serializedName: 'zones', type: { name: 'Sequence', element: { required: false, serializedName: 'StringElementType', type: { name: 'String' } } } } } } }; } } module.exports = VirtualMachine;