@@ -66,6 +66,7 @@ Python package for interacting with CloudOS
6666 - [ Interactive Sessions] ( #interactive-sessions )
6767 - [ List Interactive Sessions] ( #list-interactive-sessions )
6868 - [ Get Interactive Session Status] ( #get-interactive-session-status )
69+ - [ Pause Interactive Session] ( #pause-interactive-session )
6970 - [ Create Interactive Session] ( #create-interactive-session )
7071 - [ Datasets] ( #datasets )
7172 - [ List Files] ( #list-files )
@@ -1972,9 +1973,9 @@ The table displays sessions with pagination controls (press `n` for next page, `
19721973┏━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┓
19731974┃ Status ┃ Name ┃ Type ┃ ID ┃ Owner ┃
19741975┡━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━┩
1975- │ stopped │ cloudosR │ awsRstudio │ 69aee0dba197… │ Leila │
1976- │ running │ analysis-dev │ awsJupyterNotebook │ 69ae972a18f0… │ John │
1977- │ stopped │ test_session │ awsVSCode │ 69a996c098ab… │ James │
1976+ │ paused │ cloudosR │ RStudio │ 69aee0dba197… │ Leila │
1977+ │ running │ analysis-dev │ Jupyter │ 69ae972a18f0… │ John │
1978+ │ paused │ test_session │ VS Code │ 69a996c098ab… │ James │
19781979└─────────┴──────────────┴────────────────────┴───────────────┴────────┘
19791980
19801981Total sessions: 15
@@ -2012,7 +2013,7 @@ Interactive session list saved to interactive_sessions_list.json
20122013You can filter sessions by status and other criteria :
20132014
20142015` ` ` bash
2015- # Filter by status (setup, initialising, running, scheduled, stopped )
2016+ # Filter by status (setup, initialising, running, scheduled, paused )
20162017cloudos interactive-session list --profile my_profile --filter-status running
20172018
20182019# Show only your own sessions
@@ -2090,7 +2091,7 @@ Status changed: provisioning → running
20902091**Watch Mode Behavior**
20912092
20922093- **Pre-running sessions** (setup, initialising, scheduled): Watch mode will continuously poll and display status changes every 30 seconds (default)
2093- - **Running/stopped sessions**: Watch mode will show a warning and display the current status instead
2094+ - **Running/paused sessions**: Watch mode will show a warning and display the current status instead
20942095
20952096Example with a running session :
20962097
@@ -2159,6 +2160,161 @@ cloudos interactive-session status --session-id <SESSION_ID> --profile my_profil
21592160# Creates: /tmp/session_status.csv
21602161` ` `
21612162
2163+ # ### Pause Interactive Session
2164+
2165+ You can pause and terminate a running interactive session using the `cloudos interactive-session pause` command. This command gracefully shuts down the session and optionally saves session data before termination.
2166+
2167+ **Basic Usage**
2168+
2169+ Pause a session with confirmation :
2170+
2171+ ` ` ` bash
2172+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile
2173+ ` ` `
2174+
2175+ The command displays a confirmation prompt :
2176+
2177+ ` ` ` console
2178+ About to pause session: 69bd11ca02326c5b3649f5c1
2179+ Upload data before pausing: True
2180+ Force immediate termination: False
2181+ Continue? [y/N]: y
2182+
2183+ ✓ Session pause request sent successfully.
2184+ You can monitor the session status using: cloudos interactive-session status --session-id 69bd11ca02326c5b3649f5c1
2185+ ` ` `
2186+
2187+ **Skip Confirmation Prompt**
2188+
2189+ Use the `-y` or `--yes` flag to skip the confirmation prompt :
2190+
2191+ ` ` ` bash
2192+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile -y
2193+ ` ` `
2194+
2195+ **Data Management Options**
2196+
2197+ By default, session data is saved to S3 before pausing. Use `--no-upload` to skip data saving (use with caution) :
2198+
2199+ ` ` ` bash
2200+ # Save session data before pausing (default)
2201+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile
2202+
2203+ # Skip saving data (use with caution)
2204+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile --no-upload
2205+ ` ` `
2206+
2207+ **Termination Modes**
2208+
2209+ **Graceful Shutdown (default)**
2210+
2211+ Allows the session to clean up resources and save data before terminating :
2212+
2213+ ` ` ` bash
2214+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile
2215+ ` ` `
2216+
2217+ **Force Immediate Termination**
2218+
2219+ Bypass graceful shutdown for immediate termination (useful for stuck sessions) :
2220+
2221+ ` ` ` bash
2222+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile --force
2223+ ` ` `
2224+
2225+ Use `--force` with caution as it may not save session data properly.
2226+
2227+ **Wait for Termination**
2228+
2229+ Use the `--wait` flag to monitor the session until it reaches a terminal state :
2230+
2231+ ` ` ` bash
2232+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile --wait
2233+ ` ` `
2234+
2235+ Output with `--wait` :
2236+
2237+ ` ` ` console
2238+ Pausing session...
2239+ Status: shutting_down
2240+ Status: uploading_data
2241+ Status: cleaning_up
2242+ Status: stopped
2243+ ✓ Session paused successfully
2244+ ` ` `
2245+
2246+ **Error Handling**
2247+
2248+ The command provides helpful error messages for common issues :
2249+
2250+ ` ` ` console
2251+ # Trying to pause an already paused session
2252+ Error: Cannot pause session - the session is already paused.
2253+ Tip: Check the session status with: cloudos interactive-session status --session-id <SESSION_ID>
2254+
2255+ # Trying to pause a session that is already being paused
2256+ Error: Cannot pause session - the session is already being paused.
2257+ Tip: Wait a moment and check status with: cloudos interactive-session status --session-id <SESSION_ID>
2258+ ` ` `
2259+
2260+ **Examples**
2261+
2262+ Basic pause with confirmation :
2263+
2264+ ` ` ` bash
2265+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --workspace-id 687fb9905c45270e09db1e9a
2266+ ` ` `
2267+
2268+ Pause without saving data and skip confirmation :
2269+
2270+ ` ` ` bash
2271+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --workspace-id 687fb9905c45270e09db1e9a --no-upload -y
2272+ ` ` `
2273+
2274+ Force pause and wait for termination :
2275+
2276+ ` ` ` bash
2277+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --workspace-id 687fb9905c45270e09db1e9a --force -y --wait
2278+ ` ` `
2279+
2280+ Pause using profile configuration :
2281+
2282+ ` ` ` bash
2283+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --profile my_profile --wait
2284+ ` ` `
2285+
2286+ Pause with verbose output :
2287+
2288+ ` ` ` bash
2289+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --profile my_profile --verbose
2290+ ` ` `
2291+
2292+ **Options Reference**
2293+
2294+ The command automatically loads from profile (via `@with_profile_config` decorator) :
2295+ - **From Profile**: apikey, cloudos-url, workspace-id
2296+ - **Command Line**: Additional options and behaviors
2297+
2298+ **Required:**
2299+ - `--session-id` : The session ID to pause (24-character hex string)
2300+
2301+ **Optional Overrides from Profile:**
2302+ - `--apikey` (optional) : Override API key from profile
2303+ - `--cloudos-url` (optional) : Override CloudOS URL from profile
2304+ - `--workspace-id` (optional) : Override workspace ID from profile
2305+
2306+ **Optional Behavior Flags:**
2307+ - `--no-upload` : Don't save session data before pausing (default: saves data)
2308+ - `--force` : Force immediate termination, skip graceful shutdown (default: graceful). **Warning:** Shows a warning message that some data may not be saved.
2309+ - `--wait` : Wait for session to fully pause (default: return immediately after sending pause command)
2310+ - `-y, --yes` : Skip confirmation prompt (default: show confirmation)
2311+ - `--verbose` : Show detailed progress messages
2312+
2313+ **Optional Connection:**
2314+ - `--disable-ssl-verification` : Disable SSL certificate verification (not recommended)
2315+ - `--ssl-cert` : Path to SSL certificate file
2316+ - `--profile` : Profile to use from config file (default: default profile)
2317+
21622318# ### Create Interactive Session
21632319
21642320You can create and start a new interactive session using the `cloudos interactive-session create` command. This command provisions a new virtual environment with your specified configuration.
@@ -2293,7 +2449,7 @@ The output shows the session details including:
22932449- Session ID
22942450- Session name
22952451- Backend type (jupyter, vscode, rstudio, spark)
2296- - Current status (scheduled, initialising, setup, running, stopped )
2452+ - Current status (scheduled, initialising, setup, running, paused )
22972453
22982454
22992455# ## Datasets
0 commit comments