当前位置: 首页>>代码示例>>Python>>正文


Python Minio.set_bucket_notification方法代码示例

本文整理汇总了Python中minio.Minio.set_bucket_notification方法的典型用法代码示例。如果您正苦于以下问题:Python Minio.set_bucket_notification方法的具体用法?Python Minio.set_bucket_notification怎么用?Python Minio.set_bucket_notification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在minio.Minio的用法示例。


在下文中一共展示了Minio.set_bucket_notification方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_notification_config_id_key_is_optional

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_config_id_key_is_optional(self, mock_connection):
     mock_server = MockConnection()
     mock_connection.return_value = mock_server
     mock_server.mock_add_request(
         MockResponse(
             'PUT',
             'https://localhost:9000/my-test-bucket/?notification=',
             {
                 'Content-Md5': 'f+TfVp/A4pNnI7S4S+MkFg==',
                 'Content-Length': '196',
                 'User-Agent': _DEFAULT_USER_AGENT,
             },
             200, content=""
         )
     )
     client = Minio('localhost:9000')
     client.set_bucket_notification(
         'my-test-bucket',
         {
             'QueueConfigurations': [
                 {
                     'Arn': 'arn1',
                     'Events': ['s3:ObjectCreated:*'],
                 }
             ]
         }
     )
开发者ID:balamurugana,项目名称:minio-py,代码行数:29,代码来源:set_bucket_notification_test.py

示例2: test_notification_config_events_key_is_present

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_config_events_key_is_present(self):
     client = Minio('localhost:9000')
     client.set_bucket_notification(
         'my-test-bucket',
         {
             'QueueConfigurations': [
                 {
                     'Id': '1',
                     'Arn': 'arn1',
                 }
             ]
         }
     )
开发者ID:balamurugana,项目名称:minio-py,代码行数:15,代码来源:set_bucket_notification_test.py

示例3: test_notification_config_arn_key_is_present

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_config_arn_key_is_present(self):
     client = Minio('localhost:9000')
     client.set_bucket_notification(
         'my-test-bucket',
         {
             'QueueConfigurations': [
                 {
                     'Id': '1',
                     'Events': ['s3:ObjectCreated:*'],
                 }
             ]
         }
     )
开发者ID:balamurugana,项目名称:minio-py,代码行数:15,代码来源:set_bucket_notification_test.py

示例4: test_notification_config_id_key_is_string

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_config_id_key_is_string(self):
     client = Minio('localhost:9000')
     client.set_bucket_notification(
         'my-test-bucket',
         {
             'QueueConfigurations': [
                 {
                     'Id': 1,
                     'Arn': 'abc',
                     'Events': ['s3:ObjectCreated:*'],
                 }
             ]
         }
     )
开发者ID:balamurugana,项目名称:minio-py,代码行数:16,代码来源:set_bucket_notification_test.py

示例5: test_notification_config_has_valid_keys

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_config_has_valid_keys(self):
     client = Minio('localhost:9000')
     client.set_bucket_notification(
         'my-test-bucket',
         {
             'QueueConfiguration': [
                 {
                     'Id': '1',
                     'Arn': 'arn1',
                     'Events': ['s3:ObjectCreated:*'],
                 }
             ]
         }
     )
开发者ID:balamurugana,项目名称:minio-py,代码行数:16,代码来源:set_bucket_notification_test.py

示例6: test_notification_config_has_valid_event_names

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_config_has_valid_event_names(self):
     client = Minio('localhost:9000')
     client.set_bucket_notification(
         'my-test-bucket',
         {
             'QueueConfigurations': [
                 {
                     'Id': '1',
                     'Arn': 'arn1',
                     'Events': ['object_created'],
                 }
             ]
         }
     )
开发者ID:balamurugana,项目名称:minio-py,代码行数:16,代码来源:set_bucket_notification_test.py

示例7: test_notification_config_filterspec_is_valid_1

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_config_filterspec_is_valid_1(self):
     client = Minio('localhost:9000')
     client.set_bucket_notification(
         'my-test-bucket',
         {
             'QueueConfigurations': [
                 {
                     'Id': '1',
                     'Arn': 'arn1',
                     'Events': ['s3:ObjectCreated:*'],
                     'Filter': []
                 }
             ]
         }
     )
开发者ID:balamurugana,项目名称:minio-py,代码行数:17,代码来源:set_bucket_notification_test.py

示例8: test_notification_config_filterspec_is_valid_8

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_config_filterspec_is_valid_8(self, mock_connection):
     mock_server = MockConnection()
     mock_connection.return_value = mock_server
     mock_server.mock_add_request(
         MockResponse(
             'PUT',
             'https://localhost:9000/my-test-bucket/?notification=',
             {
                 'Content-Length': '206',
                 'Content-Md5': 'AGCNfbD5OuiyIJFd+r67MA==',
                 'User-Agent': _DEFAULT_USER_AGENT,
             },
             200, content=""
         )
     )
     client = Minio('localhost:9000')
     client.set_bucket_notification(
         'my-test-bucket',
         {
             'QueueConfigurations': [
                 {
                     'Id': '1',
                     'Arn': 'arn1',
                     'Events': ['s3:ObjectCreated:*'],
                     'Filter': {
                         'Key': {
                             'FilterRules': [
                                 {
                                     'Name': 'suffix',
                                     'Value': 'abc'
                                 }
                             ]
                         }
                     }
                 }
             ]
         }
     )
开发者ID:balamurugana,项目名称:minio-py,代码行数:40,代码来源:set_bucket_notification_test.py

示例9: test_notification_config_is_nonempty

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_config_is_nonempty(self):
     client = Minio('localhost:9000')
     client.set_bucket_notification(
         'my-test-bucket',
         {}
     )
开发者ID:balamurugana,项目名称:minio-py,代码行数:8,代码来源:set_bucket_notification_test.py

示例10: test_notification_is_dict_2

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_is_dict_2(self):
     client = Minio('localhost:9000')
     client.set_bucket_notification('my-test-bucket', ['myconfig1'])
开发者ID:balamurugana,项目名称:minio-py,代码行数:5,代码来源:set_bucket_notification_test.py

示例11: test_notification_is_dict_1

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
 def test_notification_is_dict_1(self):
     client = Minio('localhost:9000')
     client.set_bucket_notification('my-test-bucket', 'abc')
开发者ID:balamurugana,项目名称:minio-py,代码行数:5,代码来源:set_bucket_notification_test.py

示例12: print

# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import set_bucket_notification [as 别名]
                }
            }
        }
    ],
    'CloudFunctionConfigurations': [
        {
            'Arn': 'arn3',
            'Events': ['s3:ObjectRemoved:*'],
            'Filter': {
                'Key': {
                    'FilterRules': [
                        {
                            'Name': 'suffix',
                            'Value': '.jpg'
                        }
                    ]
                }
            }
        }
    ]
}

try:
    client.set_bucket_notification('my-bucketname', notification)
except ResponseError as err:
    # handle error response from service.
    print(err)
except (ArgumentError, TypeError) as err:
    # should happen only during development. Fix the notification argument
    print(err)
开发者ID:minio,项目名称:minio-py,代码行数:32,代码来源:set_bucket_notification.py


注:本文中的minio.Minio.set_bucket_notification方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。