Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/core/src/awsService/sagemaker/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ export async function stopSpace(
ctx: vscode.ExtensionContext,
sageMakerClient?: SagemakerClient
) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for making the fix! Appreciate it!

await tryRefreshNode(node)
if (node.getStatus() === 'Stopped' || node.getStatus() === 'Stopping') {
void vscode.window.showWarningMessage(`Space ${node.spaceApp.SpaceName} is already in Stopped/Stopping state.`)
return
} else if (node.getStatus() === 'Starting') {
void vscode.window.showWarningMessage(
`Space ${node.spaceApp.SpaceName} is in Starting state. Wait until it is Running to attempt stop again.`
)
return
}
const spaceName = node.spaceApp.SpaceName!
const confirmed = await showConfirmationMessage({
prompt: `You are about to stop this space. Any active resource will also be stopped. Are you sure you want to stop the space?`,
Expand Down Expand Up @@ -179,7 +189,7 @@ export async function openRemoteConnect(
void vscode.window.showErrorMessage(ConnectFromRemoteWorkspaceMessage)
return
}

await tryRefreshNode(node)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm, this would also change the text on the Space node to reflect state after the API call right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the text (Stopped/Running) on the space would also be updated.

if (node.getStatus() === 'Stopped') {
// In case of SMUS, we pass in a SM Client and for SM AI, it creates a new SM Client.
const client = sageMakerClient ? sageMakerClient : new SagemakerClient(node.regionCode)
Expand Down
Loading