cinder

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const QuotaGetAllWithUsage = `` /* 300-byte string literal not displayed */
View Source
const QuotaGetProjectLimits = `` /* 229-byte string literal not displayed */
View Source
const QuotaUsageGetAll = `` /* 196-byte string literal not displayed */
View Source
const ServiceGetAll = `-- name: ServiceGetAll :many
SELECT
    uuid,
    host,
    ` + "`" + `binary` + "`" + ` as service,
    CASE
        WHEN disabled = 1 THEN 'disabled'
        ELSE 'enabled'
    END as admin_state,
    availability_zone as zone,
    disabled_reason,
    CASE
        WHEN TIMESTAMPDIFF (SECOND, updated_at, NOW()) <= 60 THEN 1
        ELSE 0
    END as state
FROM
    services
WHERE
    deleted = 0
`
View Source
const SnapshotCount = `-- name: SnapshotCount :one
SELECT
    COUNT(*) as count
FROM
    snapshots
WHERE
    deleted = 0
`
View Source
const VolumeGetAll = `` /* 135-byte string literal not displayed */
View Source
const VolumeGetAllWithAttachments = `` /* 528-byte string literal not displayed */
View Source
const VolumeTypeGetAll = `-- name: VolumeTypeGetAll :many
SELECT
    id,
    name
FROM
    volume_types
WHERE
    deleted = 0
`

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) QuotaGetAllWithUsage

func (q *Queries) QuotaGetAllWithUsage(ctx context.Context) ([]QuotaGetAllWithUsageRow, error)

func (*Queries) QuotaGetProjectLimits

func (q *Queries) QuotaGetProjectLimits(ctx context.Context) ([]QuotaGetProjectLimitsRow, error)

func (*Queries) QuotaUsageGetAll

func (q *Queries) QuotaUsageGetAll(ctx context.Context) ([]QuotaUsageGetAllRow, error)

func (*Queries) ServiceGetAll

func (q *Queries) ServiceGetAll(ctx context.Context) ([]ServiceGetAllRow, error)

func (*Queries) SnapshotCount

func (q *Queries) SnapshotCount(ctx context.Context) (int64, error)

func (*Queries) VolumeGet

func (q *Queries) VolumeGet(ctx context.Context, id string) (VolumeGetAllRow, error)

VolumeGet returns one undeleted resource, or sql.ErrNoRows when absent.

func (*Queries) VolumeGetAll

func (q *Queries) VolumeGetAll(ctx context.Context) ([]VolumeGetAllRow, error)

func (*Queries) VolumeGetAllByFilters

func (q *Queries) VolumeGetAllByFilters(ctx context.Context, f VolumeFilters) ([]VolumeGetAllRow, error)

VolumeGetAllByFilters returns the resource projection for matching database records. It does not perform OpenStack authorization, cell discovery, or archive searches.

func (*Queries) VolumeGetAllWithAttachments

func (q *Queries) VolumeGetAllWithAttachments(ctx context.Context) ([]VolumeGetAllWithAttachmentsRow, error)

func (*Queries) VolumeTypeGetAll

func (q *Queries) VolumeTypeGetAll(ctx context.Context) ([]VolumeTypeGetAllRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Quota

type Quota struct {
	ID        int32
	CreatedAt sql.NullTime
	UpdatedAt sql.NullTime
	DeletedAt sql.NullTime
	Deleted   sql.NullBool
	ProjectID sql.NullString
	Resource  string
	HardLimit sql.NullInt32
	Allocated sql.NullInt32
}

type QuotaGetAllWithUsageRow

type QuotaGetAllWithUsageRow struct {
	ProjectID sql.NullString
	Resource  string
	HardLimit sql.NullInt32
	InUse     int32
}

type QuotaGetProjectLimitsRow

type QuotaGetProjectLimitsRow struct {
	ProjectID sql.NullString
	Resource  string
	HardLimit sql.NullInt32
}

type QuotaUsage

type QuotaUsage struct {
	CreatedAt     sql.NullTime
	UpdatedAt     sql.NullTime
	DeletedAt     sql.NullTime
	Deleted       sql.NullBool
	ID            int32
	ProjectID     sql.NullString
	Resource      sql.NullString
	InUse         int32
	Reserved      int32
	UntilRefresh  sql.NullInt32
	RacePreventer sql.NullBool
}

type QuotaUsageGetAllRow

type QuotaUsageGetAllRow struct {
	ProjectID sql.NullString
	Resource  sql.NullString
	InUse     int32
}

type Service

type Service struct {
	CreatedAt            sql.NullTime
	UpdatedAt            sql.NullTime
	DeletedAt            sql.NullTime
	Deleted              sql.NullBool
	ID                   int32
	Host                 sql.NullString
	Binary               sql.NullString
	Topic                sql.NullString
	ReportCount          int32
	Disabled             sql.NullBool
	AvailabilityZone     sql.NullString
	DisabledReason       sql.NullString
	ModifiedAt           sql.NullTime
	RpcCurrentVersion    sql.NullString
	ObjectCurrentVersion sql.NullString
	ReplicationStatus    sql.NullString
	Frozen               sql.NullBool
	ActiveBackendID      sql.NullString
	ClusterName          sql.NullString
	Uuid                 sql.NullString
}

type ServiceGetAllRow

type ServiceGetAllRow struct {
	Uuid           sql.NullString
	Host           sql.NullString
	Service        sql.NullString
	AdminState     string
	Zone           sql.NullString
	DisabledReason sql.NullString
	State          int32
}

type Snapshot

type Snapshot struct {
	CreatedAt          sql.NullTime
	UpdatedAt          sql.NullTime
	DeletedAt          sql.NullTime
	Deleted            sql.NullBool
	ID                 string
	VolumeID           string
	UserID             sql.NullString
	ProjectID          sql.NullString
	Status             sql.NullString
	Progress           sql.NullString
	VolumeSize         sql.NullInt32
	ScheduledAt        sql.NullTime
	DisplayName        sql.NullString
	DisplayDescription sql.NullString
	ProviderLocation   sql.NullString
	EncryptionKeyID    sql.NullString
	VolumeTypeID       string
	CgsnapshotID       sql.NullString
	ProviderID         sql.NullString
	ProviderAuth       sql.NullString
	GroupSnapshotID    sql.NullString
	UseQuota           bool
}

type Volume

type Volume struct {
	CreatedAt                 sql.NullTime
	UpdatedAt                 sql.NullTime
	DeletedAt                 sql.NullTime
	Deleted                   sql.NullBool
	ID                        string
	Ec2ID                     sql.NullString
	UserID                    sql.NullString
	ProjectID                 sql.NullString
	Host                      sql.NullString
	Size                      sql.NullInt32
	AvailabilityZone          sql.NullString
	Status                    sql.NullString
	AttachStatus              sql.NullString
	ScheduledAt               sql.NullTime
	LaunchedAt                sql.NullTime
	TerminatedAt              sql.NullTime
	DisplayName               sql.NullString
	DisplayDescription        sql.NullString
	ProviderLocation          sql.NullString
	ProviderAuth              sql.NullString
	SnapshotID                sql.NullString
	VolumeTypeID              string
	SourceVolid               sql.NullString
	Bootable                  sql.NullBool
	ProviderGeometry          sql.NullString
	NameID                    sql.NullString
	EncryptionKeyID           sql.NullString
	MigrationStatus           sql.NullString
	ReplicationStatus         sql.NullString
	ReplicationExtendedStatus sql.NullString
	ReplicationDriverData     sql.NullString
	ConsistencygroupID        sql.NullString
	ProviderID                sql.NullString
	Multiattach               sql.NullBool
	PreviousStatus            sql.NullString
	ClusterName               sql.NullString
	GroupID                   sql.NullString
	ServiceUuid               sql.NullString
	SharedTargets             sql.NullBool
	UseQuota                  bool
}

type VolumeAttachment

type VolumeAttachment struct {
	CreatedAt      sql.NullTime
	UpdatedAt      sql.NullTime
	DeletedAt      sql.NullTime
	Deleted        sql.NullBool
	ID             string
	VolumeID       string
	AttachedHost   sql.NullString
	InstanceUuid   sql.NullString
	Mountpoint     sql.NullString
	AttachTime     sql.NullTime
	DetachTime     sql.NullTime
	AttachMode     sql.NullString
	AttachStatus   sql.NullString
	ConnectionInfo sql.NullString
	Connector      sql.NullString
}

type VolumeFilters

type VolumeFilters struct {
	IDs           []string
	ProjectIDs    []string
	Statuses      []string
	VolumeTypeIDs []string
	Deleted       db.Deleted
	CreatedBefore time.Time
	DeletedAfter  time.Time
}

VolumeFilters combines exact-match filters with AND. Values within a slice use OR. Nil slices are unrestricted; non-nil empty slices match no records. CreatedBefore and DeletedAfter form an optional half-open lifetime window. The zero deletion policy excludes soft-deleted records.

type VolumeGetAllRow

type VolumeGetAllRow struct {
	ID           string
	ProjectID    sql.NullString
	Size         sql.NullInt32
	VolumeTypeID string
	Status       sql.NullString
	CreatedAt    sql.NullTime
	DeletedAt    sql.NullTime
}

type VolumeGetAllWithAttachmentsRow

type VolumeGetAllWithAttachmentsRow struct {
	ID               string
	Name             sql.NullString
	Size             sql.NullInt32
	Status           sql.NullString
	AvailabilityZone sql.NullString
	Bootable         sql.NullBool
	ProjectID        sql.NullString
	UserID           sql.NullString
	VolumeType       sql.NullString
	ServerID         sql.NullString
}

type VolumeType

type VolumeType struct {
	CreatedAt   sql.NullTime
	UpdatedAt   sql.NullTime
	DeletedAt   sql.NullTime
	Deleted     sql.NullBool
	ID          string
	Name        sql.NullString
	QosSpecsID  sql.NullString
	IsPublic    sql.NullBool
	Description sql.NullString
}

type VolumeTypeGetAllRow

type VolumeTypeGetAllRow struct {
	ID   string
	Name sql.NullString
}

Jump to

Keyboard shortcuts

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