ostor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: BSD-2-Clause Imports: 8 Imported by: 0

README

ostor

Package ostor wraps around the object storage management API provided by Virtuozzo Hybrid Infrastructure (VHI) and Acronis Cyber Infrastructure (ACI). You can use this as a library if you wish.

In order to use this code, you need to provision a system user account, to create one, follow the links below.

Further reading:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemCountersNet

type ItemCountersNet struct {
	Uploaded   int `json:"uploaded"`
	Downloaded int `json:"downloaded"`
}

type ItemCountersOps

type ItemCountersOps struct {
	Put   int `json:"put"`
	Get   int `json:"get"`
	List  int `json:"list"`
	Other int `json:"other"`
}

type ItemKey

type ItemKey struct {
	Bucket string `json:"bucket"`
	Epoch  int    `json:"epoch"`
	UserID string `json:"user_id"`
	Tag    string `json:"tag"`
}

type OStorObjectUsageResponse

type OStorObjectUsageResponse struct {
	Version   int    `json:"fmt_version"`
	ServiceID string `json:"service_id"`
	StartTS   int    `json:"start_ts"`
	Period    int    `json:"period"`
	Count     int    `json:"nr_items"`
	Items     []struct {
		Key      ItemKey `json:"key"`
		Counters struct {
			Operations ItemCountersOps `json:"ops"`
			Net        ItemCountersNet `json:"net_io"`
		} `json:"counters"`
	} `json:"items"`
}

type OStorResponse

type OStorResponse struct {
	Count     int      `json:"nr_items"`
	Truncated bool     `json:"truncated"`
	Items     []string `json:"items"`
}

type Ostor

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

func New

func New(endpoint, accessKeyID, secretKeyID string) (*Ostor, error)

func (*Ostor) CreateUser added in v0.2.0

func (o *Ostor) CreateUser(email string) error

func (*Ostor) GenerateCredentials

func (o *Ostor) GenerateCredentials(email string) (*resty.Response, error)

func (*Ostor) GetBuckets

func (o *Ostor) GetBuckets(email string) (*OstorBucketListResponse, error)

func (*Ostor) GetUser

func (o *Ostor) GetUser(email string) (*OstorUser, error)

func (*Ostor) List

func (o *Ostor) List(after *string) (*OStorResponse, error)

func (*Ostor) ListUsers

func (o *Ostor) ListUsers() (*OstorUsersListResponse, error)

func (*Ostor) ObjectUsage

func (o *Ostor) ObjectUsage(object string) (*OStorObjectUsageResponse, error)

func (*Ostor) RevokeKey

func (o *Ostor) RevokeKey(email, accessKeyID string) (*resty.Response, error)

type OstorBucketListResponse

type OstorBucketListResponse struct {
	Buckets []struct {
		Name      string `json:"name"`
		Epoch     int    `json:"epoc"`
		CreatedAt string `json:"creation_date"`
		OwnerID   string `json:"owner_id"`
		Size      struct {
			Current   int `json:"current"`
			HMax      int `json:"hmax"`
			HIntegral int `json:"h_integral"`
			LastTS    int `json:"last_ts"`
		} `json:"size"`
	}
}

type OstorUser

type OstorUser struct {
	Email      string   `json:"UserEmail"`
	ID         string   `json:"UserId"`
	State      string   `json:"State"`
	Owner      string   `json:OwnerId"`
	Flags      []string `json:"Flags"`
	AccessKeys []struct {
		KeyID       string `json:"AWSAccessKeyId"`
		SecretKeyID string `json:"AWSSecretAccessKey"`
	} `json:"AWSAccessKeys,omitempty"`
	AccountCount string        `json:"AccountCount,omitempty"`
	Accounts     []interface{} `json:"Accounts",omitempty`
}

type OstorUsersListResponse

type OstorUsersListResponse struct {
	Users []OstorUser `json:"users"`
}

Jump to

Keyboard shortcuts

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