Added container unprovisioning

This commit is contained in:
Srinath Narayanan
2021-06-30 04:21:42 -07:00
parent b1c238f43a
commit 5f66f113af

View File

@@ -477,6 +477,21 @@ export default class Explorer {
},
body: JSON.stringify(provisionData)
})
const websocketId = await response.text();
const unprovisionData = {
resourceId: userContext.databaseAccount.id,
websocketId: websocketId
}
window.addEventListener("beforeunload", async () => {
const response = await window.fetch("http://localhost:443/api/containerpooling/unprovision", {
method: "POST",
headers: {
[HttpHeaders.contentType]: "application/json",
},
body: JSON.stringify(unprovisionData)
})
})
this.notebookServerInfo({
notebookServerEndpoint: userContext.features.notebookServerUrl || `http://localhost:443/api/containerpooling/resid${userContext.databaseAccount.id}/forward/`,