• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. Developer Guide (PHP SDK)
  4. Event Notification
  5. Viewing Event Notification Settings

Viewing Event Notification Settings

You can call ObsClient->getBucketNotification to view event notification settings of a bucket. Sample code is as follows:

// Import the third-party open source libraries.
require 'vendor/autoload.php';
// Import the SDK code library.
require 'obs-autoloader.php';
// Declare the namespace.
use Obs\S3\ObsClient;
// Create an instance of ObsClient.
$obsClient = new ObsClient ( [ 
       'key' => '*** Provide your Access Key ***',
       'secret' => '*** Provide your Secret Key ***',
       'endpoint' => 'https://yourdomainname'
] );

$resp = $obsClient->getBucketNotification ( [ 
       'Bucket' => 'bucketname' 
] );
printf ( "RequestId:%s\n", $resp ['RequestId'] );
foreach ( $resp ['TopicConfigurations'] as $index => $topicConfiguration ) {
    printf ( "TopicConfigurations[%d]\n", $index + 1 );
    printf ( "ID:%s\n", $topicConfiguration ['ID'] );
    printf ( "Topic:%s\n", $topicConfiguration ['Topic'] );
    printf ( "Event:%s\n", print_r ( $topicConfiguration ['Event'], true ) );
 foreach ( $topicConfiguration ['Filter'] as $index => $filter ) {
           printf ( "Filter[%d]", $index + 1 );
           printf ( "Name:%s\n", $filter ['Name'] );
           printf ( "Value:%s\n", $filter ['Value'] );
    }
}