-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mccalluc/workspace list #2715
Mccalluc/workspace list #2715
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Demostrate the Workspaces API to start jobs and collect job information. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,18 @@ async function createNotebookWorkspace({ | |
}); | ||
} | ||
|
||
export { createNotebookWorkspace }; | ||
async function startJob({ workspaceId, workspacesEndpoint, workspacesToken }) { | ||
await fetch(`${workspacesEndpoint}/workspaces/${workspaceId}/start`, { | ||
method: 'PUT', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'UWS-Authorization': `Token ${workspacesToken}`, | ||
}, | ||
body: JSON.stringify({ | ||
job_type: 'JupyterLabJob', | ||
job_details: {}, | ||
}), | ||
}); | ||
} | ||
Comment on lines
+30
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on our conversation in standup, we want to make another GET to jobs and update jobs state here, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I see the changes in #2717. Thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep... but I hit some snags there, so filed #2717 and will come back to it. |
||
|
||
export { createNotebookWorkspace, startJob }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the format is here, but we should move this towards being consistent with how other dates are formatted throughout the portal.