Created
July 12, 2019 08:36
-
-
Save goeh/75c3f5b8322eec92fdf070529848c4c2 to your computer and use it in GitHub Desktop.
Groovy script to test MinIO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab('io.minio:minio:6.0.8') | |
import io.minio.MinioClient | |
def serviceUrl = "https://minioserver:9000" | |
def accessKey = "*****" | |
def secretKey = "*****" | |
def bucketName = "groovy-test" | |
def client = new MinioClient(serviceUrl, accessKey, secretKey) | |
if(!client.bucketExists(bucketName)) { | |
client.makeBucket(bucketName) | |
} | |
def input = new ByteArrayInputStream("Hello World!".getBytes("UTF-8")) | |
client.putObject(bucketName, "hello.txt", input, "text/plain") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment