创建触发器CreateTrigger
更新时间:2024-07-05
接口描述
- 本接口用于创建触发器。
请求结构
Plain Text
1POST /v1/relation HTTP/1.1
2Host: cfc.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "Target": "string",
7 "Source": "string",
8 "Data": {
9 "config1:": "string",
10 "config2:": "string"
11 }
12}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
Target | String | 是 | Body参数 | 函数BRN |
Source | SourceType | 是 | Body参数 | 触发源 |
Data | RelationConfiguration | 否 | Body参数 | 触发器参数配置 |
响应头域
除公共头域,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
Relation | Relation | Relation |
请求示例
Plain Text
1POST /v1/relation HTTP/1.1
2Host: cfc.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "Data": {
7 "AuthType": "anonymous",
8 "Method": "GET",
9 "ResourcePath": "helloFly003"
10 },
11 "Source": "cfc-http-trigger/v1/CFCAPI",
12 "Target": "brn:bce:cfc:bj:cd64f99c69d7c404b61de0a4f1865834:function:helloCFCDocs:$LATEST"
13}
响应示例
Plain Text
1HTTP/1.1 201 OK
2Content-type: application/json
3
4{
5 "Relation": {
6 "Sid": "cfc-c53bef4e-2cac-4bc6-84c1-2d5ec2f8bec2",
7 "RelationId" : "00457f0b-20d8-4f3d-8555-c2u121f38313",
8 "Source": "string",
9 "Target": "brn:bce:cfc:bj:640c8817bd1de2928d47256dd0620ce5:function:test:$LATEST",
10 "Data": {
11 "EventType":["PutObject", "PostObject"],
12 "Prefix":"images/",
13 "Suffix":".jpg",
14 "Status":"enabled"
15 }
16 }
17}