Triggers - Create Or Update
创建或更新触发器。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}?api-version=2018-06-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
factory
|
path | True |
string minLength: 3maxLength: 63 pattern: ^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$ |
工厂名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[-\w\._\(\)]+$ |
资源组名称。 |
|
subscription
|
path | True |
string |
订阅标识符。 |
|
trigger
|
path | True |
string minLength: 1maxLength: 260 pattern: ^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$ |
触发器名称。 |
|
api-version
|
query | True |
string |
API 版本。 |
请求头
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| If-Match |
string |
触发器实体的 ETag。 应仅指定用于更新,应将其与现有实体匹配,也可以为 * 进行无条件更新。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| properties | True | Trigger: |
触发器的属性。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
还行。 |
|
| Other Status Codes |
从 Azure 数据工厂服务收到的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
| Triggers_Create |
| Triggers_Update |
Triggers_Create
示例请求
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.DataFactory/factories/exampleFactoryName/triggers/exampleTrigger?api-version=2018-06-01
{
"properties": {
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Minute",
"interval": 4,
"startTime": "2018-06-16T00:39:13.8441801Z",
"endTime": "2018-06-16T00:55:13.8441801Z",
"timeZone": "UTC"
}
},
"pipelines": [
{
"pipelineReference": {
"referenceName": "examplePipeline",
"type": "PipelineReference"
},
"parameters": {
"OutputBlobNameList": [
"exampleoutput.csv"
]
}
}
]
}
}
示例响应
Date: Sat, 16 Jun 2018 00:40:14 GMT
X-Content-Type-Options: nosniff
x-ms-ratelimit-remaining-subscription-writes: 1186
x-ms-request-id: 373f1a49-685d-4c07-8857-0fcf1bcaffcb
x-ms-correlation-request-id: 373f1a49-685d-4c07-8857-0fcf1bcaffcb
{
"id": "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.DataFactory/factories/exampleFactoryName/triggers/exampleTrigger",
"name": "exampleTrigger",
"type": "Microsoft.DataFactory/factories/triggers",
"properties": {
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Minute",
"interval": 4,
"startTime": "2018-06-16T00:39:13.8441801Z",
"endTime": "2018-06-16T00:55:13.8441801Z",
"timeZone": "UTC"
}
},
"pipelines": [
{
"pipelineReference": {
"referenceName": "examplePipeline",
"type": "PipelineReference"
},
"parameters": {
"OutputBlobNameList": [
"exampleoutput.csv"
]
}
}
],
"runtimeState": "Stopped"
},
"etag": "0a008ad4-0000-0000-0000-5b245c6e0000"
}
Triggers_Update
示例请求
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.DataFactory/factories/exampleFactoryName/triggers/exampleTrigger?api-version=2018-06-01
{
"properties": {
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Minute",
"interval": 4,
"startTime": "2018-06-16T00:39:14.905167Z",
"endTime": "2018-06-16T00:55:14.905167Z",
"timeZone": "UTC"
}
},
"pipelines": [
{
"pipelineReference": {
"referenceName": "examplePipeline",
"type": "PipelineReference"
},
"parameters": {
"OutputBlobNameList": [
"exampleoutput.csv"
]
}
}
],
"description": "Example description"
}
}
示例响应
Date: Sat, 16 Jun 2018 00:40:15 GMT
X-Content-Type-Options: nosniff
x-ms-ratelimit-remaining-subscription-writes: 1185
x-ms-request-id: d5ccf096-0618-4b26-9829-db77e4c391c7
x-ms-correlation-request-id: d5ccf096-0618-4b26-9829-db77e4c391c7
{
"id": "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.DataFactory/factories/exampleFactoryName/triggers/exampleTrigger",
"name": "exampleTrigger",
"type": "Microsoft.DataFactory/factories/triggers",
"properties": {
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Minute",
"interval": 4,
"startTime": "2018-06-16T00:39:14.905167Z",
"endTime": "2018-06-16T00:55:14.905167Z",
"timeZone": "UTC"
}
},
"pipelines": [
{
"pipelineReference": {
"referenceName": "examplePipeline",
"type": "PipelineReference"
},
"parameters": {
"OutputBlobNameList": [
"exampleoutput.csv"
]
}
}
],
"description": "Example description",
"runtimeState": "Stopped"
},
"etag": "0a008dd4-0000-0000-0000-5b245c6f0000"
}
定义
| 名称 | 说明 |
|---|---|
|
Cloud |
定义 Azure 数据工厂错误响应结构的对象。 |
|
Multiple |
支持一对多模型用于触发器到管道的所有触发器的基类。 |
|
Pipeline |
管道引用类型。 |
|
Trigger |
需要使用给定参数触发的管道。 |
|
Trigger |
触发器资源类型。 |
|
Trigger |
枚举触发器的可能状态。 |
CloudError
定义 Azure 数据工厂错误响应结构的对象。
| 名称 | 类型 | 说明 |
|---|---|---|
| error.code |
string |
错误代码。 |
| error.details |
包含其他错误详细信息的数组。 |
|
| error.message |
string |
错误信息。 |
| error.target |
string |
与错误关联的请求中的属性名称/路径。 |
MultiplePipelineTrigger
支持一对多模型用于触发器到管道的所有触发器的基类。
| 名称 | 类型 | 说明 |
|---|---|---|
| annotations |
object[] |
可用于描述触发器的标记列表。 |
| description |
string |
触发器说明。 |
| pipelines |
需要启动的管道。 |
|
| runtimeState |
指示触发器是否正在运行。 在触发器上调用启动/停止 API 时更新。 |
|
| type | string: |
触发器类型。 |
PipelineReference
管道引用类型。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
引用名称。 |
| referenceName |
string |
引用管道名称。 |
| type | enum: |
管道引用类型。 |
TriggerPipelineReference
需要使用给定参数触发的管道。
| 名称 | 类型 | 说明 |
|---|---|---|
| parameters |
object |
管道参数。 |
| pipelineReference |
管道引用。 |
TriggerResource
触发器资源类型。
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
Etag 标识资源中的更改。 |
| id |
string |
资源标识符。 |
| name |
string |
资源名称。 |
| properties | Trigger: |
触发器的属性。 |
| type |
string |
资源类型。 |
TriggerRuntimeState
枚举触发器的可能状态。
| 值 | 说明 |
|---|---|
| Started | |
| Stopped | |
| Disabled |