diff --git a/dist/main b/dist/main index eea48e8..1088a86 100755 Binary files a/dist/main and b/dist/main differ diff --git a/src/main.go b/src/main.go index 8461430..b35e2d1 100644 --- a/src/main.go +++ b/src/main.go @@ -75,7 +75,7 @@ func bodyResHandler(ctx iris.Context, err error, body interface{}) interface{} { func main() { fmt.Println("\033[31m\r\n ________ ________ _____ ______ ___ ________ ___ ________ \r\n|\\ __ \\ |\\ ___ \\ |\\ _ \\ _ \\ |\\ \\ |\\ ___ \\ |\\ \\ |\\ __ \\ \r\n\\ \\ \\|\\ \\\\ \\ \\_|\\ \\\\ \\ \\\\\\__\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\|\\ \\ \r\n \\ \\ __ \\\\ \\ \\ \\\\ \\\\ \\ \\\\|__| \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\\\ \\ \r\n \\ \\ \\ \\ \\\\ \\ \\_\\\\ \\\\ \\ \\ \\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\\\ \\ \r\n \\ \\__\\ \\__\\\\ \\_______\\\\ \\__\\ \\ \\__\\\\ \\__\\\\ \\__\\\\ \\__\\\\ \\__\\\\ \\_______\\\r\n \\|__|\\|__| \\|_______| \\|__| \\|__| \\|__| \\|__| \\|__| \\|__| \\|_______|\r\n \r\n \r\n \033[m") fmt.Println("\033[33mAdmin REST API for http://min.io (minio) s3 server") - fmt.Println("version : 0.7 ") + fmt.Println("version : 0.8 ") fmt.Println("Author : rzrbld") fmt.Println("License : MIT") fmt.Println("Git-repo : https://github.com/rzrbld/adminio \033[m \r\n") @@ -383,6 +383,23 @@ func main() { ctx.JSON(res) }) + v1.Post("/get-bucket-lifecycle", func(ctx iris.Context) { + var bucketName = ctx.FormValue("bucketName") + + lc, err := minioClnt.GetBucketLifecycle(bucketName) + var res = bodyResHandler(ctx, err, lc) + ctx.JSON(res) + }) + + v1.Post("/set-bucket-lifecycle", func(ctx iris.Context) { + var bucketName = ctx.FormValue("bucketName") + var lifecycle = ctx.FormValue("lifecycle") + + err := minioClnt.SetBucketLifecycle(bucketName, lifecycle) + var res = defaultResHandler(ctx, err) + ctx.JSON(res) + }) + v1.Get("/server-info", func(ctx iris.Context) { si, err := madmClnt.ServerInfo() var res = bodyResHandler(ctx, err, si)