本文整理汇总了Python中minio.Minio.copy_object方法的典型用法代码示例。如果您正苦于以下问题:Python Minio.copy_object方法的具体用法?Python Minio.copy_object怎么用?Python Minio.copy_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类minio.Minio
的用法示例。
在下文中一共展示了Minio.copy_object方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Minio
# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import copy_object [as 别名]
from minio.error import ResponseError
client = Minio('s3.amazonaws.com',
access_key='YOUR-ACCESSKEY',
secret_key='YOUR-SECRETKEY')
# client.trace_on(sys.stderr)
copy_conditions = CopyConditions()
# Set modified condition, copy object modified since 2014 April.
t = (2014, 4, 0, 0, 0, 0, 0, 0, 0)
mod_since = datetime.utcfromtimestamp(time.mktime(t))
copy_conditions.set_modified_since(mod_since)
# Set unmodified condition, copy object unmodified since 2014 April.
# copy_conditions.set_unmodified_since(mod_since)
# Set matching ETag condition, copy object which matches the following ETag.
# copy_conditions.set_match_etag("31624deb84149d2f8ef9c385918b653a")
# Set matching ETag except condition, copy object which does not match the
# following ETag.
# copy_conditions.set_match_etag_except("31624deb84149d2f8ef9c385918b653a")
try:
copy_result = client.copy_object("my-bucket", "my-object",
"/my-sourcebucket/my-sourceobject",
copy_conditions)
print(copy_result)
except ResponseError as err:
print(err)
示例2: test_object_is_not_empty_string
# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import copy_object [as 别名]
def test_object_is_not_empty_string(self):
client = Minio('localhost:9000')
client.copy_object('hello', ' \t \n ', '')
示例3: test_length_is_string
# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import copy_object [as 别名]
def test_length_is_string(self):
client = Minio('localhost:9000')
client.copy_object('..hello', '1', '/testbucket/object')
示例4: test_object_is_string
# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import copy_object [as 别名]
def test_object_is_string(self):
client = Minio('localhost:9000')
client.copy_object('hello', 12, 12)