Job Executions - Create
啟動彈性作業執行。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start?api-version=2025-01-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
job
|
path | True |
string |
要擷取之作業代理程序的名稱。 |
|
job
|
path | True |
string |
要取得之作業的名稱。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
|
server
|
path | True |
string |
伺服器的名稱。 |
|
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
Azure 運作順利完成。 |
|
| 202 Accepted |
已接受資源作業。 標題
|
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow.
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| user_impersonation | 模擬您的用戶帳戶 |
範例
Start a job execution.
範例要求
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/start?api-version=2025-01-01
範例回覆
{
"name": "5555-6666-7777-8888-999999999999",
"type": "Microsoft.Sql/servers/jobAgents/executions",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999",
"properties": {
"createTime": "2016-09-23T01:00:00Z",
"currentAttempts": 0,
"jobExecutionId": "5A86BF65-43AC-F258-2524-9E92992F97CA",
"jobVersion": 1,
"lastMessage": "Job execution created.",
"lifecycle": "Created",
"provisioningState": "Created"
}
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/locations/westus/jobAgentOperationResults/5555-6666-7777-8888-999999999999?api-version=2017-03-01-preview
定義
| 名稱 | Description |
|---|---|
|
created |
建立資源的身分識別類型。 |
|
Error |
資源管理錯誤附加資訊。 |
|
Error |
錯誤詳細資料。 |
|
Error |
錯誤回應 |
|
Job |
作業的執行 |
|
Job |
作業執行的詳細狀態。 |
|
Job |
執行作業的目標。 |
|
Job |
目標的類型。 |
|
Provisioning |
作業執行的 ARM 布建狀態。 |
|
system |
與建立和上次修改資源相關的元數據。 |
createdByType
建立資源的身分識別類型。
| 值 | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorAdditionalInfo
資源管理錯誤附加資訊。
| 名稱 | 類型 | Description |
|---|---|---|
| info |
object |
附加資訊。 |
| type |
string |
其他資訊類型。 |
ErrorDetail
錯誤詳細資料。
| 名稱 | 類型 | Description |
|---|---|---|
| additionalInfo |
錯誤附加資訊。 |
|
| code |
string |
錯誤碼。 |
| details |
錯誤詳情 |
|
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
| 名稱 | 類型 | Description |
|---|---|---|
| error |
錯誤物件。 |
JobExecution
作業的執行
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string (arm-id) |
資源的完整資源標識碼。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| name |
string |
資源的名稱 |
| properties.createTime |
string (date-time) |
建立作業執行的時間。 |
| properties.currentAttemptStartTime |
string (date-time) |
目前嘗試的開始時間。 |
| properties.currentAttempts |
integer (int32) |
已嘗試作業執行的次數。 |
| properties.endTime |
string (date-time) |
作業執行完成的時間。 |
| properties.jobExecutionId |
string (uuid) |
作業執行的唯一標識碼。 |
| properties.jobVersion |
integer (int32) |
作業版本號碼。 |
| properties.lastMessage |
string |
最後一個狀態或錯誤訊息。 |
| properties.lifecycle |
作業執行的詳細狀態。 |
|
| properties.provisioningState |
作業執行的 ARM 布建狀態。 |
|
| properties.startTime |
string (date-time) |
作業執行開始的時間。 |
| properties.stepId |
integer (int32) |
作業步驟標識碼。 |
| properties.stepName |
string |
作業步驟名稱。 |
| properties.target |
執行此執行的目標。 |
|
| systemData |
Azure Resource Manager 包含 createdBy 與 modifiedBy 資訊的元資料。 |
|
| type |
string |
資源的類型。 例如:「Microsoft。運算/虛擬機器」或「Microsoft」。儲存/儲存帳號」 |
JobExecutionLifecycle
作業執行的詳細狀態。
| 值 | Description |
|---|---|
| Created |
已建立 |
| InProgress |
進行中 |
| WaitingForChildJobExecutions |
等待ChildJob執行 |
| WaitingForRetry |
等待重試 |
| Succeeded |
成功 |
| SucceededWithSkipped |
成功跳過 |
| Failed |
失敗 |
| TimedOut |
TimedOut |
| Canceled |
已取消 |
| Skipped |
Skipped |
JobExecutionTarget
執行作業的目標。
| 名稱 | 類型 | Description |
|---|---|---|
| databaseName |
string |
資料庫名稱。 |
| serverName |
string |
伺服器名稱。 |
| type |
目標的類型。 |
JobTargetType
目標的類型。
| 值 | Description |
|---|---|
| TargetGroup |
目標群組 |
| SqlDatabase |
SqlDatabase |
| SqlElasticPool |
SqlElasticPool |
| SqlShardMap |
SqlShardMap |
| SqlServer |
SqlServer |
ProvisioningState
作業執行的 ARM 布建狀態。
| 值 | Description |
|---|---|
| Created |
已建立 |
| InProgress |
進行中 |
| Succeeded |
成功 |
| Failed |
失敗 |
| Canceled |
已取消 |
systemData
與建立和上次修改資源相關的元數據。
| 名稱 | 類型 | Description |
|---|---|---|
| createdAt |
string (date-time) |
資源建立的時間戳(UTC)。 |
| createdBy |
string |
建立資源的身分識別。 |
| createdByType |
建立資源的身分識別類型。 |
|
| lastModifiedAt |
string (date-time) |
資源上次修改的時間戳記 (UTC) |
| lastModifiedBy |
string |
上次修改資源的身分識別。 |
| lastModifiedByType |
上次修改資源的身分識別類型。 |