MMCTL: Add import delete cmd for removing the import files (#29764)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0cf6361139
Коммит
09a2037b61
@@ -574,6 +574,10 @@ func (c *Client4) exportRoute(name string) string {
|
||||
return fmt.Sprintf(c.exportsRoute()+"/%v", name)
|
||||
}
|
||||
|
||||
func (c *Client4) importRoute(name string) string {
|
||||
return fmt.Sprintf(c.importsRoute()+"/%v", name)
|
||||
}
|
||||
|
||||
func (c *Client4) remoteClusterRoute() string {
|
||||
return "/remotecluster"
|
||||
}
|
||||
@@ -8798,6 +8802,15 @@ func (c *Client4) ListImports(ctx context.Context) ([]string, *Response, error)
|
||||
return c.ArrayFromJSON(r.Body), BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) DeleteImport(ctx context.Context, name string) (*Response, error) {
|
||||
r, err := c.DoAPIDelete(ctx, c.importRoute(name))
|
||||
if err != nil {
|
||||
return BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) ListExports(ctx context.Context) ([]string, *Response, error) {
|
||||
r, err := c.DoAPIGet(ctx, c.exportsRoute(), "")
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user