百度智能云

All Product Document

          Object Storage

          Get Bucket Notification Rules

          Interface Description

          This interface is used to get the notification rules in the specified bucket.

          Request URI

          GET /v1/{bucketName}/?notification

          Parameter Name Parameter Type Required Description Example Value Parameter Position
          bucketName String Yes Bucket name "bucketName_example" Path

          Request Body Parameters

          Description of Data Structure for Request Body Field

          Response Body Parameters

          Description of Data Structure for Response Body Field

          Parameter Name Parameter Type Description Example Value
          notifications List

          Data Structure Description of Notifications Field

          Parameter Name Parameter Type Description Example Value
          id String Rule ID notify-id-1
          name String Rule name rule-name
          appId String Product ID for registering this rule app-id-1
          status String Optional value: {"disabled", "enabled"} enabled
          resources List Subscribed resources
          events List Subscribed event
          apps List Product that subscribes to the message.

          Data Structure Description of Apps Field

          Parameter Name Parameter Type Description Example Value
          id String app-id-3
          eventUrl String app:ImageOcr
          xVars String {"saveUrl": "http://xxx.com/ocr"}

          Request Example

          GET /v1/bucketName_example/?notification
          Common Request Header
          
          
          { }

          Response Example

          HTTP/1.1 200 OK
          <Common response header>
          
          {
            "notifications" : [ {
              "appId" : "app-id-1",
              "name" : "rule-name",
              "resources" : [ "bucket-a/path1", "bucket-a/path1" ],
              "id" : "notify-id-1",
              "events" : [ "PutObject", "PutObject" ],
              "status" : "enabled",
              "apps" : [ {
                "eventUrl" : "app:ImageOcr",
                "xVars" : "{\"saveUrl\": \"http://xxx.com/ocr\"}",
                "id" : "app-id-3"
              }, {
                "eventUrl" : "app:ImageOcr",
                "xVars" : "{\"saveUrl\": \"http://xxx.com/ocr\"}",
                "id" : "app-id-3"
              } ]
            }, {
              "appId" : "app-id-1",
              "name" : "rule-name",
              "resources" : [ "bucket-a/path1", "bucket-a/path1" ],
              "id" : "notify-id-1",
              "events" : [ "PutObject", "PutObject" ],
              "status" : "enabled",
              "apps" : [ {
                "eventUrl" : "app:ImageOcr",
                "xVars" : "{\"saveUrl\": \"http://xxx.com/ocr\"}",
                "id" : "app-id-3"
              }, {
                "eventUrl" : "app:ImageOcr",
                "xVars" : "{\"saveUrl\": \"http://xxx.com/ocr\"}",
                "id" : "app-id-3"
              } ]
            } ]
          }

          Error Code

          Refer to the universal error code.

          Previous
          Delete Bucket Notification Rule
          Next
          Push Event Messages