-
Notifications
You must be signed in to change notification settings - Fork 62
docs: All samples should include all necessary code #1721
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
base: main
Are you sure you want to change the base?
Conversation
This commit updates the `backups.restore.js` sample to use the `BigtableTableAdminClient` directly for restoring a table from a backup, instead of going through the handwritten `bigtable.instance().createTableFromBackup()` method. This change is based on the design document for the Node.js Bigtable Admin API autogeneration. The corresponding test for the sample in `samples/test/backups.js` has also been updated to pass the correct arguments to the updated sample script.
instance of the admin client should be used
This reverts commit c71b50c.
…into fix-restore-table-sample-5 # Conflicts: # samples/api-reference-doc-snippets/backups.create.js # samples/api-reference-doc-snippets/backups.delete.js # samples/api-reference-doc-snippets/backups.get.js # samples/api-reference-doc-snippets/backups.list.js # samples/api-reference-doc-snippets/backups.restore.js # samples/api-reference-doc-snippets/backups.update.js # samples/api-reference-doc-snippets/family.js # samples/api-reference-doc-snippets/instance.js # samples/api-reference-doc-snippets/table.js # samples/deleteSnippets.js # samples/hello-world/index.js # samples/tableadmin.js # samples/test/backups.js # samples/test/deletes.js # samples/test/family.js # samples/test/filters.js # samples/test/functions.js # samples/test/reads.js # samples/test/row.js # samples/test/write.js
…into fix-restore-table-sample-5-quality-checks # Conflicts: # samples/instances.js
…into fix-restore-table-sample-5-quality-checks-2
Here is the summary of changes. You are about to add 12 region tags.
You are about to delete 12 region tags.
This comment is generated by snippet-bot.
|
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. |
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.
For pretty much all the samples in this section we are pulling:
const {Bigtable, GCRuleMaker} = require('@google-cloud/bigtable');
const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;
const adminClient = new BigtableTableAdminClient();
into the samples and indenting the code that contains a sample so that these declarations can be done multiple times.
Description
This PR is an extension of #1720. The basic idea is that the rest of the samples should include all the code necessary to get the sample running.
Impact
It makes it easier for users to use our samples.
Testing
These are changes to the samples so they are covered by samples tests