Job Steps - Create Or Update

bir iş adımı oluşturur veya güncelleştirir. Bu, örtük olarak yeni bir iş sürümü oluşturur.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}?api-version=2021-11-01

URI Parametreleri

Name İçinde Gerekli Tür Description
jobAgentName
path True

string

İş aracısının adı.

jobName
path True

string

İşin adı.

resourceGroupName
path True

string

Kaynağı içeren kaynak grubunun adı. Bu değeri Azure Resource Manager API'sinden veya portaldan alabilirsiniz.

serverName
path True

string

Sunucunun adı.

stepName
path True

string

İş adımının adı.

subscriptionId
path True

string

Azure aboneliğini tanımlayan abonelik kimliği.

api-version
query True

string

İstek için kullanılacak API sürümü.

İstek Gövdesi

Name Gerekli Tür Description
properties.action True

JobStepAction

İş adımının eylem yükü.

properties.credential True

string

Hedeflere bağlanmak için kullanılacak iş kimlik bilgilerinin kaynak kimliği.

properties.targetGroup True

string

İş adımının yürütüleceği hedef grubun kaynak kimliği.

properties.executionOptions

JobStepExecutionOptions

İş adımı için yürütme seçenekleri.

properties.output

JobStepOutput

İş adımının çıkış hedefi özellikleri.

properties.stepId

integer

İş adımının iş içindeki dizini. İş adımı oluşturulurken belirtilmezse, son adım olarak oluşturulur. İş adımı güncelleştirilirken belirtilmezse, adım kimliği değiştirilmez.

Yanıtlar

Name Tür Description
200 OK

JobStep

İş adımı başarıyla güncelleştirildi.

201 Created

JobStep

İş adımı başarıyla eklendi.

Other Status Codes

Hata Yanıtları: ***

  • 400 JobStepIdMismatch - Belirtilen İş Adımı URI'sindeki Adım Kimliği, sağlanan İş Adımı Kaynağındaki adım kimliğiyle eşleşmiyor.

  • 400 InvalidResourceRequestBody - İstek gövdesindeki kaynak veya kaynak özellikleri boş veya geçersiz.

  • 400 InvalidResourceId - Geçersiz kaynak tanımlayıcısı.

  • 400 MismatchingSubscriptionWithUrl - Sağlanan abonelik Url'deki abonelikle eşleşmedi.

  • 400 MismatchingResourceGroupNameWithUrl - Sağlanan kaynak grubu adı Url'deki adla eşleşmedi.

  • 400 MismatchingServerNameWithUrl - Sağlanan sunucu adı Url'deki adla eşleşmedi.

  • 400 MismatchingJobAccountNameWithUrl - Sağlanan iş hesabı adı Url'deki adla eşleşmedi.

  • 400 ElasticJobsOperationFailed - Elastik iş yönetimi işlemi başarısız oldu.

  • 400 ElasticJobsOperationFailed - Elastik iş yönetimi işlemi başarısız oldu.

  • 404 JobAgentNotFound - Belirtilen iş aracısı belirtilen mantıksal sunucuda yok.

  • 404 ResourceNotFound - İstenen kaynak bulunamadı.

  • 404 SubscriptionDoesNotHaveServer - İstenen sunucu bulunamadı

  • 404 ServerNotInSubscriptionResourceGroup - Belirtilen sunucu belirtilen kaynak grubunda ve abonelikte yok.

Örnekler

Create or update a job step with all properties specified.
Create or update a job step with minimal properties specified.

Create or update a job step with all properties specified.

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1?api-version=2021-11-01

{
  "properties": {
    "stepId": 1,
    "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1",
    "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1",
    "action": {
      "type": "TSql",
      "source": "Inline",
      "value": "select 2"
    },
    "output": {
      "type": "SqlDatabase",
      "subscriptionId": "3501b905-a848-4b5d-96e8-b253f62d735a",
      "resourceGroupName": "group3",
      "serverName": "server3",
      "databaseName": "database3",
      "schemaName": "myschema1234",
      "tableName": "mytable5678",
      "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"
    },
    "executionOptions": {
      "timeoutSeconds": 1234,
      "retryAttempts": 42,
      "initialRetryIntervalSeconds": 11,
      "maximumRetryIntervalSeconds": 222,
      "retryIntervalBackoffMultiplier": 3
    }
  }
}

Sample Response

{
  "properties": {
    "stepId": 1,
    "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1",
    "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1",
    "action": {
      "type": "TSql",
      "source": "Inline",
      "value": "select 2"
    },
    "output": {
      "type": "SqlDatabase",
      "subscriptionId": "3501b905-a848-4b5d-96e8-b253f62d735a",
      "resourceGroupName": "group3",
      "serverName": "server3",
      "databaseName": "database3",
      "schemaName": "myschema1234",
      "tableName": "mytable5678",
      "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"
    },
    "executionOptions": {
      "timeoutSeconds": 1234,
      "retryAttempts": 42,
      "initialRetryIntervalSeconds": 11,
      "maximumRetryIntervalSeconds": 222,
      "retryIntervalBackoffMultiplier": 3
    }
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1",
  "name": "step1",
  "type": "Microsoft.Sql/servers/jobAgents/jobs/steps"
}
{
  "properties": {
    "stepId": 1,
    "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1",
    "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1",
    "action": {
      "type": "TSql",
      "source": "Inline",
      "value": "select 2"
    },
    "output": {
      "type": "SqlDatabase",
      "subscriptionId": "3501b905-a848-4b5d-96e8-b253f62d735a",
      "resourceGroupName": "group3",
      "serverName": "server3",
      "databaseName": "database3",
      "schemaName": "myschema1234",
      "tableName": "mytable5678",
      "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"
    },
    "executionOptions": {
      "timeoutSeconds": 1234,
      "retryAttempts": 42,
      "initialRetryIntervalSeconds": 11,
      "maximumRetryIntervalSeconds": 222,
      "retryIntervalBackoffMultiplier": 3
    }
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1",
  "name": "step1",
  "type": "Microsoft.Sql/servers/jobAgents/jobs/steps"
}

Create or update a job step with minimal properties specified.

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1?api-version=2021-11-01

{
  "properties": {
    "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0",
    "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0",
    "action": {
      "value": "select 1"
    }
  }
}

Sample Response

{
  "properties": {
    "stepId": 1,
    "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0",
    "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0",
    "action": {
      "type": "TSql",
      "source": "Inline",
      "value": "select 1"
    },
    "executionOptions": {
      "timeoutSeconds": 43200,
      "retryAttempts": 10,
      "initialRetryIntervalSeconds": 1,
      "maximumRetryIntervalSeconds": 120,
      "retryIntervalBackoffMultiplier": 2
    }
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1",
  "name": "step1",
  "type": "Microsoft.Sql/servers/jobAgents/jobs/steps"
}
{
  "properties": {
    "stepId": 1,
    "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0",
    "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0",
    "action": {
      "type": "TSql",
      "source": "Inline",
      "value": "select 1"
    },
    "executionOptions": {
      "timeoutSeconds": 43200,
      "retryAttempts": 10,
      "initialRetryIntervalSeconds": 1,
      "maximumRetryIntervalSeconds": 120,
      "retryIntervalBackoffMultiplier": 2
    }
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1",
  "name": "step1",
  "type": "Microsoft.Sql/servers/jobAgents/jobs/steps"
}

Tanımlar

Name Description
JobStep

bir iş adımı.

JobStepAction

bir iş adımı tarafından yürütülecek eylem.

JobStepActionSource

Yürütülecek eylemin kaynağı.

JobStepActionType

İş adımı tarafından yürütülen eylem türü.

JobStepExecutionOptions

bir iş adımının yürütme seçenekleri.

JobStepOutput

bir iş adımının çıkış yapılandırması.

JobStepOutputType

Çıkış hedef türü.

JobStep

bir iş adımı.

Name Tür Description
id

string

Kaynak Kimliği.

name

string

Kaynak adı.

properties.action

JobStepAction

İş adımının eylem yükü.

properties.credential

string

Hedeflere bağlanmak için kullanılacak iş kimlik bilgilerinin kaynak kimliği.

properties.executionOptions

JobStepExecutionOptions

İş adımı için yürütme seçenekleri.

properties.output

JobStepOutput

İş adımının çıkış hedefi özellikleri.

properties.stepId

integer

İş adımının iş içindeki dizini. İş adımı oluşturulurken belirtilmezse, son adım olarak oluşturulur. İş adımı güncelleştirilirken belirtilmezse, adım kimliği değiştirilmez.

properties.targetGroup

string

İş adımının yürütüleceği hedef grubun kaynak kimliği.

type

string

Kaynak türü.

JobStepAction

bir iş adımı tarafından yürütülecek eylem.

Name Tür Varsayılan değer Description
source

JobStepActionSource

Inline

Yürütülecek eylemin kaynağı.

type

JobStepActionType

TSql

İş adımı tarafından yürütülen eylem türü.

value

string

Yürütülecek T-SQL betiğinin metni gibi eylem değeri.

JobStepActionSource

Yürütülecek eylemin kaynağı.

Name Tür Description
Inline

string

JobStepActionType

İş adımı tarafından yürütülen eylem türü.

Name Tür Description
TSql

string

JobStepExecutionOptions

bir iş adımının yürütme seçenekleri.

Name Tür Varsayılan değer Description
initialRetryIntervalSeconds

integer

1

İş adımı yürütme için yeniden denemeler arasındaki ilk gecikme.

maximumRetryIntervalSeconds

integer

120

İş adımı yürütme için yeniden denemeler arasında bekleme süresi üst sınırı.

retryAttempts

integer

10

İlk deneme başarısız olursa iş adımının en fazla kaç kez yeniden atılacağı.

retryIntervalBackoffMultiplier

number

2

Yeniden denemeler arasındaki süre için geri alma çarpanı.

timeoutSeconds

integer

43200

İş adımı için yürütme zaman aşımı.

JobStepOutput

bir iş adımının çıkış yapılandırması.

Name Tür Varsayılan değer Description
credential

string

Çıkış hedefine bağlanmak için kullanılacak kimlik bilgilerinin kaynak kimliği.

databaseName

string

Çıkış hedef veritabanı.

resourceGroupName

string

Çıkış hedef kaynak grubu.

schemaName

string

dbo

Çıkış hedef şeması.

serverName

string

Çıkış hedef sunucu adı.

subscriptionId

string

Çıkış hedefi abonelik kimliği.

tableName

string

Çıkış hedef tablosu.

type

JobStepOutputType

SqlDatabase

Çıkış hedef türü.

JobStepOutputType

Çıkış hedef türü.

Name Tür Description
SqlDatabase

string