You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.2 KiB
1.2 KiB
<html>
<head>
</head>
</html>
In [ ]:
from minio import Minio
from minio.error import S3Error
def main():
client = Minio(
"minio_endpoint",
access_key="key",
secret_key="secret",
)
# Make 'asiatrip' bucket if not exist.
found = client.bucket_exists("bucket")
if not found:
client.make_bucket("bucket")
else:
print("Bucket already exists")
client.fput_object(
"bucket", "bucket_file", "local_file_path",
)
print(
"'local_file_path' is successfully uploaded as "
"object 'bucket_file' to bucket 'bucket'."
)
if __name__ == "__main__":
try:
main()
except S3Error as exc:
print("error occurred.", exc)