radosgwadmin

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2023 License: MPL-2.0 Imports: 10 Imported by: 3

README

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

Documentation

Overview

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

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

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

Index

Constants

View Source
const RadosBucketTimeFormat string = "2006-01-02 15:04:05.000000"

RadosBucketTimeFormat - used for bucket calls

View Source
const RadosTimeFormat string = "2006-01-02 15:04:05.000000Z07:00"

RadosTimeFormat - this is the most common rados time format

Variables

View Source
var FalseRef = &falsch

FalseRef - Use this type whenever you want to make an API call where a bool defaults to true if omitted, and want it to actually be false. In such cases, the struct contains a reference to a bool versus a bool, since you cannot otherwise differentiate false with unspecified. This represents a reference to a boolean false value.

Functions

func SetTimeZone

func SetTimeZone(loc *time.Location)

SetTimeZone - override time zone. Not thread-safe, do this at initialization time or protect it with a mutex if necessary.

Types

type AdminAPI

type AdminAPI struct {
	*restclient.BaseClient
	// contains filtered or unexported fields
}

AdminAPI - admin api struct

func NewAdminAPI

func NewAdminAPI(cfg *Config) (*AdminAPI, error)

NewAdminAPI - AdminAPI factory method.

func (*AdminAPI) BucketIndex

func (aa *AdminAPI) BucketIndex(ctx context.Context, bireq *BucketIndexRequest) (*BucketIndexResponse, error)

BucketIndex - Bucket index operations. Bucket name required.

func (aa *AdminAPI) BucketLink(ctx context.Context, bucket, bucketID, uid string) error

BucketLink - link a bucket to a user, removing any previous links. All parameters required.

func (*AdminAPI) BucketList

func (aa *AdminAPI) BucketList(ctx context.Context, uid string) ([]string, error)

BucketList -

return a list of all bucket names, optionally filtered by uid

func (*AdminAPI) BucketObjectRm

func (aa *AdminAPI) BucketObjectRm(ctx context.Context, bucket, object string) error

BucketObjectRm - remove a bucket. bucket must be non-empty string.

func (*AdminAPI) BucketPolicy

func (aa *AdminAPI) BucketPolicy(ctx context.Context, bucket, object string) (*BucketPolicyResponse, error)

BucketPolicy - get a bucket policy. bucket required, object is optional.

func (*AdminAPI) BucketRm

func (aa *AdminAPI) BucketRm(ctx context.Context, bucket string, purge bool) error

BucketRm - remove a bucket. bucket must be non-empty string.

func (*AdminAPI) BucketStats

func (aa *AdminAPI) BucketStats(ctx context.Context, uid string, bucket string) ([]BucketStatsResponse, error)

BucketStats -

return a list of all bucket stats, optionally filtered by uid and bucket name

func (aa *AdminAPI) BucketUnlink(ctx context.Context, bucket string, uid string) error

BucketUnlink - unlink a bucket from a user. All parameters required.

func (*AdminAPI) CapsAdd

func (aa *AdminAPI) CapsAdd(ctx context.Context, ucr *UserCapsRequest) ([]UserCap, error)

CapsAdd - Add capabilities / permissions. Returns the new effective capabilities.

Note - capabilities are additive. This will only ever make a user's permissions more permissive. As an example, if the user has metadata permission of *, calling this with metadata set to read will have no effect. On the other hand, if a user's permission was read, and CapsAdd was called with write, the new effective permission would be read + write (*). To remove permissions, you must call CapsRm(), which is subtractive.

func (*AdminAPI) CapsRm

func (aa *AdminAPI) CapsRm(ctx context.Context, ucr *UserCapsRequest) ([]UserCap, error)

CapsRm - Remove capabilities / permissions. Returns the new effective capabilities. See notes for CapsAdd().

func (*AdminAPI) KeyCreate

func (aa *AdminAPI) KeyCreate(ctx context.Context, kcr *KeyCreateRequest) ([]UserKey, error)

KeyCreate - Create a key

Create a new key. If a subuser is specified then by default created keys will be swift type. If only one of access-key or secret-key is provided the committed key will be automatically generated, that is if only SecretKey is specified then AccessKey will be automatically generated. By default, a generated key is added to the keyring without replacing an existing key pair. If access-key is specified and refers to an existing key owned by the user then it will be modified. The response is a container listing all keys of the same type as the key created. Note that when creating a swift key, specifying the option AccessKey will have no effect. Additionally, only one swift key may be held by each user or subuser.

func (*AdminAPI) KeyRm

func (aa *AdminAPI) KeyRm(ctx context.Context, krr *KeyRmRequest) error

KeyRm - delete an existing key.

Key type is optional, but required to remove a swift key.

func (*AdminAPI) MGetBucket

func (aa *AdminAPI) MGetBucket(ctx context.Context, bucket string) (*MBucketResponse, error)

MGetBucket - This is the radosgw-admin metadata get bucket command Returns metadata about a single bucket

func (*AdminAPI) MGetBucketInstance

func (aa *AdminAPI) MGetBucketInstance(ctx context.Context, bucket string) (*MBucketInstanceResponse, error)

MGetBucketInstance - This is the radosgw-admin metadata get bucket.instance command Returns metadata about a single bucket.instance

func (*AdminAPI) MGetUser

func (aa *AdminAPI) MGetUser(ctx context.Context, user string) (*MUserResponse, error)

MGetUser - This is the radosgw-admin metadata get user command Returns metadata about a single user

func (*AdminAPI) MListBucketInstances

func (aa *AdminAPI) MListBucketInstances(ctx context.Context) ([]string, error)

MListBucketInstances - This is the "radosgw-admin metadata list bucket.instance" command Returns a list of usernames

func (*AdminAPI) MListBuckets

func (aa *AdminAPI) MListBuckets(ctx context.Context) ([]string, error)

MListBuckets - This is the "radosgw-admin metadata list bucket" command Returns a list of usernames

func (*AdminAPI) MListUsers

func (aa *AdminAPI) MListUsers(ctx context.Context) ([]string, error)

MListUsers - This is the radosgw-admin metadata list user command Returns a list of usernames

func (*AdminAPI) QuotaBucket

func (aa *AdminAPI) QuotaBucket(ctx context.Context, uid string) (*QuotaMeta, error)

QuotaBucket - get bucket quota info by uid

func (*AdminAPI) QuotaSet

func (aa *AdminAPI) QuotaSet(ctx context.Context, qsr *QuotaSetRequest) error

QuotaSet - Set a quota

func (*AdminAPI) QuotaUser

func (aa *AdminAPI) QuotaUser(ctx context.Context, uid string) (*QuotaMeta, error)

QuotaUser - get user quota info by uid.

func (*AdminAPI) Quotas

func (aa *AdminAPI) Quotas(ctx context.Context, uid string) (*Quotas, error)

Quotas - get user and bucket quota info by uid

func (*AdminAPI) SubUserCreate

func (aa *AdminAPI) SubUserCreate(ctx context.Context, sucr *SubUserCreateModifyRequest) ([]SubUser, error)

SubUserCreate - create a subuser

func (*AdminAPI) SubUserModify

func (aa *AdminAPI) SubUserModify(ctx context.Context, sucr *SubUserCreateModifyRequest) ([]SubUser, error)

SubUserModify - modify a subuser

func (*AdminAPI) SubUserRm

func (aa *AdminAPI) SubUserRm(ctx context.Context, surm *SubUserRmRequest) error

SubUserRm - delete a subuser

func (*AdminAPI) Usage

func (aa *AdminAPI) Usage(ctx context.Context, ureq *UsageRequest) (*UsageResponse, error)

Usage - Get usage data.

func (*AdminAPI) UsageTrim

func (aa *AdminAPI) UsageTrim(ctx context.Context, treq *TrimUsageRequest) error

UsageTrim - trim usage data

func (*AdminAPI) UserCreate

func (aa *AdminAPI) UserCreate(ctx context.Context, cur *UserCreateRequest) (*UserInfoResponse, error)

UserCreate - create a user described by cur.

func (*AdminAPI) UserInfo

func (aa *AdminAPI) UserInfo(ctx context.Context, uid string, stats bool) (*UserInfoResponse, error)

UserInfo - get user information about uid. If stats is true, then return quota statistics. This will return a not found error if no statistics are available, even if the user exists.

func (*AdminAPI) UserModify

func (aa *AdminAPI) UserModify(ctx context.Context, umr *UserModifyRequest) (*UserInfoResponse, error)

UserModify - modify a user described by umr

func (*AdminAPI) UserRm

func (aa *AdminAPI) UserRm(ctx context.Context, uid string, purge bool) error

UserRm - delete user uid

type Attr

type Attr struct {
	Key string `json:"key"`
	Val string `json:"val"`
}

Attr - kv data that acompanies some metadata responses.

type BucketIndexRequest

type BucketIndexRequest struct {
	Bucket       string `url:"bucket" validation:"required"`
	CheckObjects bool   `url:"check-objects,omitempty"`
	Fix          bool   `url:"fix,omitempty"`
}

BucketIndexRequest - bucket index request struct

type BucketIndexResponse

type BucketIndexResponse struct {
	NewObjects []string `json:"new_objects"`
	Headers    struct {
		ExistingHeader struct {
			Usage BucketUsage `json:"usage"`
		} `json:"existing_header,omitempty"`
		CalculatedHeader struct {
			Usage BucketUsage `json:"calculated_header,omitempty"`
		}
	} `json:"headers"`
}

BucketIndexResponse - bucket index response struct

func (*BucketIndexResponse) Decode

func (bir *BucketIndexResponse) Decode(data io.Reader) error

Decode - Implements the restapi.CustomDecoder interface

type BucketPolicyResponse

type BucketPolicyResponse struct {
	Owner struct {
		DisplayName string `json:"display_name"`
		ID          string `json:"id"`
	} `json:"owner"`
	ACL struct {
		ACLGroupMap []struct {
			ACL   int `json:"acl"`
			Group int `json:"group"`
		} `json:"acl_group_map"`
		ACLUserMap []struct {
			ACL  int    `json:"acl"`
			User string `json:"user"`
		} `json:"acl_user_map"`

		GrantMap []struct {
			ID    string `json:"id"`
			Grant struct {
				Name       string `json:"name"`
				Permission struct {
					Flags int `json:"flags"`
				} `json:"permission"`
				Type struct {
					Type int `json:"type"`
				} `json:"type"`
				Email string `json:"email"`
				ID    string `json:"id"`
				Group int    `json:"group"`
			} `json:"grant"`
		} `json:"grant_map"`
	}
}

BucketPolicyResponse - response from a bucket policy call

type BucketQuota

type BucketQuota struct {
	Enabled    bool  `json:"enabled"`
	MaxSizeKb  int64 `json:"max_size_kb"`
	MaxObjects int64 `json:"max_objects"`
}

BucketQuota - bucket quota metadata

type BucketStatsResponse

type BucketStatsResponse struct {
	Bucket      string       `json:"bucket"`
	Pool        string       `json:"pool"`
	IndexPool   string       `json:"index_pool"`
	ID          string       `json:"id"`
	Marker      string       `json:"marker"`
	Owner       string       `json:"owner"`
	Ver         string       `json:"ver"`
	MasterVer   string       `json:"master_ver"`
	Mtime       RadosTime    `json:"mtime"`
	MaxMarker   string       `json:"max_marker"`
	Usage       BucketUsage  `json:"usage"`
	BucketQuota *BucketQuota `json:"bucket_quota"`
}

BucketStatsResponse - bucket stats response type

type BucketUsage

type BucketUsage struct {
	RGWNone      *BucketUsageEntry `json:"rgw.none,omitempty"`
	RGWMain      *BucketUsageEntry `json:"rgw.main,omitempty"`
	RGWShadow    *BucketUsageEntry `json:"rgw.shadow,omitempty"`
	RGWMultiMeta *BucketUsageEntry `json:"rgw.multimeta,omitempty"`
}

BucketUsage - Bucket usage entries

type BucketUsageEntry

type BucketUsageEntry struct {
	SizeKb       uint64 `json:"size_kb"`
	SizeKbActual uint64 `json:"size_kb_actual"`
	NumObjects   uint64 `json:"num_objects"`
}

BucketUsageEntry - entry for each bucket usage bit.

type Config

type Config struct {
	restclient.ClientConfig
	ServerURL        string
	AdminPath        string
	CACertBundlePath string
	ZoneName         string
	AccessKeyID      string
	SecretAccessKey  string
	SecurityToken    string
	Expiration       time.Time
}

Config - this configures an AdminAPI.

Specify CACertBundlePath to load a bundle from disk to override the default. Specify CACertBundle if you want embed the cacert bundle in PEM format. Specify one or the other. If both are specified, CACertBundle is honored.

type KeyCreateRequest

type KeyCreateRequest struct {
	UID         string `url:"uid" validate:"required"`
	SubUser     string `url:"subuser,omitempty"`
	AccessKey   string `url:"access-key,omitempty"`
	SecretKey   string `url:"secret-key,omitempty"`
	KeyType     string `url:"key-type,omitempty" validate:"omitempty,eq=s3|eq=swift"`
	GenerateKey *bool  `url:"generate-key,omitempty"` // defaults to true
}

KeyCreateRequest - Create or modify a key.

type KeyRmRequest

type KeyRmRequest struct {
	AccessKey string `url:"access-key" validate:"required"`
	UID       string `url:"uid,omitempty"`
	SubUser   string `url:"subuser,omitempty"`
	KeyType   string `url:"key-type,omitempty" validate:"omitempty,eq=s3|eq=swift"`
}

KeyRmRequest - Create or modify a key.

type MBucket

type MBucket struct {
	Marker        string `json:"marker"`
	Name          string `json:"name"`
	DataExtraPool string `json:"data_extra_pool"`
	BucketID      string `json:"bucket_id"`
	Pool          string `json:"pool"`
	IndexPool     string `json:"index_pool"`
	Tenant        string `json:"tenant"`
}

MBucket - bucket information

type MBucketInstanceResponse

type MBucketInstanceResponse struct {
	MetaResponse
	Data struct {
		BucketInfo struct {
			Bucket            MBucket     `json:"bucket"`
			NumShards         int         `json:"num_shards"`
			PlacementRule     string      `json:"placement_rule"`
			SwiftVerLocation  string      `json:"swift_ver_location"`
			Flags             int         `json:"flags"`
			HasWebsite        string      `json:"has_website"` // bad bool
			Quota             BucketQuota `json:"quota"`
			SwiftVersioning   string      `json:"swift_versioning"`
			Owner             string      `json:"owner"`
			RequesterPays     string      `json:"requester_pays"`
			IndexType         int         `json:"index_type"`
			BiShardHashType   int         `json:"bi_shard_hash_type"`
			HasInstanceObject string      `json:"has_instance_obj"`
			CreationTime      string      `json:"creation_time"`
			ZoneGroup         string      `json:"zonegroup"`
		} `json:"bucket_info"`
		Attrs []Attr `json:"attrs"`
	} `json:"data"`
}

MBucketInstanceResponse - response from bucket.instance get

type MBucketResponse

type MBucketResponse struct {
	MetaResponse
	Data struct {
		Bucket        MBucket `json:"bucket"`
		HasBucketInfo string  `json:"has_bucket_info"`
		Linked        string  `json:"linked"`        // bad bool
		CreationTime  string  `json:"creation_time"` // bad float
		Owner         string  `json:"owner"`
	} `json:"data"`
}

MBucketResponse - response from metadata bucket get

type MUserResponse

type MUserResponse struct {
	MetaResponse
	Data UserInfoResponse `json:"data"`
}

MUserResponse - user metadata response

type MetaResponse

type MetaResponse struct {
	Key   string    `json:"key"`
	Mtime RadosTime `json:"mtime"`
	Ver   struct {
		Tag string `json:"tag"`
		Ver int    `json:"ver"`
	} `json:"ver"`
}

MetaResponse - base response type of all metadata calls.

type QuotaMeta

type QuotaMeta struct {
	Enabled    bool  `json:"enabled"`
	MaxSizeKb  int64 `json:"max_size_kb"`
	MaxObjects int64 `json:"max_objects"`
}

QuotaMeta - metadata about a quota

type QuotaSetRequest

type QuotaSetRequest struct {
	UID            string `url:"uid" validate:"required"`
	QuotaType      string `url:"quota-type" validate:"eq=user|eq=bucket"`
	MaximumObjects int    `url:"max-objects,omitempty"`
	MaximumSizeKb  int    `url:"max-size-kb,omitempty"`
	Enabled        bool   `url:"enabled"`
}

QuotaSetRequest - passed to a QuotaSet() call

type Quotas

type Quotas struct {
	BucketQuota QuotaMeta `json:"bucket_quota"`
	UserQuota   QuotaMeta `json:"user_quota"`
}

Quotas - return type when both bucket and user quotas are returned

type RadosTime

type RadosTime time.Time

RadosTime - This knows how to use the date time formats returned from the rados gateway.

func (RadosTime) MarshalText

func (rt RadosTime) MarshalText() ([]byte, error)

MarshalText - implements TextMarshaler

func (*RadosTime) UnmarshalText

func (rt *RadosTime) UnmarshalText(text []byte) error

UnmarshalText - implements TextUnmarshaler

type SubUser

type SubUser struct {
	ID          string `json:"id"`
	Permissions string `json:"permissions"`
}

SubUser - describes a subuser

type SubUserCreateModifyRequest

type SubUserCreateModifyRequest struct {
	UID            string `url:"uid" validate:"required"`
	SubUser        string `url:"subuser" validate:"required"`
	SecretKey      string `url:"secret-key,omitempty"`
	KeyType        string `url:"key-type,omitempty" validate:"omitempty,eq=s3|eq=swift"`
	Access         string `url:"access,omitempty" validate:"omitempty,eq=read|eq=write|eq=readwrite|eq=full"`
	GenerateSecret bool   `url:"generate-secret,omitempty"`
}

SubUserCreateModifyRequest - Create or modify sub user request.

type SubUserRmRequest

type SubUserRmRequest struct {
	UID       string `url:"uid" validate:"required"`
	SubUser   string `url:"subuser" validate:"required"`
	PurgeKeys *bool  `url:"purge-keys,omitempty"` // Default true
}

SubUserRmRequest - if PurgeKeys is nil, defaults to true

type SwiftKey

type SwiftKey struct {
	User      string `json:"user"`
	SecretKey string `json:"secret_key"`
}

SwiftKey - swift key information

type TrimUsageRequest

type TrimUsageRequest struct {
	UID       string    `url:"uid,omitempty"`
	Start     RadosTime `url:"start,omitempty"`
	End       RadosTime `url:"end,omitempty"`
	RemoveAll bool      `url:"remove-all,omitempty"`
}

TrimUsageRequest - describes a trim usage request

type UsageBucket

type UsageBucket struct {
	Bucket     string          `json:"bucket"`
	Owner      string          `json:"owner"`
	Categories []UsageCategory `json:"categories"`
	Epoch      int             `json:"epoch"`
	Time       RadosTime       `json:"time"`
}

UsageBucket - bucket usage metadata

type UsageCategory

type UsageCategory struct {
	BytesSent     int    `json:"bytes_sent"`
	BytesReceived int    `json:"bytes_received"`
	Ops           int    `json:"ops"`
	SuccessfulOps int    `json:"successful_ops"`
	Category      string `json:"category"`
}

UsageCategory - usage by category.

type UsageEntry

type UsageEntry struct {
	Buckets []UsageBucket `json:"buckets"`
	User    string        `json:"user"`
}

UsageEntry - usage entry.

type UsageRequest

type UsageRequest struct {
	UID         string    `url:"uid,omitempty"`
	Start       RadosTime `url:"start,omitempty"`
	End         RadosTime `url:"end,omitempty"`
	ShowEntries bool      `url:"show-entries,omitempty"`
	ShowSummary bool      `url:"show-summary,omitempty"`
}

UsageRequest - desribes a usage request

type UsageResponse

type UsageResponse struct {
	Entries []UsageEntry   `json:"entries"`
	Summary []UsageSummary `json:"summary"`
}

UsageResponse - response from a GetUsage()

type UsageSummary

type UsageSummary struct {
	Categories []UsageCategory `json:"categories"`
	Total      *UsageTotal     `json:"total"`
}

UsageSummary - usage summary info.

type UsageTotal

type UsageTotal struct {
	BytesSent     int `json:"bytes_sent"`
	BytesReceived int `json:"bytes_received"`
	Ops           int `json:"ops"`
	SuccessfulOps int `json:"successful_ops"`
}

UsageTotal - overall usage totals

type UserCap

type UserCap struct {
	Type       string `json:"type" validate:"required,eq=users|eq=buckets|eq=metadata|eq=usage|eq=zone"`
	Permission string `json:"perm" validate:"required,eq=*|eq=read|eq=write|eq=read0x2Cwrite"`
}

UserCap - desribes user capabilities / permissions.

func (UserCap) String

func (uc UserCap) String() string

String - Implement Stringer

type UserCapsRequest

type UserCapsRequest struct {
	UID      string    `url:"uid" validate:"required"`
	UserCaps []UserCap `url:"user-caps,semicolon" validate:"required,dive"`
}

UserCapsRequest - this is passed to CapsAdd() and CapsRm()

type UserCreateRequest

type UserCreateRequest struct {
	UID         string    `url:"uid" validate:"required"`
	DisplayName string    `url:"display-name" validate:"required"`
	Email       string    `url:"email,omitempty" validate:"omitempty,email"`
	KeyType     string    `url:"key-type,omitempty" validate:"omitempty,eq=swift|eq=s3"`
	AccessKey   string    `url:"access-key,omitempty"`
	SecretKey   string    `url:"secret-key,omitempty"`
	UserCaps    []UserCap `url:"user-caps,omitempty,semicolon" validate:"omitempty,dive"`
	Tenant      string    `url:"tenant,omitempty"`
	GenerateKey *bool     `url:"generate-key,omitempty"` // This defaults to true, preserving that behavior
	MaxBuckets  int       `url:"max-buckets,omitempty"`
	Suspended   bool      `url:"suspended,omitempty"`
}

UserCreateRequest - describes what to do in a user create operation.

type UserInfoResponse

type UserInfoResponse struct {
	Tenant      string     `json:"tenant"`
	UserID      string     `json:"user_id"`
	DisplayName string     `json:"display_name"`
	Email       string     `json:"email"`
	Suspended   int        `json:"suspended"` // should be bool
	MaxBuckets  int        `json:"max_buckets"`
	SubUsers    []SubUser  `json:"subusers"`
	Keys        []UserKey  `json:"keys"`
	SwiftKeys   []SwiftKey `json:"swift_keys"`
	Caps        []UserCap  `json:"caps"`
	// Stats is returned if the stats flag is passed to the user info request.
	Stats *UserStats `json:"stats"`
}

UserInfoResponse - response from a user info request.

type UserKey

type UserKey struct {
	User      string `json:"user"`
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
}

UserKey - user key information.

type UserModifyRequest

type UserModifyRequest struct {
	UID         string    `url:"uid" validate:"required"`
	DisplayName string    `url:"display-name,omitempty"`
	Email       string    `url:"email,omitempty"`
	KeyType     string    `url:"key-type,omitempty" validate:"omitempty,eq=swift|eq=s3"`
	AccessKey   string    `url:"access-key,omitempty"`
	SecretKey   string    `url:"secret-key,omitempty"`
	UserCaps    []UserCap `url:"user-caps,omitempty,semicolon" validate:"omitempty,dive"`
	GenerateKey bool      `url:"generate-key,omitempty"` // This defaults to false, preserving that behavior
	MaxBuckets  int       `url:"max-buckets,omitempty"`
	Suspended   bool      `url:"suspended,omitempty"`
}

UserModifyRequest - modify user request type.

type UserStats

type UserStats struct {
	Size           int `json:"size"`
	SizeActual     int `json:"size_actual"`
	SizeUtilized   int `json:"size_utilized"`
	SizeKB         int `json:"size_kb"`
	SizeKBActual   int `json:"size_kb_actual"`
	SizeKBUtilized int `json:"size_kb_utilized"`
	NumObjects     int `json:"num_objects"`
}

UserStats - statistics for a user

Directories

Path Synopsis
This is for proxying to a radosgw api instance and testing endpoints, such as with Postman etc.
This is for proxying to a radosgw api instance and testing endpoints, such as with Postman etc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL