共用方式為


Job Agents - Create Or Update

建立或更新作業代理程式。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}?api-version=2023-08-01

URI 參數

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

string

要建立或更新之作業代理程序的名稱。

resourceGroupName
path True

string

包含資源的資源群組名稱。 您可以從 Azure Resource Manager API 或入口網站取得此值。

serverName
path True

string

伺服器的名稱。

subscriptionId
path True

string

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

api-version
query True

string

要用於要求的 API 版本。

要求本文

名稱 必要 類型 Description
location True

string

資源位置。

properties.databaseId True

string (arm-id)

要儲存作業元數據的資料庫資源標識碼。

identity

JobAgentIdentity

作業代理程式的身分識別。

sku

Sku

SKU 的名稱和層。

tags

object

資源標籤。

回應

名稱 類型 Description
200 OK

JobAgent

已成功更新作業代理程式。

201 Created

JobAgent

已成功建立作業代理程式。

202 Accepted

接受

標題

Location: string

Other Status Codes

ErrorResponse

錯誤回應: ***

  • 400 ManagedInstanceStoppingOrStopped - 實例處於停止/停止狀態時提交的衝突作業

  • 400 ManagedInstanceStarting - 實例處於啟動狀態時提交的衝突作業

  • 400 InvalidResourceRequestBody - 要求主體中的資源或資源屬性是空的或無效的。

  • 400 MissingSkuName - 需要 Sku 名稱。

  • 400 InvalidDatabaseResourceId - 資料庫資源標識符無效。

  • 400 InvalidIdentityTenantId - 無法在建立或更新要求上指定 tenantId。

  • 400 MismatchingSubscriptionWithUrl - 提供的訂用帳戶不符合 Url 中的訂用帳戶。

  • 400 不符ResourceGroupNameWithUrl - 提供的資源組名不符合 Url 中的名稱。

  • 400 不相符ServerNameWithUrl - 提供的伺服器名稱不符合 Url 中的名稱。

  • 400 MissingUserAssignedIdentities - identity.userAssignedIdentities 必須在 identity.type 等於 “UserAssigned” 時提供。

  • 400 MissingIdentityType - 請指定識別類型。

  • 400 MultipleIdentitiesOnJobAgent - 請為每個作業代理程式指定一個使用者受控識別。

  • 400 InvalidIdentityType - 請只指定 “None” 或 “UserAssigned” 識別類型。

  • 400 SkuMismatchingNameCapacity - 提供的 SKU 容量與提供的 SKU 名稱不符。

  • 400 ElasticJobAgentEditionUnsupported - 作業代理程式不支援指定的 SLO。 請使用支援的 SLO 重試。

  • 400 ElasticJobAgentObjectiveAssignmentInProgress - 彈性作業代理{0}程式的 SLO 指派目前正在進行中。 請稍後重試作業。

  • 400 ElasticJobAgentEditionUnsupported - 作業代理程式不支援指定的 SLO。 請使用支援的 SLO 重試。

  • 400 DatabaseDoesNotExist - 找不到要求的資料庫

  • 400 JobAgentExceededQuota - 無法建立作業代理程序,因為它會超過配額。

  • 400 JobAgentAlreadyExists - 作業代理程式已存在於伺服器上。

  • 400 JobAgentDatabaseEditionUnsupported - 不支援指定的資料庫服務等級目標當做作業代理程序資料庫使用。

  • 400 JobAgentDatabaseSecondary - 作業代理程式無法連結至異地輔助資料庫。

  • 400 JobAgentDatabaseAlreadyLinked - 指定的資料庫已經連結到另一個作業代理程式。

  • 400 ElasticJobsNotSupportedOnAutoPauseEnabledDatabase - 不支援啟用自動暫停的無伺服器資料庫作為彈性作業資料庫,因為作業代理程式會防止該資料庫暫停。 您可以停用此無伺服器資料庫的自動暫停,或刪除使用此資料庫的作業代理程式。 如需詳細資訊,請參閱這裡:https://docs.microsoft.com/azure/azure-sql/database/serverless-tier-overview#auto-pausing

  • 400 CannotUseReservedDatabaseName - 無法在此作業中使用保留的資料庫名稱。

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

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

  • 404 SubscriptionNotFound - 找不到要求的訂用帳戶。

  • 404 PropertyChangeUnsupported - 無法修改屬性。

  • 404 OperationIdNotFound - 標識符為 的作業不存在。

  • 409 ServerDisabled - 伺服器已停用。

  • 409 ElasticJobAgentOperationUnavailable - 彈性作業代理程式 '{0}' 的作業 '{1}' 遭到封鎖,因為 {2}

  • 409 CannotCancelOperation - 管理作業處於無法取消的狀態。

  • 409 OperationCancelled - 使用者已取消作業。

  • 409 OperationInterrupted - 無法完成資源上的作業,因為相同資源上的另一個作業中斷。

  • 429 SubscriptionTooManyCreateUpdateRequests - 超出可用資源可處理之最大要求的要求。

  • 429 SubscriptionTooManyRequests - 超出可用資源可處理之最大要求的要求。

  • 500 OperationTimedOut - 作業逾時並自動回復。 請重試作業。

  • 503 TooManyRequests - 超出可用資源可處理之最大要求的要求。

範例

Create or update a job agent
Create or update a job agent with identity
Create or update a job agent with sku.

Create or update a job agent

範例要求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1?api-version=2023-08-01

{
  "location": "southeastasia",
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  }
}

範例回覆

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
  "name": "agent1",
  "type": "Microsoft.Sql/servers/jobAgents",
  "location": "southeastasia",
  "sku": {
    "name": "JA100",
    "capacity": 100
  },
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
  "name": "agent1",
  "type": "Microsoft.Sql/servers/jobAgents",
  "location": "southeastasia",
  "sku": {
    "name": "JA100",
    "capacity": 100
  },
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  }
}

Create or update a job agent with identity

範例要求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1?api-version=2023-08-01

{
  "location": "southeastasia",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {}
    }
  },
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  }
}

範例回覆

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
  "name": "agent1",
  "type": "Microsoft.Sql/servers/jobAgents",
  "location": "southeastasia",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {
        "clientId": "0c29d9b7-0ae2-4014-96ea-faf8e0cf2bc7",
        "principalId": "0c29d9b7-0ae2-4014-96ea-faf8e0cf2bc7"
      }
    }
  },
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
  "name": "agent1",
  "type": "Microsoft.Sql/servers/jobAgents",
  "location": "southeastasia",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {
        "clientId": "0c29d9b7-0ae2-4014-96ea-faf8e0cf2bc7",
        "principalId": "0c29d9b7-0ae2-4014-96ea-faf8e0cf2bc7"
      }
    }
  },
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  }
}

Create or update a job agent with sku.

範例要求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1?api-version=2023-08-01

{
  "location": "southeastasia",
  "sku": {
    "name": "JA400"
  },
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  }
}

範例回覆

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
  "name": "agent1",
  "type": "Microsoft.Sql/servers/jobAgents",
  "location": "southeastasia",
  "sku": {
    "name": "JA400",
    "capacity": 400
  },
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
  "name": "agent1",
  "type": "Microsoft.Sql/servers/jobAgents",
  "location": "southeastasia",
  "sku": {
    "name": "JA400",
    "capacity": 400
  },
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  }
}

定義

名稱 Description
ErrorAdditionalInfo

資源管理錯誤其他資訊。

ErrorDetail

錯誤詳細數據。

ErrorResponse

錯誤回應

JobAgent

Azure SQL 作業代理程式。

JobAgentIdentity

資源的 Azure Active Directory 身分識別設定。

JobAgentIdentityType

作業代理程式身分識別類型

JobAgentState

作業代理程序的狀態。

JobAgentUserAssignedIdentity

資源的 Azure Active Directory 身分識別設定。

Sku

ARM 資源 SKU。

ErrorAdditionalInfo

資源管理錯誤其他資訊。

名稱 類型 Description
info

object

其他資訊。

type

string

其他信息類型。

ErrorDetail

錯誤詳細數據。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤其他資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳細數據。

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

error 物件。

JobAgent

Azure SQL 作業代理程式。

名稱 類型 Description
id

string

資源標識碼。

identity

JobAgentIdentity

作業代理程式的身分識別。

location

string

資源位置。

name

string

資源名稱。

properties.databaseId

string (arm-id)

要儲存作業元數據的資料庫資源標識碼。

properties.state

JobAgentState

作業代理程序的狀態。

sku

Sku

SKU 的名稱和層。

tags

object

資源標籤。

type

string

資源類型。

JobAgentIdentity

資源的 Azure Active Directory 身分識別設定。

名稱 類型 Description
tenantId

string (uuid)

作業代理程式身分識別租用戶標識碼

type

JobAgentIdentityType

作業代理程式身分識別類型

userAssignedIdentities

<string,  JobAgentUserAssignedIdentity>

要使用的使用者指派身分識別的資源標識碼

JobAgentIdentityType

作業代理程式身分識別類型

Description
None
SystemAssigned
SystemAssignedUserAssigned
UserAssigned

JobAgentState

作業代理程序的狀態。

Description
Creating
Deleting
Disabled
Ready
Updating

JobAgentUserAssignedIdentity

資源的 Azure Active Directory 身分識別設定。

名稱 類型 Description
clientId

string (uuid)

Azure Active Directory 用戶端標識符。

principalId

string (uuid)

Azure Active Directory 主體標識符。

Sku

ARM 資源 SKU。

名稱 類型 Description
capacity

integer (int32)

特定 SKU 的容量。

family

string

如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。

name

string

SKU 的名稱,通常是字母 + 數位碼,例如 P3。

size

string

特定 SKU 的大小

tier

string

特定 SKU 的階層或版本,例如基本、進階。