You need to enable JavaScript to run this app.
导航
0014-00000007
最近更新时间:2024.04.23 14:53:50首次发布时间:2024.01.05 16:32:23

问题描述

函数服务ID 为空。

问题原因

创建函数服务类型的事件通知规则时,没有设置函数服务 ID。

问题示例
PUT /?notification HTTP/1.1
Host: bucketname.tos-cn-beijing.volces.com
Date: GMT Date
Authorization: authorization string
{
  "CloudFunctionConfigurations": [
    {
      "Events": [
        "tos:ObjectCreated:*",
        "tos:ObjectRemoved:*"
      ],
      "Filter": {
        "TOSKey": {
          "FilterRules": [
            {
              "Name": "prefix",
              "Value": "test_"
            },
            {
              "Name": "suffix",
              "Value": ".jpg"
            }
          ]
        }
      },
      "RuleId": "string",
      "CloudFunction": "" 
    }
  ]
}
PUT /?notification_v2 HTTP/1.1
Host: bucketname.tos-cn-beijing.volces.com
Date: GMT Date
Authorization: authorization string
{
    "Rules":[
        {
            "Events":[
                "tos:ObjectCreated:*",
                "tos:ObjectRemoved:*"
            ],
            "Filter":{
                "TOSKey":{
                    "FilterRules":[
                        {
                            "Name":"prefix",
                            "Value":"test_"
                        },
                        {
                            "Name":"suffix",
                            "Value":".jpg"
                        }
                    ]
                }
            },
            "RuleId":"string",
            "Destination":{
                "VeFaaS":[
                    {
                        "FunctionId":""
                    }
                ]
            }
        }
    ]
    "Version": "1698031811529301000"
}

解决方案

检查提供的函数服务 ID 是否正确,如果不存在,请创建对应函数再重试。