Baidu AI Cloud
中国站

百度智能云

Object Storage

GetNotification

Interface Description

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

Request

  • Request syntax

    http
    GET /?notification HTTP/1.1
    Host: <BucketName>.bj.bcebos.com
    Date: <Date>
    Authorization: <AuthorizationString>
  • Request header field

    None

  • Request parameters

    None

Response

  • Response header field

    None

  • Response element

Field Type Required? Description
id String Required Rule ID
name String Optional Rule name
appId String Required Product ID for registering this rule
status String Required Optional value: {"disabled", "enabled"}
encryption Object Optional Encryption method
+key String Optional Encryption key. If it is not empty, the IAM algorithm is used to sign the request for notification, and the key corresponds to SecretAccessKey in the IAM signature.
resources[] Array Required Subscribed resources
+resource String Required Subscribed resources ${bucket_name}/path1/*.jpg or /path1/*.jpg, which can only contain one *
events[] Array Required Subscribed event
+eventType String Required Event type supported currently:
- PutObject: Common upload object
- PostObject: Form upload object
- AppendObject: Append upload object
- CopyObject: Copy object
- CompleteMultipartUpload: Complete object multipart upload
- FetchObject: Fetch object, including fetching generated by the image forward to origin
- DeleteObject: Delete object
- DeleteMultipleObjects: Delete multiple objects
apps[] Array Required Product that subscribes message.
+id String Required Notified product ID
+eventUrl String Required URL for handling event notification, optional value: {"http", "https", "brn", "app"}. Of which, http/https is the custom application, brn is the notification of CFC, and app is the official application.
+xVars String Optional Custom parameter for the transparent transmission, which is transparent to the framework and used for the value passed back by the business itself. If it is the official AI application, it is a string JSON and contains a saveUrl address to receive the processing results.

Example

  • Request example

    http
    GET /?notification HTTP/1.1
    Host: <BucketName>.bj.bcebos.com
    Date: Wed, 12 Sep 2018 06:34:40 GMT
    Authorization: AuthorizationString
  • Response example

    HTTP/1.1 200 OK
    x-bce-request-id: 4db2b34d-654d-4d8a-b49b-xxxxxx786409
    Date: Wed, 12 Sep 2018 06:34:40 GMT
    Content-Length: 0
    Connection: close
    Server: BceBos
    
    {
        "notifications": [
            {
                "id": "notify-id-1",
                "name": "rule-name",
                "appId": "app-id-1",
                "status": "enabled",
                "resources": [
                    "bucket-a/path1", "/path2", "/path3/*.jpg", "/path4/*"
                ],
                "events": [
                    "PutObject"
                ],
                "apps": [
                    {
                        "id": "app-id-1",
                        "eventUrl": "http://xxx.com/event",
                        "xVars": ""
                    },
                    {
                        "id": "app-id-2",
                        "eventUrl": "brn:bce:cfc:bj:1f1c3e383c31e6467c4c44523f0d5b22:function:hello_bos:$LATEST"
                    },
                    {
                        "id": "app-id-3",
                        "eventUrl": "app:ImageOcr",
                        "xVars": "{\"saveUrl\": \"http://xxx.com/ocr\"}"
                    }
                ]
            }
        ]
    }
Previous
DeleteNotification
Next
PostEvent