summaryrefslogtreecommitdiffstats
path: root/model/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/client.go')
-rw-r--r--model/client.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go
index 80ab42dc4..8ed221627 100644
--- a/model/client.go
+++ b/model/client.go
@@ -860,6 +860,20 @@ func (c *Client) GetSystemAnalytics(name string) (*Result, *AppError) {
}
}
+// Initiate immediate synchronization of LDAP users.
+// The synchronization will be performed asynchronously and this function will
+// always return OK unless you don't have permissions.
+// You must be the system administrator to use this function.
+func (c *Client) LdapSyncNow() (*Result, *AppError) {
+ if r, err := c.DoApiPost("/admin/ldap_sync_now", ""); err != nil {
+ return nil, err
+ } else {
+ defer closeBody(r)
+ return &Result{r.Header.Get(HEADER_REQUEST_ID),
+ r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil
+ }
+}
+
func (c *Client) CreateChannel(channel *Channel) (*Result, *AppError) {
if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/create", channel.ToJson()); err != nil {
return nil, err