Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit d501eaf

Browse files
committed
Replace table path builders
1 parent 63a678b commit d501eaf

7 files changed

Lines changed: 26 additions & 26 deletions

File tree

samples/api-reference-doc-snippets/family.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const snippets = {
2121
const projectId = await adminClient.getProjectId();
2222

2323
const request = {
24-
name: adminClient.tablePath(projectId, instanceId, tableId),
24+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
2525
modifications: [
2626
{
2727
id: familyId,
@@ -48,7 +48,7 @@ const snippets = {
4848
const projectId = await adminClient.getProjectId();
4949

5050
const request = {
51-
name: adminClient.tablePath(projectId, instanceId, tableId),
51+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
5252
view: 'FAMILY_VIEW_BASIC',
5353
};
5454

@@ -72,7 +72,7 @@ const snippets = {
7272
const projectId = await adminClient.getProjectId();
7373

7474
const request = {
75-
name: adminClient.tablePath(projectId, instanceId, tableId),
75+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
7676
view: 'FULL',
7777
};
7878

@@ -95,7 +95,7 @@ const snippets = {
9595
const projectId = await adminClient.getProjectId();
9696

9797
const request = {
98-
name: adminClient.tablePath(projectId, instanceId, tableId),
98+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
9999
view: 'FULL',
100100
};
101101

@@ -124,7 +124,7 @@ const snippets = {
124124
};
125125

126126
const request = {
127-
name: adminClient.tablePath(projectId, instanceId, tableId),
127+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
128128
modifications: [
129129
{
130130
id: familyId,
@@ -152,7 +152,7 @@ const snippets = {
152152
const projectId = await adminClient.getProjectId();
153153

154154
const request = {
155-
name: adminClient.tablePath(projectId, instanceId, tableId),
155+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
156156
modifications: [
157157
{
158158
id: familyId,

samples/api-reference-doc-snippets/table.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const snippets = {
4949
const projectId = await adminClient.getProjectId();
5050

5151
const request = {
52-
name: adminClient.tablePath(projectId, instanceId, tableId),
52+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
5353
};
5454

5555
try {
@@ -73,7 +73,7 @@ const snippets = {
7373
const projectId = await adminClient.getProjectId();
7474

7575
const request = {
76-
name: adminClient.tablePath(projectId, instanceId, tableId),
76+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
7777
};
7878

7979
adminClient
@@ -95,7 +95,7 @@ const snippets = {
9595
const projectId = await adminClient.getProjectId();
9696

9797
const request = {
98-
name: adminClient.tablePath(projectId, instanceId, tableId),
98+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
9999
view: 'FULL',
100100
};
101101

@@ -129,7 +129,7 @@ const snippets = {
129129

130130
adminClient
131131
.modifyColumnFamilies({
132-
name: adminClient.tablePath(projectId, instanceId, tableId),
132+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
133133
modifications: [
134134
{
135135
id: familyId,
@@ -156,7 +156,7 @@ const snippets = {
156156
const projectId = await adminClient.getProjectId();
157157

158158
const request = {
159-
name: adminClient.tablePath(projectId, instanceId, tableId),
159+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
160160
view: 'FULL',
161161
};
162162

@@ -347,7 +347,7 @@ const snippets = {
347347
const projectId = await adminClient.getProjectId();
348348

349349
const request = {
350-
resource: adminClient.tablePath(projectId, instanceId, tableId),
350+
resource: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
351351
};
352352

353353
adminClient
@@ -377,7 +377,7 @@ const snippets = {
377377
};
378378

379379
const request = {
380-
resource: adminClient.tablePath(projectId, instanceId, tableId),
380+
resource: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
381381
policy: policy,
382382
};
383383

@@ -401,7 +401,7 @@ const snippets = {
401401
const permissions = ['bigtable.tables.get', 'bigtable.tables.readRows'];
402402

403403
const request = {
404-
resource: adminClient.tablePath(projectId, instanceId, tableId),
404+
resource: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
405405
permissions: permissions,
406406
};
407407

@@ -439,7 +439,7 @@ const snippets = {
439439
const projectId = await adminClient.getProjectId();
440440

441441
const request = {
442-
name: adminClient.tablePath(projectId, instanceId, tableId),
442+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
443443
};
444444

445445
adminClient
@@ -461,15 +461,15 @@ const snippets = {
461461
// 1. Generate a consistency token.
462462
const token = (
463463
await adminClient.generateConsistencyToken({
464-
name: adminClient.tablePath(projectId, instanceId, tableId),
464+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
465465
})
466466
)[0].consistencyToken;
467467
console.log('Generated consistency token:', token);
468468
let isConsistent = false;
469469
while (!isConsistent) {
470470
// 2. Check for consistency
471471
const [consistent] = adminClient.checkConsistency({
472-
name: adminClient.tablePath(projectId, instanceId, tableId),
472+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
473473
consistencyToken: token,
474474
});
475475
isConsistent = consistent;

samples/deleteSnippets.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async function main(
115115
const adminClient = new BigtableTableAdminClient();
116116
const projectId = await adminClient.getProjectId();
117117
const request = {
118-
name: adminClient.tablePath(projectId, instanceId, tableId),
118+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
119119
modifications: [
120120
{
121121
id: 'stats_summary',
@@ -134,13 +134,13 @@ async function main(
134134
const adminClient = new BigtableTableAdminClient();
135135
const projectId = await adminClient.getProjectId();
136136
const request = {
137-
name: adminClient.tablePath(projectId, instanceId, tableId),
137+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
138138
};
139139
await adminClient.deleteTable(request);
140140
console.log(
141141
await adminClient
142142
.getTable({
143-
name: adminClient.tablePath(projectId, instanceId, tableId),
143+
name: `projects/${projectId}/instances/${instanceId}/tables/${tableId}`,
144144
})
145145
.catch(e => (e.code === 5 ? false : e)),
146146
);

samples/hello-world/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const getRowGreeting = row => {
5555
let tableExists = true;
5656
try {
5757
await adminClient.getTable({
58-
name: adminClient.tablePath(projectId, INSTANCE_ID, TABLE_ID),
58+
name: `projects/${projectId}/instances/${INSTANCE_ID}/tables/${TABLE_ID}`,
5959
});
6060
} catch (e) {
6161
if (e.code === 5) {
@@ -141,7 +141,7 @@ const getRowGreeting = row => {
141141
// [START bigtable_hw_delete_table]
142142
console.log('Delete the table');
143143
const request = {
144-
name: adminClient.tablePath(projectId, INSTANCE_ID, TABLE_ID),
144+
name: `projects/${projectId}/instances/${INSTANCE_ID}/tables/${TABLE_ID}`,
145145
};
146146
await adminClient.deleteTable(request);
147147
// [END bigtable_hw_delete_table]

samples/tableadmin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ async function deleteTable(instanceID, tableID) {
315315
// Delete the entire table
316316
console.log('Delete the table.');
317317
await adminClient.deleteTable({
318-
name: adminClient.tablePath(projectId, instanceID, tableID),
318+
name: `projects/${projectId}/instances/${instanceID}/tables/${tableID}`,
319319
});
320320
console.log(`Table deleted: ${tableID}`);
321321
// [END bigtable_delete_table]

samples/test/backups.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('backups', async () => {
4242
parent: `projects/${projectId}/instances/${INSTANCE_ID}/clusters/${CLUSTER_ID}`,
4343
backupId: backupId,
4444
backup: {
45-
sourceTable: adminClient.tablePath(projectId, INSTANCE_ID, TABLE_ID),
45+
sourceTable: `projects/${projectId}/instances/${INSTANCE_ID}/tables/${TABLE_ID}`,
4646
expireTime: new Date(Date.now() + 60 * 60 * 1000), // 1 hour from now
4747
},
4848
};
@@ -62,7 +62,7 @@ describe('backups', async () => {
6262
};
6363
await adminClient.createTable(request);
6464
const modifyFamiliesReq = {
65-
name: adminClient.tablePath(projectId, INSTANCE_ID, TABLE_ID),
65+
name: `projects/${projectId}/instances/${INSTANCE_ID}/tables/${TABLE_ID}`,
6666
modifications: [
6767
{
6868
id: 'follows',

samples/test/filters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ describe('filters', async () => {
227227
const adminClient = new BigtableTableAdminClient();
228228
const projectId = await adminClient.getProjectId();
229229
const request = {
230-
name: adminClient.tablePath(projectId, INSTANCE_ID, TABLE_ID),
230+
name: `projects/${projectId}/instances/${INSTANCE_ID}/tables/${TABLE_ID}`,
231231
};
232232
await adminClient.deleteTable(request).catch(console.error);
233233
});

0 commit comments

Comments
 (0)