Skip to content

Commit 838ffeb

Browse files
authored
Merge pull request #351 from terwey/issue_349
[WIP] Documenting the API in the Swagger (Open API v2) format.
2 parents 295825e + 035d57b commit 838ffeb

File tree

10 files changed

+3367
-1
lines changed

10 files changed

+3367
-1
lines changed

cluster/cluster.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ import (
3535
"golang.org/x/crypto/ssh"
3636
)
3737

38+
// A Clusters is a collection of Cluster objects
39+
//
40+
// swagger:response clusters
41+
type ClustersResponse struct {
42+
// Cluster information message
43+
// in: body
44+
Body []Cluster
45+
}
46+
47+
// A Cluster has all the information associated with the configured cluster model
48+
// and its servers.
49+
//
50+
// swagger:response cluster
51+
type ClusterResponse struct {
52+
// Cluster information message
53+
// in: body
54+
Body Cluster
55+
}
56+
3857
type Cluster struct {
3958
Name string `json:"name"`
4059
Tenant string `json:"tenant"`
@@ -168,6 +187,8 @@ func (a QueryRuleSorter) Len() int { return len(a) }
168187
func (a QueryRuleSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
169188
func (a QueryRuleSorter) Less(i, j int) bool { return a[i].Id < a[j].Id }
170189

190+
// The Agent describes the server where the cluster runs on.
191+
// swagger:response agent
171192
type Agent struct {
172193
Id string `json:"id"`
173194
HostName string `json:"hostName"`

cluster/crash.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
)
1919

2020
// Crash will store informations on a crash based on the replication stream
21+
// swagger:response crash
2122
type Crash struct {
2223
URL string
2324
FailoverMasterLogFile string
@@ -29,6 +30,8 @@ type Crash struct {
2930
ElectedMasterURL string
3031
}
3132

33+
// Collection of Crash reports
34+
// swagger:response crashList
3235
type crashList []*Crash
3336

3437
func (cluster *Cluster) newCrash(*Crash) (*Crash, error) {

0 commit comments

Comments
 (0)