objectscale

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package objectscale implements custom server handlers for communication with Dell ObjectScale platform.

Index

Constants

View Source
const (
	CreateBucketTraceName       = "CreateBucketRequest"
	DeleteBucketTraceName       = "DeleteBucketRequest"
	GrantBucketAccessTraceName  = "GrantBucketAccessRequest"
	RevokeBucketAccessTraceName = "RevokeBucketAccessRequest"
)

Variables

View Source
var (
	ErrEmptyBucketName      = errors.New("empty bucket name")
	ErrFailedToCreateBucket = errors.New("failed to create bucket")
)

All errors that can be returned by DriverCreateBucket.

View Source
var (
	ErrEmptyBucketAccessName            = errors.New("empty bucket access name")
	ErrInvalidAuthenticationType        = errors.New("invalid authentication type")
	ErrUnknownAuthenticationType        = errors.New("unknown authentication type")
	ErrBucketNotFound                   = errors.New("bucket not found")
	ErrFailedToCreateUser               = errors.New("failed to create user")
	ErrFailedToDecodePolicy             = errors.New("failed to decode bucket policy")
	ErrFailedToUpdatePolicy             = errors.New("failed to update bucket policy")
	ErrFailedToCreateAccessKey          = errors.New("failed to create access key")
	ErrFailedToGeneratePolicyID         = errors.New("failed to generate PolicyID UUID")
	ErrGeneratedPolicyIDIsEmpty         = errors.New("generated PolicyID was empty")
	ErrAuthenticationTypeNotImplemented = errors.New("authentication type IAM not implemented")
)

All errors that can be returned by DriverGrantBucketAccess.

View Source
var (
	ErrEmptyAccountID             = errors.New("empty accountID")
	ErrExistingPolicyIsEmpty      = errors.New("existing policy is empty")
	ErrFailedToUpdateBucketPolicy = errors.New("failed to update bucket policy")
	ErrFailedToListAccessKeys     = errors.New("failed to list access keys")
	ErrFailedToDeleteAccessKey    = errors.New("failed to delete access key")
	ErrFailedToDeleteUser         = errors.New("failed to delete user")
)

All errors that can be returned by DriverRevokeBucketAccess.

View Source
var (
	WarnBucketNotFound = "Bucket not found."
	WarnUserNotFound   = "User not found."
)

All warnings that can be returned by DriverRevokeBucketAccess.

View Source
var (
	// ErrParameterNotFound is general instance of the model.Error with the CodeParameterNotFound.
	// It indicates that request parameter cannot be found - e.g. requested bucket does not exist.
	ErrParameterNotFound = model.Error{Code: model.CodeParameterNotFound}

	// ErrInternalException is general instance of the model.Error with the CodeInternalException.
	// It indicates that internal exception occurred, and user should look at ObjectScale logs to find the cause.
	ErrInternalException = model.Error{Code: model.CodeInternalException}
)
View Source
var (
	// All common errors that can be returned by
	// DriverCreateBucket, DriverDeleteBucket, DriverGrantBucketAccess, DriverRevokeBucketAccess.
	ErrInvalidBucketID           = errors.New("invalid bucketID")
	ErrFailedToCheckBucketExists = errors.New("failed to check bucket existence")
	ErrFailedToMarshalPolicy     = errors.New("failed to marshal policy into JSON")
	ErrFailedToCheckPolicyExists = errors.New("failed to check bucket policy existence")
	ErrFailedToCheckUserExists   = errors.New("failed to check for user existence")
	// ErrInvalidRequest is an edge case error, which should be returned when incoming request is not of type
	// DriverCreateBucket, DriverDeleteBucketRequest, DriverGrantBucketAccessRequest or DriverRevokeBucketAccessRequest.
	ErrInvalidRequest = errors.New("incoming request invalid")
)
View Source
var ErrFailedToDeleteBucket = errors.New("bucket was not successfully deleted")

All errors that can be returned by DriverDeleteBucket.

Functions

func BuildPrincipalString

func BuildPrincipalString(namespace, bucketName string) string

BuildPrincipalString constructs policy principal string.

func BuildResourceString

func BuildResourceString(objectScaleID, objectStoreID, bucketName string) string

BuildResourceString constructs policy resource string.

func BuildUsername

func BuildUsername(namespace, bucketName string) string

func GetBucketName

func GetBucketName(bucketID string) (string, error)

GetBucketName splits BucketID by -, the first element is backendID, the second element is bucketName.

Types

type Server

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

Server is implementation of driver.Driver interface for ObjectScale platform.

func New

func New(config *config.Objectscale) (*Server, error)

New initializes server based on the config file. TODO: verify if emptiness verification can be moved to a separate function.

func (*Server) DriverCreateBucket

func (s *Server) DriverCreateBucket(
	ctx context.Context,
	req *cosi.DriverCreateBucketRequest,
) (*cosi.DriverCreateBucketResponse, error)

DriverCreateBucket creates Bucket on specific Object Storage Platform.

func (*Server) DriverDeleteBucket

DriverDeleteBucket deletes Bucket on specific Object Storage Platform.

func (*Server) DriverGrantBucketAccess

DriverGrantBucketAccess provides access to Bucket on specific Object Storage Platform.

func (*Server) DriverRevokeBucketAccess

DriverRevokeBucketAccess revokes access from Bucket on specific Object Storage Platform.

func (*Server) ID

func (s *Server) ID() string

ID extends COSI interface by adding ID method.

Jump to

Keyboard shortcuts

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