def _ListChannels(self, bucket_arg):
    'Lists active channel watches on a bucket given in self.args.'
    bucket_url = StorageUrlFromString(bucket_arg)
    if (not (bucket_url.IsBucket() and (bucket_url.scheme == 'gs'))):
        raise CommandException(('The %s command can only be used with gs:// bucket URLs.' % self.command_name))
    if (not bucket_url.IsBucket()):
        raise CommandException(('URL must name a bucket for the %s command.' % self.command_name))
    channels = self.gsutil_api.ListChannels(bucket_url.bucket_name, provider='gs').items
    self.logger.info('Bucket %s has the following active Object Change Notifications:', bucket_url.bucket_name)
    for (idx, channel) in enumerate(channels):
        self.logger.info('\tNotification channel %d:', (idx + 1))
        self.logger.info('\t\tChannel identifier: %s', channel.channel_id)
        self.logger.info('\t\tResource identifier: %s', channel.resource_id)
        self.logger.info('\t\tApplication URL: %s', channel.push_url)
        self.logger.info('\t\tCreated by: %s', channel.subscriber_email)
        self.logger.info('\t\tCreation time: %s', str(datetime.fromtimestamp((channel.creation_time_ms / 1000))))
    return 0
Lists active channel watches on a bucket given in self.args.
def _ListChannels(self, bucket_arg):
    
    bucket_url = StorageUrlFromString(bucket_arg)
    if (not (bucket_url.IsBucket() and (bucket_url.scheme == 'gs'))):
        raise CommandException(('The %s command can only be used with gs:// bucket URLs.' % self.command_name))
    if (not bucket_url.IsBucket()):
        raise CommandException(('URL must name a bucket for the %s command.' % self.command_name))
    channels = self.gsutil_api.ListChannels(bucket_url.bucket_name, provider='gs').items
    self.logger.info('Bucket %s has the following active Object Change Notifications:', bucket_url.bucket_name)
    for (idx, channel) in enumerate(channels):
        self.logger.info('\tNotification channel %d:', (idx + 1))
        self.logger.info('\t\tChannel identifier: %s', channel.channel_id)
        self.logger.info('\t\tResource identifier: %s', channel.resource_id)
        self.logger.info('\t\tApplication URL: %s', channel.push_url)
        self.logger.info('\t\tCreated by: %s', channel.subscriber_email)
        self.logger.info('\t\tCreation time: %s', str(datetime.fromtimestamp((channel.creation_time_ms / 1000))))
    return 0