你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Job Steps - Get

获取作业当前版本中的作业步骤。

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

URI 参数

名称 必需 类型 说明
jobAgentName
path True

string

作业代理的名称。

jobName
path True

string

作业的名称。

resourceGroupName
path True

string

包含资源的资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。

serverName
path True

string

服务器的名称。

stepName
path True

string

作业步骤的名称。

subscriptionId
path True

string

标识 Azure 订阅的订阅 ID。

api-version
query True

string

要用于请求的 API 版本。

响应

名称 类型 说明
200 OK

JobStep

已成功检索作业步骤。

Other Status Codes

ErrorResponse

错误响应: ***

  • 400 ManagedInstanceStoppingOrStopped - 实例处于停止/停止状态时提交的冲突作

  • 400 ManagedInstanceStarting - 实例处于启动状态时提交的冲突作

  • 404 JobAgentNotFound - 指定的作业代理在指定的逻辑服务器中不存在。

  • 404 ResourceNotFound - 找不到请求的资源。

  • 404 ServerNotInSubscriptionResourceGroup - 指定的服务器在指定的资源组和订阅中不存在。

  • 404 SubscriptionDoesNotHaveServer - 找不到请求的服务器

示例

Get the latest version of a job step.

示例请求

GET 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=2023-08-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
    }
  },
  "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"
}

定义

名称 说明
ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

JobStep

作业步骤。

JobStepAction

要由作业步骤执行的作。

JobStepActionSource

要执行的作的源。

JobStepActionType

作业步骤正在执行的作的类型。

JobStepExecutionOptions

作业步骤的执行选项。

JobStepOutput

作业步骤的输出配置。

JobStepOutputType

输出目标类型。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

JobStep

作业步骤。

名称 类型 说明
id

string

资源 ID。

name

string

资源名称。

properties.action

JobStepAction

作业步骤的作有效负载。

properties.credential

string

将用于连接到目标的作业凭据的资源 ID。

properties.executionOptions

JobStepExecutionOptions

作业步骤的执行选项。

properties.output

JobStepOutput

作业步骤的输出目标属性。

properties.stepId

integer (int32)

作业中的作业步骤的索引。 如果在创建作业步骤时未指定,则会将其创建为最后一步。 如果在更新作业步骤时未指定,则不会修改步骤 ID。

properties.targetGroup

string

将执行作业步骤的目标组的资源 ID。

type

string

资源类型。

JobStepAction

要由作业步骤执行的作。

名称 类型 默认值 说明
source

JobStepActionSource

Inline

要执行的作的源。

type

JobStepActionType

TSql

作业步骤正在执行的作的类型。

value

string

作值,例如要执行的 T-SQL 脚本的文本。

JobStepActionSource

要执行的作的源。

说明
Inline

JobStepActionType

作业步骤正在执行的作的类型。

说明
TSql

JobStepExecutionOptions

作业步骤的执行选项。

名称 类型 默认值 说明
initialRetryIntervalSeconds

integer (int32)

1

重试作业步骤执行之间的初始延迟。

maximumRetryIntervalSeconds

integer (int32)

120

重试作业步骤执行之间的最长等待时间。

retryAttempts

integer (int32)

10

如果第一次尝试失败,作业步骤将重新尝试的最大次数。

retryIntervalBackoffMultiplier

number (float)

2

重试之间的时间回退乘数。

timeoutSeconds

integer (int32)

43200

作业步骤的执行超时。

JobStepOutput

作业步骤的输出配置。

名称 类型 默认值 说明
credential

string

用于连接到输出目标的凭据的资源 ID。

databaseName

string

输出目标数据库。

resourceGroupName

string

输出目标资源组。

schemaName

string

dbo

输出目标架构。

serverName

string

输出目标服务器名称。

subscriptionId

string (uuid)

输出目标订阅 ID。

tableName

string

输出目标表。

type

JobStepOutputType

SqlDatabase

输出目标类型。

JobStepOutputType

输出目标类型。

说明
SqlDatabase