Virtual Machines - List Applicable Schedules
列出适用的启动/停止计划(如果有)。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/listApplicableSchedules?api-version=2018-09-15
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
lab
|
path | True |
string |
实验室的名称。 |
|
name
|
path | True |
string |
LabVirtualMachine 的名称 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 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_ListApplicableSchedules
示例请求
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{vmName}/listApplicableSchedules?api-version=2018-09-15
示例响应
{
"properties": {
"labVmsShutdown": {
"name": "LabVmsShutdown",
"type": "Microsoft.DevTestLab/labs/virtualMachines/schedules",
"id": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/myAutoShutdownSchedule",
"location": "{location}",
"properties": {
"createdDate": "2020-12-29T21:48:14.1369355+00:00",
"dailyRecurrence": {
"time": "1900"
},
"hourlyRecurrence": {
"minute": 30
},
"notificationSettings": {
"emailRecipient": "{email}",
"notificationLocale": "EN",
"status": "Enabled",
"timeInMinutes": 30,
"webhookUrl": "{webhookUrl}"
},
"provisioningState": "Succeeded",
"status": "Enabled",
"targetResourceId": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{vmName}",
"taskType": "LabVmsShutdownTask",
"timeZoneId": "Pacific Standard Time",
"uniqueIdentifier": "4acf0408-1c10-49cb-96b7-28ce655c8320",
"weeklyRecurrence": {
"time": "1700",
"weekdays": [
"Friday",
"Saturday",
"Sunday"
]
}
}
},
"labVmsStartup": {
"name": "LabVmAutoStart",
"type": "Microsoft.DevTestLab/labs/virtualMachines/schedules",
"id": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/myAutoStartSchedule",
"location": "{location}",
"properties": {
"createdDate": "2020-12-29T21:46:37.0473976+00:00",
"dailyRecurrence": {
"time": "0900"
},
"hourlyRecurrence": {
"minute": 30
},
"notificationSettings": {
"emailRecipient": "{email}",
"notificationLocale": "EN",
"status": "Enabled",
"timeInMinutes": 30,
"webhookUrl": "{webhookUrl}"
},
"provisioningState": "Succeeded",
"status": "Enabled",
"targetResourceId": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{vmName}",
"taskType": "LabVmsStartupTask",
"timeZoneId": "Pacific Standard Time",
"weeklyRecurrence": {
"time": "1000",
"weekdays": [
"Friday",
"Saturday",
"Sunday"
]
}
}
}
}
}
定义
| 名称 | 说明 |
|---|---|
|
Applicable |
适用于虚拟机的计划。 计划可能已在 VM 上或实验室级别定义。 |
|
Day |
每日计划的属性。 |
|
Enable |
指示项目源是否已启用(值:Enabled,Disabled)。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Hour |
每小时计划的属性。 |
|
Notification |
计划的通知设置。 |
| Schedule |
计划。 |
|
Week |
每周计划的属性。 |
ApplicableSchedule
适用于虚拟机的计划。 计划可能已在 VM 上或实验室级别定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源的标识符。 |
| location |
string |
资源的位置。 |
| name |
string |
资源的名称。 |
| properties.labVmsShutdown |
如果已在实验室或实验室资源级别设置自动关闭计划。 |
|
| properties.labVmsStartup |
如果已在实验室或实验室资源级别设置自动启动计划。 |
|
| tags |
object |
资源的标记。 |
| type |
string |
资源的类型。 |
DayDetails
每日计划的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| time |
string |
计划将发生当天的时间。 |
EnableStatus
指示项目源是否已启用(值:Enabled,Disabled)。
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
HourDetails
每小时计划的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| minute |
integer (int32) |
计划将运行的小时分钟数。 |
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 |
资源的类型。 |
WeekDetails
每周计划的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| time |
string |
计划将发生的一天的时间。 |
| weekdays |
string[] |
计划设置的星期几(例如星期天、星期一、星期二等)。 |