rgwadmin

package module
v0.0.0-...-6c6e434 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

README

go-rgwadmin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValues

func GetValues(i interface{}) url.Values

GetValues reflect

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API struct for New Client

func NewRGW

func NewRGW(endpoint, accessKey, secretKey string) (*API, error)

NewRGW returns client for Ceph RGW

func (*API) CreateUser

func (api *API) CreateUser(user User) (*User, error)

CreateUser - http://docs.ceph.com/docs/mimic/radosgw/adminops/#create-user

func (*API) GetBucketPolicy

func (api *API) GetBucketPolicy(bucket string) (*Policy, error)

GetBucketPolicy - http://docs.ceph.com/docs/mimic/radosgw/adminops/#get-bucket-or-object-policy

func (*API) GetQuota

func (api *API) GetQuota(quota Quota, param string) (*Quota, error)

GetQuota for bucket and user

func (*API) GetUsage

func (api *API) GetUsage(usage Usage) (*Usage, error)

GetUsage - http://docs.ceph.com/docs/mimic/radosgw/adminops/#get-usage

func (*API) GetUser

func (api *API) GetUser(user User) (*User, error)

GetUser - http://docs.ceph.com/docs/mimic/radosgw/adminops/#get-user-info

func (*API) GetUsers

func (api *API) GetUsers() (*[]string, error)

GetUsers - list all RGW users

func (*API) InfoBucket

func (api *API) InfoBucket(bucket string) (*Bucket, error)

InfoBucket - http://docs.ceph.com/docs/mimic/radosgw/adminops/#get-bucket-info

func (*API) ListBuckets

func (api *API) ListBuckets() ([]string, error)

ListBuckets - http://docs.ceph.com/docs/mimic/radosgw/adminops/#get-bucket-info

func (*API) ModifyUser

func (api *API) ModifyUser(user User) (*User, error)

ModifyUser - http://docs.ceph.com/docs/mimic/radosgw/adminops/#modify-user

func (*API) Query

func (api *API) Query(method, param string, args url.Values) (body []byte, err error)

Query - make request

func (*API) RemoveUser

func (api *API) RemoveUser(user User) error

RemoveUser - http://docs.ceph.com/docs/mimic/radosgw/adminops/#remove-user

func (*API) SetQuota

func (api *API) SetQuota(quota Quota, param string) (*Quota, error)

SetQuota for bucket and user

func (*API) TrimUsage

func (api *API) TrimUsage(usage Usage) error

TrimUsage - http://docs.ceph.com/docs/mimic/radosgw/adminops/#trim-usage

type Bucket

type Bucket struct {
	Bucket            string `json:"bucket" url:"bucket"`
	Zonegroup         string `json:"zonegroup"`
	PlacementRule     string `json:"placement_rule"`
	ExplicitPlacement struct {
		DataPool      string `json:"data_pool"`
		DataExtraPool string `json:"data_extra_pool"`
		IndexPool     string `json:"index_pool"`
	} `json:"explicit_placement"`
	ID        string `json:"id"`
	Marker    string `json:"marker"`
	IndexType string `json:"index_type"`
	Owner     struct {
		ID          string `json:"id"`
		DisplayName string `json:"display_name"`
	} `json:"owner"`
	Ver       string `json:"ver"`
	MasterVer string `json:"master_ver"`
	Mtime     string `json:"mtime"`
	MaxMarker string `json:"max_marker"`
	Usage     struct {
		RgwMain struct {
			Size           uint64 `json:"size"`
			SizeActual     uint64 `json:"size_actual"`
			SizeUtilized   uint64 `json:"size_utilized"`
			SizeKb         uint64 `json:"size_kb"`
			SizeKbActual   uint64 `json:"size_kb_actual"`
			SizeKbUtilized uint64 `json:"size_kb_utilized"`
			NumObjects     uint64 `json:"num_objects"`
		} `json:"rgw.main"`
		RgwMultimeta struct {
			Size           uint64 `json:"size"`
			SizeActual     uint64 `json:"size_actual"`
			SizeUtilized   uint64 `json:"size_utilized"`
			SizeKb         uint64 `json:"size_kb"`
			SizeKbActual   uint64 `json:"size_kb_actual"`
			SizeKbUtilized uint64 `json:"size_kb_utilized"`
			NumObjects     uint64 `json:"num_objects"`
		} `json:"rgw.multimeta"`
	} `json:"usage"`
	BucketQuota struct {
		Enabled    *bool   `json:"enabled"`
		CheckOnRaw bool    `json:"check_on_raw"`
		MaxSize    *uint64 `json:"max_size"`
		MaxSizeKb  *uint64 `json:"max_size_kb"`
		MaxObjects *uint64 `json:"max_objects"`
	} `json:"bucket_quota"`
	Police bool `url:"policy"`
}

Bucket struct

type Cap

type Cap struct {
	Type string `json:"type"`
	Perm string `json:"perm"`
}

Cap struct

type Key

type Key struct {
	User      string `json:"user"`
	AccessKey string `json:"access_key" url:"access-key"`
	SecretKey string `json:"secret_key" url:"secret-key"`
}

Key struct

type Policy

type Policy struct {
	ACL struct {
		ACLUserMap []struct {
			User string `json:"user"`
			ACL  int    `json:"acl"`
		} `json:"acl_user_map"`
		ACLGroupMap []interface{} `json:"acl_group_map"`
		GrantMap    []struct {
			ID    string `json:"id"`
			Grant struct {
				Type struct {
					Type int `json:"type"`
				} `json:"type"`
				ID         string `json:"id"`
				Email      string `json:"email"`
				Permission struct {
					Flags int `json:"flags"`
				} `json:"permission"`
				Name    string `json:"name"`
				Group   int    `json:"group"`
				URLSpec string `json:"url_spec"`
			} `json:"grant"`
		} `json:"grant_map"`
	} `json:"acl"`
	Owner struct {
		ID          string `json:"id"`
		DisplayName string `json:"display_name"`
	} `json:"owner"`
}

Policy struct

type Quota

type Quota struct {
	UID        string  `json:"user_id" url:"uid"`
	QuotaType  string  `url:"quota-type"`
	Enabled    *bool   `json:"enabled" url:"quota,enabled"`
	CheckOnRaw bool    `json:"check_on_raw"`
	MaxSize    *uint64 `json:"max_size" url:"max-size"`
	MaxSizeKb  *uint64 `json:"max_size_kb" url:"max-size-kb"`
	MaxObjects *uint64 `json:"max_objects" url:"max-objects"`
}

Quota struct

type Usage

type Usage struct {
	Entries []struct {
		User    string `json:"user"`
		Buckets []struct {
			Bucket     string `json:"bucket"`
			Time       string `json:"time"`
			Epoch      uint64 `json:"epoch"`
			Owner      string `json:"owner"`
			Categories []struct {
				Category      string `json:"category"`
				BytesSent     uint64 `json:"bytes_sent"`
				BytesReceived uint64 `json:"bytes_received"`
				Ops           uint64 `json:"ops"`
				SuccessfulOps uint64 `json:"successful_ops"`
			} `json:"categories"`
		} `json:"buckets"`
	} `json:"entries"`
	Summary []struct {
		User       string `json:"user"`
		Categories []struct {
			Category      string `json:"category"`
			BytesSent     uint64 `json:"bytes_sent"`
			BytesReceived uint64 `json:"bytes_received"`
			Ops           uint64 `json:"ops"`
			SuccessfulOps uint64 `json:"successful_ops"`
		} `json:"categories"`
		Total struct {
			BytesSent     uint64 `json:"bytes_sent"`
			BytesReceived uint64 `json:"bytes_received"`
			Ops           uint64 `json:"ops"`
			SuccessfulOps uint64 `json:"successful_ops"`
		} `json:"total"`
	} `json:"summary"`
	Start       string `url:"start"` //Example:	2012-09-25 16:00:00
	End         string `url:"end"`
	ShowEntries *bool  `url:"show-entries"`
	ShowSummary *bool  `url:"show-summary"`
	RemoveAll   *bool  `url:"remove-all"` //true
}

Usage struct

type User

type User struct {
	Tenant      string        `json:"tenant,omitempty" url:"tenant"`
	UID         string        `json:"user_id" url:"uid"`
	DisplayName string        `json:"display_name" url:"display-name"`
	Email       string        `json:"email" url:"email"`
	Suspended   *int          `json:"suspended" url:"suspended"`
	MaxBuckets  *int          `json:"max_buckets" url:"max-buckets"`
	Subusers    []interface{} `json:"subusers"`
	Keys        []Key         `json:"keys"`
	SwiftKeys   []interface{} `json:"swift_keys"`
	Caps        []Cap         `json:"caps"`
	PurgeData   *int          `url:"purge-data"`
	GenerateKey *bool         `url:"generate-key"`
}

User struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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