Virtual Machines - List
列出给定实验室中的虚拟机。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines?api-version=2018-09-15
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines?api-version=2018-09-15&$expand={$expand}&$filter={$filter}&$top={$top}&$orderby={$orderby}
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
lab
|
path | True |
string |
实验室的名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
|
$expand
|
query |
string |
指定$expand查询。 示例:“properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)” |
|
|
$filter
|
query |
string |
要应用于作的筛选器。 示例:“$filter=contains(name,'myName') |
|
|
$orderby
|
query |
string |
结果的排序表达式,使用 OData 表示法。 示例:“$orderby=name desc” |
|
|
$top
|
query |
integer (int32) |
要从作返回的最大资源数。 示例:“$top=10” |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
Azure 操作已成功完成。 |
|
| Other Status Codes |
意外的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流程。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
VirtualMachines_List
示例请求
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines?api-version=2018-09-15
示例响应
{
"value": [
{
"name": "{vmName}",
"type": "Microsoft.DevTestLab/labs/virtualMachines",
"id": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}",
"location": "{location}",
"properties": {
"allowClaim": true,
"artifactDeploymentStatus": {
"artifactsApplied": 0,
"totalArtifacts": 0
},
"computeId": "/subscriptions/{subscriptionId}/resourceGroups/{labName}-{vmName}-{randomSuffix}/providers/Microsoft.Compute/virtualMachines/{vmName}",
"createdByUser": "",
"createdByUserId": "",
"createdDate": "2018-10-01T16:53:02.4830866-07:00",
"dataDiskParameters": [],
"disallowPublicIpAddress": true,
"galleryImageReference": {
"offer": "UbuntuServer",
"osType": "Linux",
"publisher": "Canonical",
"sku": "16.04-LTS",
"version": "Latest"
},
"labSubnetName": "{virtualNetworkName}Subnet",
"labVirtualNetworkId": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}",
"networkInterface": {},
"osType": "Linux",
"ownerObjectId": "",
"ownerUserPrincipalName": "",
"provisioningState": "Succeeded",
"size": "Standard_A2_v2",
"storageType": "Standard",
"uniqueIdentifier": "{uniqueIdentifier}",
"userName": "{userName}",
"virtualMachineCreationSource": "FromGalleryImage"
},
"tags": {
"tagName1": "tagValue1"
}
}
]
}
定义
ApplicableSchedule
适用于虚拟机的计划。 计划可能已在 VM 上或实验室级别定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源的标识符。 |
| location |
string |
资源的位置。 |
| name |
string |
资源的名称。 |
| properties.labVmsShutdown |
如果已在实验室或实验室资源级别设置自动关闭计划。 |
|
| properties.labVmsStartup |
如果已在实验室或实验室资源级别设置自动启动计划。 |
|
| tags |
object |
资源的标记。 |
| type |
string |
资源的类型。 |
ArtifactDeploymentStatusProperties
项目部署的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| artifactsApplied |
integer (int32) |
已成功应用的项目的总计数。 |
| deploymentStatus |
string |
项目的部署状态。 |
| totalArtifacts |
integer (int32) |
暂时应用的项目总数。 |
ArtifactInstallProperties
项目的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| artifactId |
string |
项目的标识符。 |
| artifactTitle |
string |
项目的标题。 |
| deploymentStatusMessage |
string |
部署中的状态消息。 |
| installTime |
string (date-time) |
项目开始在虚拟机上安装的时间。 |
| parameters |
项目的参数。 |
|
| status |
string |
项目的状态。 |
| vmExtensionStatusMessage |
string |
虚拟机扩展的状态消息。 |
ArtifactParameterProperties
项目参数的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
项目参数的名称。 |
| value |
string |
项目参数的值。 |
AttachNewDataDiskOptions
用于将新磁盘附加到虚拟机的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| diskName |
string |
要附加的磁盘的名称。 |
| diskSizeGiB |
integer (int32) |
要附加的磁盘的大小(以 Gibibytes 为单位)。 |
| diskType |
磁盘的存储类型(即标准、高级)。 |
ComputeDataDisk
附加到虚拟机的数据磁盘。
| 名称 | 类型 | 说明 |
|---|---|---|
| diskSizeGiB |
integer (int32) |
获取 GiB 中的数据磁盘大小。 |
| diskUri |
string |
由 Blob 提供支持时,基础 Blob 的 URI。 |
| managedDiskId |
string |
受托管磁盘支持时,这是计算磁盘资源的 ID。 |
| name |
string |
获取数据磁盘名称。 |
ComputeVmInstanceViewStatus
有关虚拟机的状态信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
获取状态代码。 |
| displayStatus |
string |
获取状态的简短可本地化标签。 |
| message |
string |
获取与状态关联的消息。 |
ComputeVmProperties
Microsoft.Compute API 返回的虚拟机的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| dataDiskIds |
string[] |
获取虚拟机的数据磁盘 blob URI。 |
| dataDisks |
获取附加到虚拟机的所有数据磁盘。 |
|
| networkInterfaceId |
string |
获取虚拟机的网络接口 ID。 |
| osDiskId |
string |
获取虚拟机的 OS 磁盘 Blob URI。 |
| osType |
string |
获取虚拟机的 OS 类型。 |
| statuses |
获取虚拟机的状态。 |
|
| vmSize |
string |
获取虚拟机的大小。 |
DataDiskProperties
向虚拟机添加新或现有数据磁盘的请求正文。
| 名称 | 类型 | 说明 |
|---|---|---|
| attachNewDataDiskOptions |
指定用于将新磁盘附加到虚拟机的选项。 |
|
| existingLabDiskId |
string |
指定要附加到虚拟机的现有实验室磁盘 ID。 |
| hostCaching |
数据磁盘的缓存选项(例如 None、ReadOnly、ReadWrite)。 |
DayDetails
每日计划的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| time |
string |
计划将发生当天的时间。 |
EnableStatus
指示项目源是否已启用(值:Enabled,Disabled)。
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
GalleryImageReference
Azure 市场映像的参考信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| offer |
string |
库映像的产品/服务。 |
| osType |
string |
库映像的 OS 类型。 |
| publisher |
string |
库映像的发布者。 |
| sku |
string |
库映像的 SKU。 |
| version |
string |
库映像的版本。 |
HostCachingOptions
数据磁盘的缓存选项(例如 None、ReadOnly、ReadWrite)。
| 值 | 说明 |
|---|---|
| None | |
| ReadOnly | |
| ReadWrite |
HourDetails
每小时计划的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| minute |
integer (int32) |
计划将运行的小时分钟数。 |
InboundNatRule
NAT 规则 - 使用负载均衡器在公共 IP 地址上公开 VM 的端口(backendPort)。
| 名称 | 类型 | 说明 |
|---|---|---|
| backendPort |
integer (int32) |
外部流量将重定向到的端口。 |
| frontendPort |
integer (int32) |
入站连接的外部终结点端口。 可能的值介于 1 和 65535(含)之间。 如果未指定,将自动分配值。 |
| transportProtocol |
终结点的传输协议。 |
LabVirtualMachine
虚拟机。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| id |
string |
资源的标识符。 |
|
| location |
string |
资源的位置。 |
|
| name |
string |
资源的名称。 |
|
| properties.allowClaim |
boolean |
False |
指示其他用户是否可以获取虚拟机的所有权 |
| properties.applicableSchedule |
虚拟机的适用计划。 |
||
| properties.artifactDeploymentStatus |
虚拟机的项目部署状态。 |
||
| properties.artifacts |
要安装在虚拟机上的项目。 |
||
| properties.computeId |
string |
虚拟机的资源标识符(Microsoft.Compute)。 |
|
| properties.computeVm |
计算虚拟机属性。 |
||
| properties.createdByUser |
string |
虚拟机创建者的电子邮件地址。 |
|
| properties.createdByUserId |
string |
虚拟机创建者的对象标识符。 |
|
| properties.createdDate |
string (date-time) |
虚拟机的创建日期。 |
|
| properties.customImageId |
string |
虚拟机的自定义映像标识符。 |
|
| properties.dataDiskParameters |
创建后要附加到虚拟机的新磁盘或现有数据磁盘 |
||
| properties.disallowPublicIpAddress |
boolean |
False |
指示是否在不使用公共 IP 地址的情况下创建虚拟机。 |
| properties.environmentId |
string |
包含此虚拟机的环境的资源 ID(如果有)。 |
|
| properties.expirationDate |
string (date-time) |
VM 的到期日期。 |
|
| properties.fqdn |
string |
虚拟机的完全限定域名。 |
|
| properties.galleryImageReference |
虚拟机Microsoft Azure 市场映像参考。 |
||
| properties.isAuthenticationWithSshKey |
boolean |
指示此虚拟机是否使用 SSH 密钥进行身份验证。 |
|
| properties.labSubnetName |
string |
虚拟机的实验室子网名称。 |
|
| properties.labVirtualNetworkId |
string |
虚拟机的实验室虚拟网络标识符。 |
|
| properties.lastKnownPowerState |
string |
在 DTL 中捕获的最后已知计算电源状态 |
|
| properties.networkInterface |
网络接口属性。 |
||
| properties.notes |
string |
虚拟机的说明。 |
|
| properties.osType |
string |
虚拟机的 OS 类型。 |
|
| properties.ownerObjectId |
string |
dynamicValue |
虚拟机所有者的对象标识符。 |
| properties.ownerUserPrincipalName |
string |
虚拟机所有者的用户主体名称。 |
|
| properties.password |
string |
虚拟机管理员的密码。 |
|
| properties.planId |
string |
与虚拟机映像关联的计划的 ID |
|
| properties.provisioningState |
string |
资源的预配状态。 |
|
| properties.scheduleParameters |
要创建的虚拟机计划 |
||
| properties.size |
string |
虚拟机的大小。 |
|
| properties.sshKey |
string |
虚拟机管理员的 SSH 密钥。 |
|
| properties.storageType |
string |
labStorageType |
要用于虚拟机的存储类型(即标准、高级)。 |
| properties.uniqueIdentifier |
string |
资源的唯一不可变标识符(Guid)。 |
|
| properties.userName |
string |
虚拟机的用户名。 |
|
| properties.virtualMachineCreationSource |
告知创建实验室虚拟机的来源。 仅输出属性。 |
||
| tags |
object |
资源的标记。 |
|
| type |
string |
资源的类型。 |
LabVirtualMachineList
列表作的响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| nextLink |
string (uri) |
指向下一页项的链接 |
| value |
此页面上的 LabVirtualMachine 项目 |
NetworkInterfaceProperties
网络接口的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| dnsName |
string |
DNS 名称。 |
| privateIpAddress |
string |
专用 IP 地址。 |
| publicIpAddress |
string |
公共 IP 地址。 |
| publicIpAddressId |
string |
公共 IP 地址的资源 ID。 |
| rdpAuthority |
string |
RdpAuthority 属性是服务器 DNS 主机名或 IP 地址,后跟 RDP(远程桌面协议)的服务端口号。 |
| sharedPublicIpAddressConfiguration |
用于跨多个虚拟机共享公共 IP 地址的配置。 |
|
| sshAuthority |
string |
SshAuthority 属性是服务器 DNS 主机名或 IP 地址,后跟 SSH 的服务端口号。 |
| subnetId |
string |
子网络的资源 ID。 |
| virtualNetworkId |
string |
虚拟网络的资源 ID。 |
NotificationSettings
计划的通知设置。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| emailRecipient |
string |
要向其发送通知的电子邮件收件人(可以是分号分隔电子邮件地址的列表)。 |
|
| notificationLocale |
string |
发送通知时要使用的区域设置(不受支持的语言的回退为 EN)。 |
|
| status | Disabled |
如果为此计划启用了通知(即已启用,已禁用)。 |
|
| timeInMinutes |
integer (int32) |
发送通知的事件之前的时间(以分钟为单位)。 |
|
| webhookUrl |
string |
通知将发送到的 Webhook URL。 |
Schedule
计划。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| id |
string |
资源的标识符。 |
|
| location |
string |
资源的位置。 |
|
| name |
string |
资源的名称。 |
|
| properties.createdDate |
string (date-time) |
计划的创建日期。 |
|
| properties.dailyRecurrence |
如果计划将在每周的每一天发生一次,请指定每日重复周期。 |
||
| properties.hourlyRecurrence |
如果计划每天多次发生,请指定每小时重复周期。 |
||
| properties.notificationSettings |
通知设置。 |
||
| properties.provisioningState |
string |
资源的预配状态。 |
|
| properties.status | Disabled |
计划的状态(即已启用、已禁用) |
|
| properties.targetResourceId |
string |
计划所属的资源 ID |
|
| properties.taskType |
string |
计划的任务类型(例如 LabVmsShutdownTask、LabVmAutoStart)。 |
|
| properties.timeZoneId |
string |
时区 ID(例如中国标准时间、格陵兰标准时间、太平洋标准时间等)。 此属性的可能值可在 |
|
| properties.uniqueIdentifier |
string |
资源的唯一不可变标识符(Guid)。 |
|
| properties.weeklyRecurrence |
如果计划仅在一周中的某一天发生,请指定每周重复周期。 |
||
| tags |
object |
资源的标记。 |
|
| type |
string |
资源的类型。 |
ScheduleCreationParameter
用于创建计划的属性。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| location |
string |
新虚拟机或环境的位置 |
|
| name |
string |
虚拟机或环境的名称 |
|
| properties.dailyRecurrence |
如果计划将在每周的每一天发生一次,请指定每日重复周期。 |
||
| properties.hourlyRecurrence |
如果计划每天多次发生,请指定每小时重复周期。 |
||
| properties.notificationSettings |
通知设置。 |
||
| properties.status | Disabled |
计划的状态(即已启用、已禁用) |
|
| properties.targetResourceId |
string |
计划所属的资源 ID |
|
| properties.taskType |
string |
计划的任务类型(例如 LabVmsShutdownTask、LabVmAutoStart)。 |
|
| properties.timeZoneId |
string |
时区 ID(例如中国标准时间、格陵兰标准时间、太平洋标准时间等)。 此属性的可能值可在 |
|
| properties.weeklyRecurrence |
如果计划仅在一周中的某一天发生,请指定每周重复周期。 |
||
| tags |
object |
资源的标记。 |
SharedPublicIpAddressConfiguration
确定虚拟机如何连接到负载均衡器的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| inboundNatRules |
传入 NAT 规则 |
StorageType
磁盘的存储类型(即标准、高级)。
| 值 | 说明 |
|---|---|
| Standard | |
| Premium | |
| StandardSSD |
TransportProtocol
终结点的传输协议。
| 值 | 说明 |
|---|---|
| Tcp | |
| Udp |
VirtualMachineCreationSource
告知创建实验室虚拟机的来源。 仅输出属性。
| 值 | 说明 |
|---|---|
| FromCustomImage | |
| FromGalleryImage | |
| FromSharedGalleryImage |
WeekDetails
每周计划的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| time |
string |
计划将发生的一天的时间。 |
| weekdays |
string[] |
计划设置的星期几(例如星期天、星期一、星期二等)。 |