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
chore(samples): Add samples for Cloud Spanner Scheduled Backups (#2117)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [x] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/nodejs-spanner/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
Fixes#2116 🦕
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
104
104
| Backups |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups.js,samples/README.md)|
105
105
| Batch Write |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/batch-write.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/batch-write.js,samples/README.md)|
106
106
| Batch |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/batch.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/batch.js,samples/README.md)|
107
+
| Creates a full backup schedule |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/create-full-backup-schedule.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/create-full-backup-schedule.js,samples/README.md)|
108
+
| Creates an incremental backup schedule |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/create-incremental-backup-schedule.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/create-incremental-backup-schedule.js,samples/README.md)|
107
109
| CRUD |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/crud.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/crud.js,samples/README.md)|
108
110
| Creates a new database with a specific default leader |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-create-with-default-leader.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-default-leader.js,samples/README.md)|
109
111
| Database-create-with-encryption-key |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-create-with-encryption-key.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-encryption-key.js,samples/README.md)|
@@ -113,12 +115,14 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
113
115
| Updates the default leader of an existing database |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-update-default-leader.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-update-default-leader.js,samples/README.md)|
114
116
| Updates a Cloud Spanner Database. |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-update.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-update.js,samples/README.md)|
115
117
| Datatypes |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/datatypes.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/datatypes.js,samples/README.md)|
118
+
| Deletes a backup schedule |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/delete-backup-schedule.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/delete-backup-schedule.js,samples/README.md)|
116
119
| Runs an execute sql request with directed read options |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/directed-reads.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/directed-reads.js,samples/README.md)|
117
120
| Delete using DML returning. |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/dml-returning-delete.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/dml-returning-delete.js,samples/README.md)|
118
121
| Insert using DML returning. |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/dml-returning-insert.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/dml-returning-insert.js,samples/README.md)|
119
122
| Update using DML returning. |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/dml-returning-update.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/dml-returning-update.js,samples/README.md)|
120
123
| DML |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/dml.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/dml.js,samples/README.md)|
121
124
| Enable fine grained access control |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/enable-fine-grained-access.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/enable-fine-grained-access.js,samples/README.md)|
125
+
| Gets a backup schedule |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/get-backup-schedule.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/get-backup-schedule.js,samples/README.md)|
122
126
| Get-commit-stats |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/get-commit-stats.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/get-commit-stats.js,samples/README.md)|
123
127
| List database roles |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/get-database-roles.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/get-database-roles.js,samples/README.md)|
124
128
| Gets the instance config metadata for the configuration nam6 |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/get-instance-config.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/get-instance-config.js,samples/README.md)|
@@ -140,6 +144,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
140
144
| Json-add-column |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/json-add-column.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-add-column.js,samples/README.md)|
141
145
| Json-query-parameter |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/json-query-parameter.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-query-parameter.js,samples/README.md)|
142
146
| Json-update-data |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/json-update-data.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-update-data.js,samples/README.md)|
147
+
| Lists backup schedules of a database |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/list-backup-schedules.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-backup-schedules.js,samples/README.md)|
143
148
| Lists all databases on the selected instance |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/list-databases.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-databases.js,samples/README.md)|
144
149
| Lists all the available instance configs for the selected project. |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/list-instance-configs.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-instance-configs.js,samples/README.md)|
145
150
| Executes request with max commit delay |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/max-commit-delay.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/max-commit-delay.js,samples/README.md)|
@@ -195,6 +200,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
195
200
| Timestamp |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/timestamp.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/timestamp.js,samples/README.md)|
196
201
| Executes a read/write transaction with transaction and request tags |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/transaction-tag.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/transaction-tag.js,samples/README.md)|
197
202
| Transaction |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/transaction.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/transaction.js,samples/README.md)|
203
+
| Updates a backup schedule |[source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/update-backup-schedule.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/update-backup-schedule.js,samples/README.md)|
@@ -38,12 +40,14 @@ and automatic, synchronous replication for high availability.
38
40
*[Updates the default leader of an existing database](#updates-the-default-leader-of-an-existing-database)
39
41
*[Updates a Cloud Spanner Database.](#updates-a-cloud-spanner-database.)
40
42
*[Datatypes](#datatypes)
43
+
*[Deletes a backup schedule](#deletes-a-backup-schedule)
41
44
*[Runs an execute sql request with directed read options](#runs-an-execute-sql-request-with-directed-read-options)
42
45
*[Delete using DML returning.](#delete-using-dml-returning.)
43
46
*[Insert using DML returning.](#insert-using-dml-returning.)
44
47
*[Update using DML returning.](#update-using-dml-returning.)
45
48
*[DML](#dml)
46
49
*[Enable fine grained access control](#enable-fine-grained-access-control)
50
+
*[Gets a backup schedule](#gets-a-backup-schedule)
47
51
*[Get-commit-stats](#get-commit-stats)
48
52
*[List database roles](#list-database-roles)
49
53
*[Gets the instance config metadata for the configuration nam6](#gets-the-instance-config-metadata-for-the-configuration-nam6)
@@ -65,6 +69,7 @@ and automatic, synchronous replication for high availability.
65
69
*[Json-add-column](#json-add-column)
66
70
*[Json-query-parameter](#json-query-parameter)
67
71
*[Json-update-data](#json-update-data)
72
+
*[Lists backup schedules of a database](#lists-backup-schedules-of-a-database)
68
73
*[Lists all databases on the selected instance](#lists-all-databases-on-the-selected-instance)
69
74
*[Lists all the available instance configs for the selected project.](#lists-all-the-available-instance-configs-for-the-selected-project.)
70
75
*[Executes request with max commit delay](#executes-request-with-max-commit-delay)
@@ -120,6 +125,7 @@ and automatic, synchronous replication for high availability.
120
125
*[Timestamp](#timestamp)
121
126
*[Executes a read/write transaction with transaction and request tags](#executes-a-read/write-transaction-with-transaction-and-request-tags)
122
127
*[Transaction](#transaction)
128
+
*[Updates a backup schedule](#updates-a-backup-schedule)
123
129
124
130
## Before you begin
125
131
@@ -391,6 +397,40 @@ __Usage:__
391
397
392
398
393
399
400
+
### Creates a full backup schedule
401
+
402
+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/create-full-backup-schedule.js).
403
+
404
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/create-full-backup-schedule.js,samples/README.md)
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/create-incremental-backup-schedule.js).
420
+
421
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/create-incremental-backup-schedule.js,samples/README.md)
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/crud.js).
@@ -544,6 +584,23 @@ __Usage:__
544
584
545
585
546
586
587
+
### Deletes a backup schedule
588
+
589
+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/delete-backup-schedule.js).
590
+
591
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/delete-backup-schedule.js,samples/README.md)
### Runs an execute sql request with directed read options
548
605
549
606
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/directed-reads.js).
@@ -646,6 +703,23 @@ __Usage:__
646
703
647
704
648
705
706
+
### Gets a backup schedule
707
+
708
+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/get-backup-schedule.js).
709
+
710
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/get-backup-schedule.js,samples/README.md)
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/get-commit-stats.js).
@@ -1003,6 +1077,23 @@ __Usage:__
1003
1077
1004
1078
1005
1079
1080
+
### Lists backup schedules of a database
1081
+
1082
+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/list-backup-schedules.js).
1083
+
1084
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-backup-schedules.js,samples/README.md)
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/list-databases.js).
@@ -1933,6 +2024,23 @@ __Usage:__
1933
2024
`node samples/transaction.js`
1934
2025
1935
2026
2027
+
-----
2028
+
2029
+
2030
+
2031
+
2032
+
### Updates a backup schedule
2033
+
2034
+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/update-backup-schedule.js).
2035
+
2036
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/update-backup-schedule.js,samples/README.md)
0 commit comments