共用方式為


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-preview

URI 參數

名稱 位於 必要 類型 Description
managedInstanceName
path True

string

受管理的執行個體名稱。

resourceGroupName
path True

string

包含資源的資源群組名稱。 您可以從 Azure 資源管理員 API 或入口網站取得這個值。

startStopScheduleName
path True

StartStopScheduleName

受控實例的啟動/停止排程名稱。

subscriptionId
path True

string

可識別 Azure 訂用帳戶的訂用帳戶識別碼。

api-version
query True

string

要用於要求的 API 版本。

要求本文

名稱 必要 類型 Description
properties.scheduleList True

ScheduleItem[]

排程清單。

properties.description

string

排程的描述。

properties.timeZoneId

string

排程的時區。

回應

名稱 類型 Description
200 OK

StartStopManagedInstanceSchedule

成功設定開始/停止排程。

201 Created

StartStopManagedInstanceSchedule

已成功建立開始/停止排程。

Other Status Codes

ErrorResponse

錯誤回應: ≦

  • 204 ManagementServiceStartStopManagedInstanceScheduleNameInvalid - 使用者嘗試執行與 'default' 不同的排程名稱啟動/停止排程的 CRUD 作業

  • 400 ManagementServiceStartStopManagedInstanceScheduleCreateOrUpdateRequestParametersInvalid - 要求主體中提供的一組參數是空的或無效的。

  • 400 ManagementServiceStartStopManagedInstanceScheduleCreateOrUpdateRequestTimeZoneInvalid - 提供的時區參數無效。

  • 400 ManagementServiceStartStopManagedInstanceScheduleCreateOrUpdateRequestScheduleInvalid - 提供的開始/停止排程無效。 排程不包含排程清單中的專案,或清單中的某些專案具有無效的值。

  • 400 StartStopOfManagedInstanceIsDisabled - 未啟用受控實例上的啟動和停止作業。

  • 400 ManagementServiceStartStopManagedInstanceScheduleSubscriptionNotEnabledForFeature - 使用者嘗試使用 Start/Stop 功能,而不需為適當的訂用帳戶功能列入允許清單。

  • 400 ManagementServiceStartStopManagedInstanceScheduleFeatureDisabled - 用戶嘗試使用已排程的開始/停止 Azure SQL 受控執行個體 功能,此功能已停用。

  • 400 ManagementServiceStartStopManagedInstanceScheduleNotSupportedOnSKU - 指定的 SKU 不支援排程的啟動/停止作業。

  • 400 ManagementServiceStopManagedInstanceHostedOnRdfePlatform - 停止在未使用 Feature Wave 2022 年 11 月執行的實例上執行

  • 400 ManagementServiceStartStopManagedInstanceScheduleOverlap - 排程配對重疊。

  • 400 ManagementServiceStartStopManagedInstanceScheduleSmallTimespan - 兩個連續動作之間的時間小於 1 小時。

  • 404 ManagementServiceStartStopManagedInstanceScheduleNameInvalid - 使用者嘗試以不同於 'default' 的排程名稱執行 Start/Stop 排程的 CRUD 作業

  • 404 SubscriptionDoesNotHaveServer - 找不到要求的伺服器

  • 404 ServerNotInSubscriptionResourceGroup - 指定的伺服器不存在於指定的資源群組和訂用帳戶中。

  • 404 ResourceNotFound - 找不到所要求的資源。

  • 404 ManagementServiceStartStopManagedInstanceScheduleNotFound - 指定的受控實例不存在排程。

  • 409 ManagementServiceStartStopManagedInstanceScheduleConflictingOperation - 嘗試在 Azure SQL 受控執行個體 上建立/更新/刪除開始/停止排程的作業失敗。 排程未建立或無法更新/刪除,因為排程正忙於進行中的排程作業。 請於稍後重試您的要求。

範例

Creates or updates the managed instance's Start/Stop schedule with all optional parameters specified.
Creates or updates the managed instance's Start/Stop schedule with no optional parameters specified.

Creates or updates the managed instance's Start/Stop schedule with all optional parameters specified.

Sample Request

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-preview

{
  "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"
      }
    ]
  }
}

Sample Response

{
  "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.

Sample Request

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-preview

{
  "properties": {
    "scheduleList": [
      {
        "startDay": "Thursday",
        "startTime": "18:00",
        "stopDay": "Thursday",
        "stopTime": "17:00"
      },
      {
        "startDay": "Thursday",
        "startTime": "15:00",
        "stopDay": "Thursday",
        "stopTime": "14:00"
      }
    ]
  }
}

Sample Response

{
  "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
createdByType

建立資源的身分識別類型。

DayOfWeek

開始日期。

ErrorAdditionalInfo

資源管理錯誤其他資訊。

ErrorDetail

錯誤詳細數據。

ErrorResponse

錯誤回應

ScheduleItem

排程資訊,描述伺服器何時應該啟動或停止。

StartStopManagedInstanceSchedule

受控實例的啟動/停止排程。

StartStopScheduleName

受控實例的啟動/停止排程名稱。

systemData

與建立和上次修改資源相關的元數據。

createdByType

建立資源的身分識別類型。

名稱 類型 Description
Application

string

Key

string

ManagedIdentity

string

User

string

DayOfWeek

開始日期。

名稱 類型 Description
Friday

string

Monday

string

Saturday

string

Sunday

string

Thursday

string

Tuesday

string

Wednesday

string

ErrorAdditionalInfo

資源管理錯誤其他資訊。

名稱 類型 Description
info

object

其他資訊。

type

string

其他信息類型。

ErrorDetail

錯誤詳細數據。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤其他資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳細資料。

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

錯誤物件。

ScheduleItem

排程資訊,描述伺服器何時應該啟動或停止。

名稱 類型 Description
startDay

DayOfWeek

開始日期。

startTime

string

開始時間。

stopDay

DayOfWeek

停止日期。

stopTime

string

停止時間。

StartStopManagedInstanceSchedule

受控實例的啟動/停止排程。

名稱 類型 預設值 Description
id

string

資源識別碼。

name

string

資源名稱。

properties.description

string

排程的描述。

properties.nextExecutionTime

string

下一個動作將在對應的排程時區中執行時的時間戳。

properties.nextRunAction

string

要執行 (啟動或停止) 的下一個動作

properties.scheduleList

ScheduleItem[]

排程清單。

properties.timeZoneId

string

UTC

排程的時區。

systemData

systemData

排程資源的系統數據。

type

string

資源類型。

StartStopScheduleName

受控實例的啟動/停止排程名稱。

名稱 類型 Description
default

string

systemData

與建立和上次修改資源相關的元數據。

名稱 類型 Description
createdAt

string

資源建立的時間戳 (UTC) 。

createdBy

string

建立資源的身分識別。

createdByType

createdByType

建立資源的身分識別類型。

lastModifiedAt

string

上次修改的資源時間戳 (UTC)

lastModifiedBy

string

上次修改資源的身分識別。

lastModifiedByType

createdByType

上次修改資源的身分識別類型。