cinder

package
v0.0.0-...-618022f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logic

type Logic struct {
	// configuration
	WithSubcapacities        bool `json:"with_subcapacities"`
	WithVolumeSubresources   bool `json:"with_volume_subresources"`
	WithSnapshotSubresources bool `json:"with_snapshot_subresources"`
	// connections
	CinderV3 *gophercloud.ServiceClient `json:"-"`
	// state
	VolumeTypes liquidapi.State[map[VolumeType]VolumeTypeInfo] `json:"-"`
}

func (*Logic) BuildServiceInfo

func (l *Logic) BuildServiceInfo(ctx context.Context) (liquid.ServiceInfo, error)

BuildServiceInfo implements the liquidapi.Logic interface.

func (*Logic) Init

func (l *Logic) Init(ctx context.Context, provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (err error)

Init implements the liquidapi.Logic interface.

func (*Logic) ScanCapacity

ScanCapacity implements the liquidapi.Logic interface.

func (*Logic) ScanUsage

func (l *Logic) ScanUsage(ctx context.Context, projectUUID string, req liquid.ServiceUsageRequest, serviceInfo liquid.ServiceInfo) (liquid.ServiceUsageReport, error)

ScanUsage implements the liquidapi.Logic interface.

func (*Logic) SetQuota

func (l *Logic) SetQuota(ctx context.Context, projectUUID string, req liquid.ServiceQuotaRequest, serviceInfo liquid.ServiceInfo) error

SetQuota implements the liquidapi.Logic interface.

type QuotaSetField

type QuotaSetField struct {
	Quota int64
	Usage uint64
}

func (QuotaSetField) ToResourceReport

func (f QuotaSetField) ToResourceReport(allAZs []liquid.AvailabilityZone) *liquid.ResourceUsageReport

func (*QuotaSetField) UnmarshalJSON

func (f *QuotaSetField) UnmarshalJSON(buf []byte) error

type SnapshotAttributes

type SnapshotAttributes struct {
	SizeGiB  uint64 `json:"size_gib"`
	Status   string `json:"status"`
	VolumeID string `json:"volume_id"`
}

SnapshotAttributes is the Attributes payload for a Cinder snapshot subresource.

type StoragePool

type StoragePool struct {
	Name         string `json:"name"`
	Capabilities struct {
		VolumeBackendName   string                          `json:"volume_backend_name"`
		TotalCapacityGB     liquids.Float64WithStringErrors `json:"total_capacity_gb"`
		AllocatedCapacityGB liquids.Float64WithStringErrors `json:"allocated_capacity_gb"`
		StorageProtocol     string                          `json:"storage_protocol"`
		QualityType         string                          `json:"quality_type"`

		// SAP Converged Cloud extension
		CustomAttributes struct {
			CinderState string `json:"cinder_state"`
		} `json:"custom_attributes"`
	} `json:"capabilities"`
}

StoragePool is a custom deserialization target type that replaces type schedulerstats.StoragePool.

type StoragePoolAttributes

type StoragePoolAttributes struct {
	ExclusionReason string `json:"exclusion_reason,omitempty"`
	// Only set when ExclusionReason is set.
	RealCapacity uint64 `json:"real_capacity,omitempty"`
}

StoragePoolAttributes is the Attributes payload type for a Cinder subcapacity.

type VolumeAttributes

type VolumeAttributes struct {
	SizeGiB uint64 `json:"size_gib"`
	Status  string `json:"status"`
}

VolumeAttributes is the Attributes payload for a Cinder volume subresource.

type VolumePlacement

type VolumePlacement struct {
	VolumeType       VolumeType
	AvailabilityZone liquid.AvailabilityZone
}

type VolumeType

type VolumeType string

VolumeType is a type with convenience functions for deriving resource names.

func (VolumeType) CapacityQuotaName

func (vt VolumeType) CapacityQuotaName() string

func (VolumeType) CapacityResourceName

func (vt VolumeType) CapacityResourceName() liquid.ResourceName

func (VolumeType) SnapshotsQuotaName

func (vt VolumeType) SnapshotsQuotaName() string

func (VolumeType) SnapshotsResourceName

func (vt VolumeType) SnapshotsResourceName() liquid.ResourceName

func (VolumeType) VolumesQuotaName

func (vt VolumeType) VolumesQuotaName() string

func (VolumeType) VolumesResourceName

func (vt VolumeType) VolumesResourceName() liquid.ResourceName

type VolumeTypeInfo

type VolumeTypeInfo struct {
	VolumeBackendName string
	StorageProtocol   string
	QualityType       string
}

func (VolumeTypeInfo) String

func (i VolumeTypeInfo) String() string

String returns a string representation of this VolumeTypeInfo for log messages.

Jump to

Keyboard shortcuts

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