[MM-25657] api4/config: add config migrate endpoint (#14928)

* api4/config: add config migrate endpoint

* api4/config: reflect review comments

* fix i18n lint error

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2020-08-14 18:26:23 +03:00
коммит произвёл GitHub
родитель bda24c8fe0
Коммит 16ffb6712f
5 изменённых файлов: 76 добавлений и 0 удалений

Просмотреть файл

@@ -3364,6 +3364,19 @@ func (c *Client4) UpdateConfig(config *Config) (*Config, *Response) {
return ConfigFromJson(r.Body), BuildResponse(r)
}
// MigrateConfig will migrate existing config to the new one.
func (c *Client4) MigrateConfig(from, to string) (bool, *Response) {
m := make(map[string]string, 2)
m["from"] = from
m["to"] = to
r, err := c.DoApiPost(c.GetConfigRoute()+"/migrate", MapToJson(m))
if err != nil {
return false, BuildErrorResponse(r, err)
}
defer closeBody(r)
return true, BuildResponse(r)
}
// UploadLicenseFile will add a license file to the system.
func (c *Client4) UploadLicenseFile(data []byte) (bool, *Response) {
body := &bytes.Buffer{}