Skip to content

Commit

Permalink
add bucket lifecycle methods
Browse files Browse the repository at this point in the history
  • Loading branch information
rzrbld committed Mar 9, 2020
1 parent 71bcd68 commit e9ecb14
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e9ecb14

Please sign in to comment.