mirekys / go-rgwadmin

Ceph RADOS Gateway admin(golang)

Home Page:https://irekfasikhov.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-rgwadmin

Package radosgw-admin wraps http://docs.ceph.com/docs/mimic/radosgw/adminops

Requires Go 1.11 or newer. Tested with Liminous and Mimic releases!

Example App:

func main() {

  endpoint := os.Getenv("RGW_ENDPOINT")
  accessKey := os.Getenv("RGW_ACCESS_KEY")
  secretKey := os.Getenv("RGW_SECRET_KEY")
  
.........

  api, err := rgwadmin.NewRGW(endpoint, accessKey, secretKey)
  if err != nil {
  	fmt.Println(err)
  	return
  }

  if *getUser {
  	u := rgwadmin.User{
  		UID: *uid,
  	}
  	user, _ := api.GetUser(u)
  	fmt.Println(user)
  }
  if *createUser {
  	u := rgwadmin.User{
  		UID:         *uid,
  		DisplayName: *displayName,
  		Email:       *email,
  		Suspended:   suspended,
  	}
  	fmt.Println(api.CreateUser(u))
  }
.....

About

Ceph RADOS Gateway admin(golang)

https://irekfasikhov.com

License:GNU General Public License v3.0


Languages

Language:Go 100.0%