Mount delete, refresh and default to new folder for mount create (#7702)

* Mount delete, refresh and default to new folder for mount create
- Delete mount action added
- Refresh mount action added
- Added "mymount" to theend of existing path so that we don't use already-existing HDFS folder. The call fails unless folder doesn't exist
This commit is contained in:
Kevin Cunnane
2019-10-14 13:26:14 -07:00
committed by GitHub
parent 6851b2091f
commit f18b65a690
5 changed files with 316 additions and 43 deletions

View File

@@ -214,6 +214,37 @@ export class ClusterController {
}
}
public async refreshMount(mountPath: string): Promise<MountResponse> {
let auth = await this.authPromise;
const api = new DefaultApiWrapper(this.username, this.password, this._url, auth);
try {
const mountStatus = await api.refreshMount('', '', mountPath);
return {
response: mountStatus.response,
status: mountStatus.body
};
} catch (error) {
// TODO handle 401 by reauthenticating
throw new ControllerError(error, localize('bdc.error.refreshHdfs', "Error refreshing mount"));
}
}
public async deleteMount(mountPath: string): Promise<MountResponse> {
let auth = await this.authPromise;
const api = new DefaultApiWrapper(this.username, this.password, this._url, auth);
try {
const mountStatus = await api.deleteMount('', '', mountPath);
return {
response: mountStatus.response,
status: mountStatus.body
};
} catch (error) {
// TODO handle 401 by reauthenticating
throw new ControllerError(error, localize('bdc.error.deleteHdfs', "Error deleting mount"));
}
}
}
/**
* Fixes missing protocol and wrong character for port entered by user