@@ -28,10 +28,7 @@ type ClientAdmin interface {
2828 ClientAdminLog
2929 ClientAdminBackup
3030 ClientAdminLicense
31-
32- // Health returns the cluster configuration & health.
33- // It works in cluster or active fail-over mode.
34- Health (ctx context.Context ) (ClusterHealth , error )
31+ ClientAdminCluster
3532
3633 // ServerMode returns the current mode in which the server/cluster is operating.
3734 // This call needs ArangoDB 3.3 and up.
@@ -43,6 +40,40 @@ type ClientAdmin interface {
4340 SetServerMode (ctx context.Context , mode ServerMode ) error
4441}
4542
43+ type ClientAdminCluster interface {
44+ // Health returns the cluster configuration & health. Not available in single server deployments (403 Forbidden).
45+ Health (ctx context.Context ) (ClusterHealth , error )
46+
47+ // DatabaseInventory the inventory of the cluster collections (with entire details) from a specific database.
48+ DatabaseInventory (ctx context.Context , dbName string ) (DatabaseInventory , error )
49+
50+ // MoveShard moves a single shard of the given collection between `fromServer` and `toServer`.
51+ MoveShard (ctx context.Context , col Collection , shard ShardID , fromServer , toServer ServerID ) (string , error )
52+
53+ // CleanOutServer triggers activities to clean out a DBServer.
54+ CleanOutServer (ctx context.Context , serverID ServerID ) (string , error )
55+
56+ // ResignServer triggers activities to let a DBServer resign for all shards.
57+ ResignServer (ctx context.Context , serverID ServerID ) (string , error )
58+
59+ // NumberOfServers returns the number of coordinators & dbServers in a clusters and the ID's of cleanedOut servers.
60+ NumberOfServers (ctx context.Context ) (NumberOfServersResponse , error )
61+
62+ // IsCleanedOut checks if the dbServer with given ID has been cleaned out.
63+ IsCleanedOut (ctx context.Context , serverID ServerID ) (bool , error )
64+
65+ // RemoveServer is a low-level option to remove a server from a cluster.
66+ // This function is suitable for servers of type coordinator or dbServer.
67+ // The use of `ClientServerAdmin.Shutdown` is highly recommended above this function.
68+ RemoveServer (ctx context.Context , serverID ServerID ) error
69+ }
70+
71+ type NumberOfServersResponse struct {
72+ NoCoordinators int `json:"numberOfCoordinators,omitempty"`
73+ NoDBServers int `json:"numberOfDBServers,omitempty"`
74+ CleanedServerIDs []ServerID `json:"cleanedServers,omitempty"`
75+ }
76+
4677type ClientAdminLog interface {
4778 // GetLogLevels returns log levels for topics.
4879 GetLogLevels (ctx context.Context , opts * LogLevelsGetOptions ) (LogLevels , error )
@@ -55,3 +86,54 @@ type ClientAdminLicense interface {
5586 // GetLicense returns license of an ArangoDB deployment.
5687 GetLicense (ctx context.Context ) (License , error )
5788}
89+
90+ type DatabaseInventory struct {
91+ Info DatabaseInfo `json:"properties,omitempty"`
92+ Collections []InventoryCollection `json:"collections,omitempty"`
93+ Views []InventoryView `json:"views,omitempty"`
94+ State ServerStatus `json:"state,omitempty"`
95+ Tick string `json:"tick,omitempty"`
96+ }
97+
98+ type InventoryCollection struct {
99+ Parameters InventoryCollectionParameters `json:"parameters"`
100+ Indexes []InventoryIndex `json:"indexes,omitempty"`
101+ PlanVersion int64 `json:"planVersion,omitempty"`
102+ IsReady bool `json:"isReady,omitempty"`
103+ AllInSync bool `json:"allInSync,omitempty"`
104+ }
105+
106+ type InventoryCollectionParameters struct {
107+ Deleted bool `json:"deleted,omitempty"`
108+ Shards map [ShardID ][]ServerID `json:"shards,omitempty"`
109+ PlanID string `json:"planId,omitempty"`
110+
111+ CollectionProperties
112+ }
113+
114+ type InventoryIndex struct {
115+ ID string `json:"id,omitempty"`
116+ Type string `json:"type,omitempty"`
117+ Fields []string `json:"fields,omitempty"`
118+ Unique bool `json:"unique"`
119+ Sparse bool `json:"sparse"`
120+ Deduplicate bool `json:"deduplicate"`
121+ MinLength int `json:"minLength,omitempty"`
122+ GeoJSON bool `json:"geoJson,omitempty"`
123+ Name string `json:"name,omitempty"`
124+ ExpireAfter int `json:"expireAfter,omitempty"`
125+ Estimates bool `json:"estimates,omitempty"`
126+ FieldValueTypes string `json:"fieldValueTypes,omitempty"`
127+ CacheEnabled * bool `json:"cacheEnabled,omitempty"`
128+ }
129+
130+ type InventoryView struct {
131+ Name string `json:"name,omitempty"`
132+ Deleted bool `json:"deleted,omitempty"`
133+ ID string `json:"id,omitempty"`
134+ IsSystem bool `json:"isSystem,omitempty"`
135+ PlanID string `json:"planId,omitempty"`
136+ Type ViewType `json:"type,omitempty"`
137+
138+ ArangoSearchViewProperties
139+ }
0 commit comments