openstack

package
v0.0.0-...-e7d1ed3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOpenstackClient

func NewOpenstackClient(cfg *Config) (*gophercloud.ProviderClient, error)

Types

type BlockStorage

type BlockStorage struct {
	AuthStrategy          string `ini:"auth-strategy"`
	CinderListenAddr      string `ini:"cinder-listen-addr"`
	NodeVolumeAttachLimit int64  `ini:"node-volume-attach-limit"`
}

type Config

type Config struct {
	Global
	BlockStorage
}

type EndpointOpts

type EndpointOpts struct {
	Region       string
	Availability gophercloud.Availability
}

type Global

type Global struct {
	AuthUrl           string                   `ini:"auth-url"`
	Username          string                   `ini:"username"`
	Password          string                   `ini:"password"`
	UserDomainName    string                   `ini:"user-domain-name"`
	ProjectDomainName string                   `ini:"project-domain-name"`
	ProjectName       string                   `ini:"project-name"`
	TenantName        string                   `ini:"tenant-name"`
	RegionName        string                   `ini:"region-name"`
	EndpointType      gophercloud.Availability `ini:"endpoint-type"`
}

type IOpenstack

type IOpenstack interface {
	CreateVolume(name, zone, volType, snapshotID, sourceVolID string, size int) (*volumes.Volume, error)
	DeleteVolume(volumeID string) error
	AttachVolume(volumeID, mountPoint, hostName string) error
	DetachVolume(volumeID string) error
	GetVolumeByName(volumeName string) ([]volumes.Volume, error)
	GetVolumeByID(volumeID string) (*volumes.Volume, error)
	GetAvailability() (string, error)
	ListVolume(maxLimit int32, marker string) ([]volumes.Volume, string, error)
	CreateSnapShot(name string, sourceVolumeID string) (*snapshots.Snapshot, error)
	DeleteSnapshot(snapshotID string) error
	ListSnapshot(filter map[string]string) ([]snapshots.Snapshot, string, error)
	GetSnapshotByID(snapshotID string) (*snapshots.Snapshot, error)
	ExpandVolume(volumeID string, status string, size int) error
	GetBsOpts() BlockStorage
	CheckBlockStorageAPI() error
	GetMaxVolumeLimit() int64
	CreateVolumeAttachment(volumeID, instanceID string) (*attachments.Attachment, error)
	GetVolumeAttachment(attachmentID string) (*attachments.Attachment, error)
	DeleteVolumeAttachment(volumeID string) error
	VolumeAttachmentComplete(attachmentID string) error
	GetAttachmentByVolumeID(volumeID string) (*attachments.Attachment, error)
}

func CreateOpenstackClient

func CreateOpenstackClient(cloudConf string) (IOpenstack, error)

type Openstack

type Openstack struct {
	BlockStorageClient *gophercloud.ServiceClient
	EsOpts             gophercloud.EndpointOpts
	BsOpts             BlockStorage
}

func (*Openstack) AttachVolume

func (op *Openstack) AttachVolume(volumeID, mountPoint, hostName string) error

func (*Openstack) CheckBlockStorageAPI

func (op *Openstack) CheckBlockStorageAPI() error

func (*Openstack) CreateSnapShot

func (op *Openstack) CreateSnapShot(name string, sourceVolumeID string) (*snapshots.Snapshot, error)

func (*Openstack) CreateVolume

func (op *Openstack) CreateVolume(name, zone, volType, snapshotID, sourceVolID string, size int) (*volumes.Volume, error)

func (*Openstack) CreateVolumeAttachment

func (op *Openstack) CreateVolumeAttachment(volumeID, instanceID string) (*attachments.Attachment, error)

func (*Openstack) DeleteSnapshot

func (op *Openstack) DeleteSnapshot(snapshotID string) error

func (*Openstack) DeleteVolume

func (op *Openstack) DeleteVolume(volumeID string) error

func (*Openstack) DeleteVolumeAttachment

func (op *Openstack) DeleteVolumeAttachment(volumeID string) error

func (*Openstack) DetachVolume

func (op *Openstack) DetachVolume(volumeID string) error

func (*Openstack) ExpandVolume

func (op *Openstack) ExpandVolume(volumeID string, status string, size int) error

func (*Openstack) GetAttachmentByVolumeID

func (op *Openstack) GetAttachmentByVolumeID(volumeID string) (*attachments.Attachment, error)

func (*Openstack) GetAvailability

func (op *Openstack) GetAvailability() (string, error)

func (*Openstack) GetBsOpts

func (op *Openstack) GetBsOpts() BlockStorage

func (*Openstack) GetMaxVolumeLimit

func (op *Openstack) GetMaxVolumeLimit() int64

func (*Openstack) GetSnapshotByID

func (op *Openstack) GetSnapshotByID(snapshotID string) (*snapshots.Snapshot, error)

func (*Openstack) GetVolumeAttachment

func (op *Openstack) GetVolumeAttachment(attachmentID string) (*attachments.Attachment, error)

func (*Openstack) GetVolumeByID

func (op *Openstack) GetVolumeByID(volumeID string) (*volumes.Volume, error)

func (*Openstack) GetVolumeByName

func (op *Openstack) GetVolumeByName(volumeName string) ([]volumes.Volume, error)

func (*Openstack) ListSnapshot

func (op *Openstack) ListSnapshot(filter map[string]string) ([]snapshots.Snapshot, string, error)

func (*Openstack) ListVolume

func (op *Openstack) ListVolume(maxLimit int32, marker string) ([]volumes.Volume, string, error)

func (*Openstack) VolumeAttachmentComplete

func (op *Openstack) VolumeAttachmentComplete(attachmentID string) error

Jump to

Keyboard shortcuts

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