ceph

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2019 The OpenSDS Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019 The OpenSDS Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	KPoolName           = "CephPoolName"
	KImageName          = "CephImageName"
	SnapshotCloudBucket = "bucket"
)

Variables

This section is empty.

Functions

func EncodeName added in v0.5.0

func EncodeName(id string) string

Types

type CephConfig

type CephConfig struct {
	ConfigFile string                    `yaml:"configFile,omitempty"`
	Pool       map[string]PoolProperties `yaml:"pool,flow"`
}

type CephMetricStats added in v0.5.3

type CephMetricStats struct {
	Name        string
	Value       string
	Unit        string
	Const_Label map[string]string
	AggrType    string
	Var_Label   map[string]string
	Component   string
}

type Conn added in v0.5.3

type Conn interface {
	ReadDefaultConfigFile() error
	Connect() error
	GetFSID() (fsid string, err error)
	Shutdown()
	MonCommand([]byte) ([]byte, string, error)
}

type DfInfo added in v0.5.0

type DfInfo struct {
	Stats TotalStats  `json:"stats,omitempty"`
	Pools []PoolStats `json:"pools,omitempty"`
}

type Driver

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

func (*Driver) CreateSnapshot

func (d *Driver) CreateSnapshot(opt *pb.CreateVolumeSnapshotOpts) (*model.VolumeSnapshotSpec, error)

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(opt *pb.CreateVolumeOpts) (*model.VolumeSpec, error)

func (*Driver) CreateVolumeGroup added in v0.1.8

func (d *Driver) CreateVolumeGroup(opt *pb.CreateVolumeGroupOpts) (*model.VolumeGroupSpec, error)

func (*Driver) DeleteSnapshot

func (d *Driver) DeleteSnapshot(opt *pb.DeleteVolumeSnapshotOpts) error

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(opt *pb.DeleteVolumeOpts) error

func (*Driver) DeleteVolumeGroup added in v0.1.8

func (d *Driver) DeleteVolumeGroup(opt *pb.DeleteVolumeGroupOpts) error

func (*Driver) ExtendVolume added in v0.1.1

func (d *Driver) ExtendVolume(opt *pb.ExtendVolumeOpts) (*model.VolumeSpec, error)

ExtendVolume ...

func (*Driver) InitializeConnection

func (d *Driver) InitializeConnection(opt *pb.CreateVolumeAttachmentOpts) (*model.ConnectionInfo, error)

func (*Driver) InitializeSnapshotConnection added in v0.3.2

func (d *Driver) InitializeSnapshotConnection(opt *pb.CreateSnapshotAttachmentOpts) (*model.ConnectionInfo, error)

func (*Driver) ListPools

func (d *Driver) ListPools() ([]*model.StoragePoolSpec, error)

func (*Driver) PullSnapshot

func (d *Driver) PullSnapshot(snapID string) (*model.VolumeSnapshotSpec, error)

func (*Driver) PullVolume

func (d *Driver) PullVolume(volID string) (*model.VolumeSpec, error)

func (*Driver) Setup

func (d *Driver) Setup() error

func (*Driver) TerminateConnection

func (d *Driver) TerminateConnection(opt *pb.DeleteVolumeAttachmentOpts) error

func (*Driver) TerminateSnapshotConnection added in v0.3.2

func (d *Driver) TerminateSnapshotConnection(opt *pb.DeleteSnapshotAttachmentOpts) error

func (*Driver) Unset

func (d *Driver) Unset() error

func (*Driver) UpdateVolumeGroup added in v0.1.8

func (d *Driver) UpdateVolumeGroup(opt *pb.UpdateVolumeGroupOpts) (*model.VolumeGroupSpec, error)

type MetricCli added in v0.5.3

type MetricCli struct {
	RootExecuter exec.Executer
	// contains filtered or unexported fields
}

func NewMetricCli added in v0.5.3

func NewMetricCli() (*MetricCli, error)

func (*MetricCli) CollectClusterMetrics added in v0.5.3

func (cli *MetricCli) CollectClusterMetrics() ([]CephMetricStats, error)

func (*MetricCli) CollectHealthMetrics added in v0.5.3

func (cli *MetricCli) CollectHealthMetrics() ([]CephMetricStats, error)

func (*MetricCli) CollectMetrics added in v0.5.3

func (cli *MetricCli) CollectMetrics() ([]CephMetricStats, []string, error)

func (*MetricCli) CollectMonitorsMetrics added in v0.5.3

func (cli *MetricCli) CollectMonitorsMetrics() ([]CephMetricStats, error)

func (*MetricCli) CollectOsddfMetrics added in v0.5.3

func (cli *MetricCli) CollectOsddfMetrics() ([]CephMetricStats, error)

func (*MetricCli) CollectOsddumpMetrics added in v0.5.3

func (cli *MetricCli) CollectOsddumpMetrics() ([]CephMetricStats, error)

func (*MetricCli) CollectPerfMetrics added in v0.5.3

func (cli *MetricCli) CollectPerfMetrics() ([]CephMetricStats, error)

func (*MetricCli) CollectPoolMetrics added in v0.5.3

func (cli *MetricCli) CollectPoolMetrics() ([]CephMetricStats, error)

func (*MetricCli) CollectVolumeMetrics added in v0.5.4

func (cli *MetricCli) CollectVolumeMetrics() ([]CephMetricStats, error)

type MetricDriver added in v0.5.3

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

func (*MetricDriver) CollectMetrics added in v0.5.3

func (d *MetricDriver) CollectMetrics() ([]*model.MetricSpec, error)

func (*MetricDriver) Setup added in v0.5.3

func (d *MetricDriver) Setup() error

func (*MetricDriver) Teardown added in v0.5.3

func (d *MetricDriver) Teardown() error

type PoolStats added in v0.5.0

type PoolStats struct {
	Name  string `json:"name,omitempty"`
	Id    int64  `json:"id,omitempty"`
	Stats struct {
		KbUsed      int64 `json:"kb_used,omitempty"`
		BytesUsed   int64 `json:"bytes_used,omitempty"`
		PercentUsed int64 `json:"percent_used,omitempty"`
		MaxAvail    int64 `json:"max_avail,omitempty"`
		Objects     int64 `json:"objects,omitempty"`
	} `json:"stats,omitempty"`
}

type SrcMgr added in v0.5.0

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

func NewSrcMgr added in v0.5.0

func NewSrcMgr(conf *CephConfig) *SrcMgr

func (*SrcMgr) GetConn added in v0.5.0

func (s *SrcMgr) GetConn() (*rados.Conn, error)

func (*SrcMgr) GetIoctx added in v0.5.0

func (s *SrcMgr) GetIoctx(poolName string) (*rados.IOContext, error)

func (*SrcMgr) GetOriginImage added in v0.5.3

func (s *SrcMgr) GetOriginImage(poolName string, imgName string, args ...interface{}) (*rbd.Image, error)

this function only used for open origin image rather than clone image or copy image

type TotalStats added in v0.5.0

type TotalStats struct {
	TotalBytes      int64 `json:"total_bytes,omitempty"`
	TotalUsedBytes  int64 `json:"total_used_bytes,omitempty"`
	TotalAvailBytes int64 `json:"total_avail_bytes,omitempty"`
}

Jump to

Keyboard shortcuts

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