You need to enable JavaScript to run this app.
导航

0014-00000021

最近更新时间2024.04.23 14:53:52

首次发布时间2024.01.05 16:32:25

问题描述

设置的 FilterRule 中的 value 值长度超过限制。

问题原因

创建事件通知规则时, FilterRulevalue 值长度超过限制。

问题示例
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": "string"
    }
  ]
}
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":"function_id"
                    }
                ]
            }
        }
    ]
    "Version": "1698031811529301000"
}

解决方案

修改 FilterRules 中的 Value 值大小在 255 字符以内。