This repository has been archived by the owner on Mar 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
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: Aravinda VK <avishwan@redhat.com>
- Loading branch information
1 parent
3d9707a
commit 931b7a2
Showing
17 changed files
with
201 additions
and
203 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
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,22 +1,28 @@ | ||
package api | ||
|
||
import ( | ||
"github.com/gluster/glusterd2/pkg/api" | ||
"strings" | ||
|
||
"github.com/pborman/uuid" | ||
) | ||
|
||
// Info represents structure in which devices are to be store in Peer Metadata | ||
type Info struct { | ||
Name string `json:"name"` | ||
State string `json:"state"` | ||
VgName string `json:"vg-name"` | ||
AvailableSize uint64 `json:"available-size"` | ||
ExtentSize uint64 `json:"extent-size"` | ||
Used bool `json:"device-used"` | ||
PeerID string `json:"peer-id"` | ||
Device string `json:"device"` | ||
State string `json:"state"` | ||
AvailableSize uint64 `json:"available-size"` | ||
ExtentSize uint64 `json:"extent-size"` | ||
Used bool `json:"device-used"` | ||
PeerID uuid.UUID `json:"peer-id"` | ||
} | ||
|
||
// VgName returns name for LVM Vg | ||
func (info *Info) VgName() string { | ||
return "gluster" + strings.Replace(info.Device, "/", "-", -1) | ||
} | ||
|
||
// AddDeviceResp is the success response sent to a AddDeviceReq request | ||
type AddDeviceResp api.Peer | ||
type AddDeviceResp Info | ||
|
||
// ListDeviceResp is the success response sent to a ListDevice request | ||
type ListDeviceResp []Info |
Oops, something went wrong.