Skip to content

myENA/radosgwadmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3b6ecec · Feb 21, 2023

History

84 Commits
Aug 26, 2022
Sep 6, 2017
Oct 1, 2021
Oct 26, 2017
Jul 27, 2017
Aug 26, 2022
Nov 19, 2017
Sep 14, 2017
Aug 26, 2022
Feb 12, 2018
Oct 26, 2017
Feb 20, 2023
Feb 20, 2023
Nov 19, 2017
Nov 19, 2017
Nov 19, 2017
Jul 24, 2017
Nov 19, 2017
Nov 19, 2017

Repository files navigation

Mozilla Public License Go Report Card GoDoc Build Status

Package radosgwadmin wraps http://docs.ceph.com/docs/master/radosgw/adminops

Additionally, exposes some undocumented metadata operations (methods starting with 'M').

Requires Go 1.7 or newer. Tested with Jewel through Luminous releases of Ceph.

Example app:

    package main

    import (
        "context"
        "fmt"
        "time"

        rgw "github.com/myENA/radosgwadmin"
        rcl "github.com/myENA/restclient"
    )

    func main() {

        cfg := &rgw.Config{
            ClientConfig: rcl.ClientConfig{
                ClientTimeout:   rcl.Duration(time.Second * 10),
            },
            ServerURL:       "https://my.rgw.org/",
            AdminPath:       "admin",
            AccessKeyID:     "ABC123BLAHBLAHBLAH",
            SecretAccessKey: "IMASUPERSECRETACCESSKEY",
        }

        aa, err := rgw.NewAdminAPI(cfg)
        if err != nil {
            // do something, bail out.
        }
        users, err := aa.MListUsers(context.Background())
        if err != nil {
            // handle error
            return
        }
        fmt.Println(users)
    }

Input validation is provided by https://godoc.org/gopkg.in/go-playground/validator.v9