forked from canonical/microceph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Peter Sabaini <[email protected]>
- Loading branch information
Showing
6 changed files
with
427 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 22 additions & 22 deletions
44
microceph/database/diskpath.go → microceph/database/disk.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
package database | ||
|
||
//go:generate -command mapper lxd-generate db mapper -t diskpath.mapper.go | ||
//go:generate -command mapper lxd-generate db mapper -t disk.mapper.go | ||
//go:generate mapper reset | ||
// | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e DiskPath objects table=diskpaths | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e DiskPath objects-by-Member table=diskpaths | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e DiskPath objects-by-Member-and-Path table=diskpaths | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e DiskPath id table=diskpaths | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e DiskPath create table=diskpaths | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e DiskPath delete-by-Member table=diskpaths | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e DiskPath delete-by-Member-and-Path table=diskpaths | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e DiskPath update table=diskpaths | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e Disk objects table=Disks | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e Disk objects-by-Member table=Disks | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e Disk objects-by-Member-and-Path table=Disks | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e Disk id table=Disks | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e Disk create table=Disks | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e Disk delete-by-Member table=Disks | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e Disk delete-by-Member-and-Path table=Disks | ||
//go:generate mapper stmt -d github.com/canonical/microcluster/cluster -e Disk update table=Disks | ||
// | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e DiskPath GetMany | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e DiskPath GetOne | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e DiskPath ID | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e DiskPath Exists | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e DiskPath Create | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e DiskPath DeleteOne-by-Member-and-Path | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e DiskPath DeleteMany-by-Member | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e DiskPath Update | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e Disk GetMany | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e Disk GetOne | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e Disk ID | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e Disk Exists | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e Disk Create | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e Disk DeleteOne-by-Member-and-Path | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e Disk DeleteMany-by-Member | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/cluster -e Disk Update | ||
|
||
// DiskPath is used to track the Ceph disks on a particular server. | ||
type DiskPath struct { | ||
// Disk is used to track the Ceph disks on a particular server. | ||
type Disk struct { | ||
ID int | ||
Member string `db:"primary=yes&join=internal_cluster_members.name&joinon=diskpaths.member_id"` | ||
Member string `db:"primary=yes&join=internal_cluster_members.name&joinon=Disks.member_id"` | ||
Path string `db:"primary=yes"` | ||
} | ||
|
||
// DiskPathFilter is a required struct for use with lxd-generate. It is used for filtering fields on database fetches. | ||
type DiskPathFilter struct { | ||
// DiskFilter is a required struct for use with lxd-generate. It is used for filtering fields on database fetches. | ||
type DiskFilter struct { | ||
Member *string | ||
Path *string | ||
} |
Oops, something went wrong.