You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/production/dbos-cloud/cloud-cli.md
+5-31
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ This command retrieves the status of a Postgres database instance
107
107
This command resets your password for a Postgres database instance.
108
108
109
109
**Arguments:**
110
-
-`[database-instance-name]`: The name of the database instance to provision.
110
+
-`[database-instance-name]`: The name of the database instance whose password to reset.
111
111
-`-W, --password [string]`: Your new password for this database instance. If not provided, will be prompted on the command line. Passwords must contain 8 or more characters.
112
112
113
113
---
@@ -122,43 +122,18 @@ This command destroys a previously-provisioned Postgres database instance.
122
122
123
123
---
124
124
125
-
### `dbos-cloud db local`
125
+
### `dbos-cloud db url`
126
126
127
127
**Description:**
128
-
Configure `dbos-config.yaml` to use a DBOS Cloud Postgres server for local development.
129
-
This command also sets the `local_suffix` field in `dbos-config.yaml`, so your application will suffix its application database name with `_local` while running locally.
130
-
This isolates the database you use for local development from the database used by your app deployed to DBOS Cloud even though both use the same Postgres server.
131
-
132
-
133
-
**Arguments:**
134
-
-`[database-instance-name]`: The name of the database instance to which to connect.
135
-
-`-W, --password [string]`: Your password for this database instance. If not provided, will be prompted on the command line.
136
-
137
-
---
138
-
139
-
### `dbos-cloud db connect`
140
-
141
-
**Description:**
142
-
This command loads your cloud database's connection parameters into your local `dbos-config.yaml`.
128
+
This command retrives your cloud database connection URL.
143
129
144
130
**Arguments:**
145
131
-`[database-instance-name]`: The name of the database instance to which to connect.
132
+
-`-S, --show-password`: Whether to show your database password in the output.
146
133
-`-W, --password [string]`: Your password for this database instance. If not provided, will be prompted on the command line.
147
134
148
135
---
149
136
150
-
### `dbos-cloud db restore`
151
-
152
-
**Description:**
153
-
This command performs [PostgreSQL point-in-time-recovery](https://www.postgresql.org/docs/current/continuous-archiving.html) to create a new database instance containing the state of your database instance at a previous point in time.
154
-
After restoration is complete, we recommend using [`change-database-instance`](#dbos-cloud-app-change-database-instance) to redeploy your applications to the new database instance, then [destroying](#dbos-cloud-db-destroy) the original.
155
-
156
-
**Arguments:**
157
-
-`<database-instance-name>`: The name of the database instance to restore from.
158
-
-`-t, --restore-time <string>`: The timestamp to restore from, in [RFC3339 format](https://datatracker.ietf.org/doc/html/rfc3339). Must be within the backup retention period of your database (24 hours for free-tier users).
159
-
-`-n, --target-name <string>`: The name of the new database instance to create.
160
-
---
161
-
162
137
### `dbos-cloud db link`
163
138
164
139
**Description:**
@@ -312,12 +287,11 @@ It retrieves an application's logs.
312
287
**Description:**
313
288
This command must be run from an application root directory.
314
289
It redeploys the application to a new database instance.
315
-
It is meant to be used with [`database restore`](#dbos-cloud-db-restore) during disaster recovery to transfer the application to the restored database instance.
316
290
317
291
**Arguments:**
318
292
-`--verbose`: Logs debug information about the deployment process, including config file processing and files sent.
319
293
-`-d, --database <string>` The name of the new database instance for this application.
320
-
-`-p, --previous-version [number]`: The ID of a previous version of this application. If this is supplied, redeploy that version instead of deploying from the application directory. During restoration, we recommend deploying to the version active at the timestamp to which you recovered. You can list previous versions and their IDs and timestamps with the [versions command](#dbos-cloud-app-versions).
294
+
-`-p, --previous-version [number]`: The ID of a previous version of this application. If this is supplied, redeploy that version instead of deploying from the application directory.
Copy file name to clipboardExpand all lines: docs/production/dbos-cloud/database-management.md
-36
Original file line number
Diff line number
Diff line change
@@ -65,42 +65,6 @@ While it is occasionally necessary, be careful when manually changing the schema
65
65
Be careful making breaking schema changes such as deleting or renaming a column—they may break active workflows running on a previous application version.
66
66
:::
67
67
68
-
### Database Recovery
69
-
70
-
:::info
71
-
Database recovery is not available for [linked databases](./byod-management.md)
72
-
:::
73
-
74
-
DBOS Cloud can use [PostgreSQL point-in-time-recovery](https://www.postgresql.org/docs/current/continuous-archiving.html) to restore your database to a previous state, for example to recover from data corruption or loss.
75
-
First, run the [`database restore`](./cloud-cli.md#dbos-cloud-db-restore) to create a new database instance containing the state of your database instance at a previous point in time:
76
-
77
-
```shell
78
-
dbos-cloud db restore <database-name> -t <timestamp> -n <new-db-instance-name>
79
-
```
80
-
81
-
The timestamp must be in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339) format and must be within the backup retention period of your database (24 hours for free-tier users).
82
-
83
-
After the database is restored, you can redeploy your applications to it with [`app change-database-instance`](./cloud-cli.md#dbos-cloud-app-change-database-instance).
84
-
For each application connected to the original database instance, run:
If you wish to restore your application to a previous version (such as the version that was running at the recovery timestamp), you can do this with the `--previous-version` parameter:
Retrieve a list of [`WorkflowStatus`](#workflow-status) of all workflows matching specified criteria.
252
+
253
+
**Parameters:**
254
+
-**workflow_ids**: Retrieve workflows with these IDs.
255
+
-**status**: Retrieve workflows with this status (Must be `ENQUEUED`, `PENDING`, `SUCCESS`, `ERROR`, `CANCELLED`, or `RETRIES_EXCEEDED`)
256
+
-**start_time**: Retrieve workflows started after this (RFC 3339-compliant) timestamp.
257
+
-**end_time**: Retrieve workflows started before this (RFC 3339-compliant) timestamp.
258
+
-**name**: Retrieve workflows with this fully-qualified name.
259
+
-**app_version**: Retrieve workflows tagged with this application version.
260
+
-**user**: Retrieve workflows run by this authenticated user.
261
+
-**limit**: Retrieve up to this many workflows.
262
+
-**offset**: Skip this many workflows from the results returned (for pagination).
263
+
-**sort_desc**: Whether to sort the results in descending (`True`) or ascending (`False`) order by workflow start time.
264
+
265
+
### list_queued_workflows
266
+
```python
267
+
deflist_queued_workflows(
268
+
*,
269
+
queue_name: Optional[str] =None,
270
+
status: Optional[str] =None,
271
+
start_time: Optional[str] =None,
272
+
end_time: Optional[str] =None,
273
+
name: Optional[str] =None,
274
+
limit: Optional[int] =None,
275
+
offset: Optional[int] =None,
276
+
sort_desc: bool=False,
277
+
) -> List[WorkflowStatus]:
278
+
```
279
+
280
+
Retrieve a list of [`WorkflowStatus`](#workflow-status) of all **currently enqueued** workflows matching specified criteria.
281
+
282
+
**Parameters:**
283
+
-**queue_name**: Retrieve workflows running on this queue.
284
+
-**status**: Retrieve workflows with this status (Must be `ENQUEUED` or `PENDING`)
285
+
-**start_time**: Retrieve workflows enqueued after this (RFC 3339-compliant) timestamp.
286
+
-**end_time**: Retrieve workflows enqueued before this (RFC 3339-compliant) timestamp.
287
+
-**name**: Retrieve workflows with this fully-qualified name.
288
+
-**limit**: Retrieve up to this many workflows.
289
+
-**offset**: Skip this many workflows from the results returned (for pagination).
290
+
291
+
### cancel_workflow
292
+
293
+
```python
294
+
DBOS.cancel_workflow(
295
+
workflow_id: str,
296
+
) ->None
297
+
```
298
+
299
+
Cancel a workflow.
300
+
This sets is status to `CANCELLED`, removes it from its queue (if it is enqueued) and preempts its execution (interrupting it at the beginning of its next step)
301
+
302
+
### resume_workflow
303
+
304
+
```python
305
+
DBOS.resume_workflow(
306
+
workflow_id: str,
307
+
) -> WorkflowHandle[R]
308
+
```
309
+
310
+
Resume a workflow.
311
+
This immediately starts it from its last completed step.
312
+
You can use this to resume workflows that are cancelled or have exceeded their maximum recovery attempts.
313
+
You can also use this to start an enqueued workflow immediately, bypassing its queue.
314
+
315
+
### restart_workflow
316
+
317
+
```python
318
+
DBOS.restart_workflow(
319
+
workflow_id: str,
320
+
) -> WorkflowHandle[R]
321
+
```
322
+
323
+
Start a new execution of a workflow with the same inputs as the original, but a new workflow ID.
324
+
325
+
### Workflow Status
326
+
327
+
Some workflow introspection and management methods return a `WorkflowStatus`.
328
+
This object has the following definition:
329
+
330
+
```python
331
+
classWorkflowStatus:
332
+
# The workflow ID
333
+
workflow_id: str
334
+
# The workflow status. Must be one of ENQUEUED, PENDING, SUCCESS, ERROR, CANCELLED, or RETRIES_EXCEEDED
335
+
status: str
336
+
# The name of the workflow function
337
+
name: str
338
+
# The name of the workflow's class, if any
339
+
class_name: Optional[str]
340
+
# The name with which the workflow's class instance was configured, if any
341
+
config_name: Optional[str]
342
+
# The user who ran the workflow, if specified
343
+
authenticated_user: Optional[str]
344
+
# The role with which the workflow ran, if specified
345
+
assumed_role: Optional[str]
346
+
# All roles which the authenticated user could assume
347
+
authenticated_roles: Optional[list[str]]
348
+
# The deserialized workflow input object
349
+
input: Optional[WorkflowInputs]
350
+
# The workflow's output, if any
351
+
output: Optional[Any]
352
+
# The error the workflow threw, if any
353
+
error: Optional[Exception]
354
+
# Workflow start time, as a Unix epoch timestamp in ms
355
+
created_at: Optional[int]
356
+
# Last time the workflow status was updated, as a Unix epoch timestamp in ms
357
+
updated_at: Optional[int]
358
+
# If this workflow was enqueued, on which queue
359
+
queue_name: Optional[str]
360
+
# The executor to most recently executed this workflow
361
+
executor_id: Optional[str]
362
+
# The application version on which this workflow was started
363
+
app_version: Optional[str]
364
+
```
365
+
232
366
## Context Variables
233
367
234
368
### logger
@@ -262,34 +396,42 @@ DBOS.workflow_id: str
262
396
May only be accessed from within a workflow, step, or transaction.
263
397
Return the identity of the current workflow.
264
398
265
-
### span
399
+
### step_id
266
400
267
401
```python
268
-
DBOS.span: opentelemetry.trace.Span
402
+
DBOS.step_id: int
269
403
```
270
404
271
-
Retrieve the OpenTelemetry span associated with the curent request.
272
-
You can use this to set custom attributes in your span.
405
+
Returns the unique ID of the current step within a workflow.
273
406
274
-
### request
407
+
### step_status
275
408
276
409
```python
277
-
DBOS.request: Request
410
+
DBOS.step_status: StepStatus
278
411
```
279
412
280
-
May only be accessed from within the handler of a FastAPI request, or in a function called from the handler.
281
-
Retrieve request information parsed from FastAPI:
413
+
Return the status of the currently executing step.
414
+
This object has the following properties:
415
+
282
416
```python
283
-
headers: Headers # The request headers
284
-
path_params: dict[str, Any] # The request's path parameters
285
-
query_params QueryParams # The request's query parameters
286
-
url: URL# The URL to which the request was sent
287
-
base_url: URL# The base URL of the request
288
-
client: Optional[Address] # Information about the client that sent the request
289
-
cookies: dict[str, str] # The request's cookie parameters
290
-
method: str# The HTTP method of the request
417
+
classStepStatus:
418
+
# The unique ID of this step in its workflow.
419
+
step_id: int
420
+
# For steps with automatic retries, which attempt number (zero-indexed) is currently executing.
421
+
current_attempt: Optional[int]
422
+
# For steps with automatic retries, the maximum number of attempts that will be made before the step fails.
423
+
max_attempts: Optional[int]
291
424
```
292
425
426
+
### span
427
+
428
+
```python
429
+
DBOS.span: opentelemetry.trace.Span
430
+
```
431
+
432
+
Retrieve the OpenTelemetry span associated with the curent request.
433
+
You can use this to set custom attributes in your span.
0 commit comments