Start Stop Managed Instance Schedules - Create Or Update
建立或更新受控實例的啟動/停止排程。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/default?api-version=2023-08-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
managed
|
path | True |
string |
受控實例的名稱。 |
|
resource
|
path | True |
string |
包含資源的資源群組名稱。 您可以從 Azure Resource Manager API 或入口網站取得此值。 |
|
start
|
path | True |
受控實例的啟動/停止排程名稱。 |
|
|
subscription
|
path | True |
string |
識別 Azure 訂用帳戶的訂用帳戶標識碼。 |
|
api-version
|
query | True |
string |
要用於要求的 API 版本。 |
要求本文
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| properties.scheduleList | True |
排程清單。 |
|
| properties.description |
string |
排程的描述。 |
|
| properties.timeZoneId |
string |
排程的時區。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
成功設定開始/停止排程。 |
|
| 201 Created |
已成功建立開始/停止排程。 |
|
| Other Status Codes |
錯誤回應: ***
|
範例
Creates or updates the managed instance's Start/Stop schedule with all optional parameters specified.
範例要求
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default?api-version=2023-08-01
{
"properties": {
"timeZoneId": "Central European Standard Time",
"description": "This is a schedule for our Dev/Test environment.",
"scheduleList": [
{
"startDay": "Thursday",
"startTime": "18:00",
"stopDay": "Thursday",
"stopTime": "17:00"
},
{
"startDay": "Thursday",
"startTime": "15:00",
"stopDay": "Thursday",
"stopTime": "14:00"
}
]
}
}
範例回覆
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default",
"name": "default",
"systemData": {
"createdBy": "string",
"createdByType": "User",
"createdAt": "2021-08-26T04:41:33.937Z",
"lastModifiedBy": "string",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-27T04:41:33.937Z"
},
"properties": {
"description": "This is a schedule for our Dev/Test environment.",
"nextExecutionTime": "2021-08-26T14:00:00",
"nextRunAction": "Stop",
"scheduleList": [
{
"startDay": "Thursday",
"startTime": "06:00 PM",
"stopDay": "Thursday",
"stopTime": "05:00 PM"
},
{
"startDay": "Thursday",
"startTime": "03:00 PM",
"stopDay": "Thursday",
"stopTime": "02:00 PM"
}
],
"timeZoneId": "Central European Standard Time"
},
"type": "Microsoft.Sql/managedInstances/startStopSchedules"
}
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default",
"name": "default",
"systemData": {
"createdBy": "string",
"createdByType": "User",
"createdAt": "2021-08-26T04:41:33.937Z",
"lastModifiedBy": "string",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-26T04:41:33.937Z"
},
"properties": {
"description": "This is a schedule for our Dev/Test environment.",
"nextExecutionTime": "2021-08-26T14:00:00",
"nextRunAction": "Stop",
"scheduleList": [
{
"startDay": "Thursday",
"startTime": "06:00 PM",
"stopDay": "Thursday",
"stopTime": "05:00 PM"
},
{
"startDay": "Thursday",
"startTime": "03:00 PM",
"stopDay": "Thursday",
"stopTime": "02:00 PM"
}
],
"timeZoneId": "Central European Standard Time"
},
"type": "Microsoft.Sql/managedInstances/startStopSchedules"
}
Creates or updates the managed instance's Start/Stop schedule with no optional parameters specified.
範例要求
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default?api-version=2023-08-01
{
"properties": {
"scheduleList": [
{
"startDay": "Thursday",
"startTime": "18:00",
"stopDay": "Thursday",
"stopTime": "17:00"
},
{
"startDay": "Thursday",
"startTime": "15:00",
"stopDay": "Thursday",
"stopTime": "14:00"
}
]
}
}
範例回覆
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default",
"name": "default",
"systemData": {
"createdBy": "string",
"createdByType": "User",
"createdAt": "2021-08-26T04:41:33.937Z",
"lastModifiedBy": "string",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-27T04:41:33.937Z"
},
"properties": {
"description": "",
"nextExecutionTime": "2021-08-26T14:00:00",
"nextRunAction": "Stop",
"scheduleList": [
{
"startDay": "Thursday",
"startTime": "06:00 PM",
"stopDay": "Thursday",
"stopTime": "05:00 PM"
},
{
"startDay": "Thursday",
"startTime": "03:00 PM",
"stopDay": "Thursday",
"stopTime": "02:00 PM"
}
],
"timeZoneId": "UTC"
},
"type": "Microsoft.Sql/managedInstances/startStopSchedules"
}
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default",
"name": "default",
"systemData": {
"createdBy": "string",
"createdByType": "User",
"createdAt": "2021-08-26T04:41:33.937Z",
"lastModifiedBy": "string",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-26T04:41:33.937Z"
},
"properties": {
"description": "",
"nextExecutionTime": "2021-08-26T14:00:00",
"nextRunAction": "Stop",
"scheduleList": [
{
"startDay": "Thursday",
"startTime": "06:00 PM",
"stopDay": "Thursday",
"stopTime": "05:00 PM"
},
{
"startDay": "Thursday",
"startTime": "03:00 PM",
"stopDay": "Thursday",
"stopTime": "02:00 PM"
}
],
"timeZoneId": "UTC"
},
"type": "Microsoft.Sql/managedInstances/startStopSchedules"
}
定義
| 名稱 | Description |
|---|---|
|
created |
建立資源的身分識別類型。 |
|
Day |
開始日。 |
|
Error |
資源管理錯誤其他資訊。 |
|
Error |
錯誤詳細數據。 |
|
Error |
錯誤回應 |
|
Schedule |
排程資訊,描述伺服器何時應該啟動或停止。 |
|
Start |
受控實例的啟動/停止排程。 |
|
Start |
受控實例的啟動/停止排程名稱。 |
|
system |
與建立和上次修改資源相關的元數據。 |
createdByType
建立資源的身分識別類型。
| 值 | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DayOfWeek
開始日。
| 值 | Description |
|---|---|
| Sunday | |
| Monday | |
| Tuesday | |
| Wednesday | |
| Thursday | |
| Friday | |
| Saturday |
ErrorAdditionalInfo
資源管理錯誤其他資訊。
| 名稱 | 類型 | Description |
|---|---|---|
| info |
object |
其他資訊。 |
| type |
string |
其他信息類型。 |
ErrorDetail
錯誤詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| additionalInfo |
錯誤其他資訊。 |
|
| code |
string |
錯誤碼。 |
| details |
錯誤詳細數據。 |
|
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
| 名稱 | 類型 | Description |
|---|---|---|
| error |
error 物件。 |
ScheduleItem
排程資訊,描述伺服器何時應該啟動或停止。
| 名稱 | 類型 | Description |
|---|---|---|
| startDay |
開始日。 |
|
| startTime |
string |
開始時間。 |
| stopDay |
停止一天。 |
|
| stopTime |
string |
停止時間。 |
StartStopManagedInstanceSchedule
受控實例的啟動/停止排程。
| 名稱 | 類型 | 預設值 | Description |
|---|---|---|---|
| id |
string |
資源標識碼。 |
|
| name |
string |
資源名稱。 |
|
| properties.description |
string |
排程的描述。 |
|
| properties.nextExecutionTime |
string |
下一個動作將在對應的排程時區中執行時的時間戳。 |
|
| properties.nextRunAction |
string |
要執行的下一個動作 (啟動或停止) |
|
| properties.scheduleList |
排程清單。 |
||
| properties.timeZoneId |
string |
UTC |
排程的時區。 |
| systemData |
排程資源的系統數據。 |
||
| type |
string |
資源類型。 |
StartStopScheduleName
受控實例的啟動/停止排程名稱。
| 值 | Description |
|---|---|
| default |
systemData
與建立和上次修改資源相關的元數據。
| 名稱 | 類型 | Description |
|---|---|---|
| createdAt |
string (date-time) |
資源建立的時間戳(UTC)。 |
| createdBy |
string |
建立資源的身分識別。 |
| createdByType |
建立資源的身分識別類型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的資源時間戳 (UTC) |
| lastModifiedBy |
string |
上次修改資源的身分識別。 |
| lastModifiedByType |
上次修改資源的身分識別類型。 |