object

package
v0.0.0-...-3f1f3ec Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package object for the Ceph object store.

Index

Constants

View Source
const (
	RGWErrorNone = iota
	RGWErrorUnknown
	RGWErrorNotFound
	RGWErrorBadData
	RGWErrorParse
)
View Source
const (

	// AppName is the name Rook uses for the object store's application
	AppName = "rook-ceph-rgw"
)

Variables

View Source
var ObjectStoreResource = opkit.CustomResource{
	Name:    "cephobjectstore",
	Plural:  "cephobjectstores",
	Group:   cephv1.CustomResourceGroup,
	Version: cephv1.Version,
	Scope:   apiextensionsv1beta1.NamespaceScoped,
	Kind:    reflect.TypeOf(cephv1.CephObjectStore{}).Name(),
}

ObjectStoreResource represents the object store custom resource

Functions

func DeleteBucket

func DeleteBucket(c *Context, bucketName string, purge bool) (int, error)

func DeleteUser

func DeleteUser(c *Context, id string, opts ...string) (string, int, error)

DeleteUser deletes the user with the given ID.

func GetBucketsStats

func GetBucketsStats(c *Context) (map[string]ObjectBucketStats, error)

func LinkUser

func LinkUser(c *Context, id, bucket string) (string, int, error)

func ListUsers

func ListUsers(c *Context) ([]string, int, error)

ListUsers lists the object pool users.

func SetQuotaUserBucketMax

func SetQuotaUserBucketMax(c *Context, id string, max int) (string, int, error)

func UnlinkUser

func UnlinkUser(c *Context, id, bucket string) (string, int, error)

Types

type Context

type Context struct {
	Context     *clusterd.Context
	Name        string
	ClusterName string
}

Context holds the context for the object store.

func NewContext

func NewContext(context *clusterd.Context, name, clusterName string) *Context

NewContext creates a new object store context.

type ObjectBucket

type ObjectBucket struct {
	Name string `json:"name"`
	ObjectBucketMetadata
	ObjectBucketStats
}

func GetBucket

func GetBucket(c *Context, bucket string) (*ObjectBucket, int, error)

func ListBuckets

func ListBuckets(c *Context) ([]ObjectBucket, error)

type ObjectBucketMetadata

type ObjectBucketMetadata struct {
	Owner     string    `json:"owner"`
	CreatedAt time.Time `json:"createdAt"`
}

type ObjectBucketStats

type ObjectBucketStats struct {
	Size            uint64 `json:"size"`
	NumberOfObjects uint64 `json:"numberOfObjects"`
}

func GetBucketStats

func GetBucketStats(c *Context, bucketName string) (*ObjectBucketStats, bool, error)

type ObjectBuckets

type ObjectBuckets []ObjectBucket

func (ObjectBuckets) Len

func (slice ObjectBuckets) Len() int

func (ObjectBuckets) Less

func (slice ObjectBuckets) Less(i, j int) bool

func (ObjectBuckets) Swap

func (slice ObjectBuckets) Swap(i, j int)

type ObjectStoreController

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

ObjectStoreController represents a controller object for object store custom resources

func NewObjectStoreController

func NewObjectStoreController(
	clusterInfo *daemonconfig.ClusterInfo,
	context *clusterd.Context,
	namespace string,
	rookImage string,
	clusterSpec *cephv1.ClusterSpec,
	ownerRef metav1.OwnerReference,
	dataDirHostPath string,
	isUpgrade bool,
) *ObjectStoreController

NewObjectStoreController create controller for watching object store custom resources created

func (*ObjectStoreController) ParentClusterChanged

func (c *ObjectStoreController) ParentClusterChanged(cluster cephv1.ClusterSpec, clusterInfo *daemonconfig.ClusterInfo, isUpgrade bool)

ParentClusterChanged determines wether or not a CR update has been sent

func (*ObjectStoreController) StartWatch

func (c *ObjectStoreController) StartWatch(namespace string, stopCh chan struct{}) error

StartWatch watches for instances of ObjectStore custom resources and acts on them

type ObjectUser

type ObjectUser struct {
	UserID      string  `json:"userId"`
	DisplayName *string `json:"displayName"`
	Email       *string `json:"email"`
	AccessKey   *string `json:"accessKey"`
	SecretKey   *string `json:"secretKey"`
}

An ObjectUser defines the details of an object store user.

func CreateUser

func CreateUser(c *Context, user ObjectUser) (*ObjectUser, int, error)

CreateUser creates a new user with the information given.

func GetUser

func GetUser(c *Context, id string) (*ObjectUser, int, error)

GetUser returns the user with the given ID.

func UpdateUser

func UpdateUser(c *Context, user ObjectUser) (*ObjectUser, int, error)

UpdateUser updates the user whose ID matches the user.

Directories

Path Synopsis
Package objectuser to manage a rook object store user.
Package objectuser to manage a rook object store user.

Jump to

Keyboard shortcuts

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