Skip to content

Commit

Permalink
fix: add operation (#1145)
Browse files Browse the repository at this point in the history
* add operation

* fix: add operation
  • Loading branch information
danieljbruce committed Aug 26, 2022
1 parent 424f718 commit 3a1e282
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions samples/instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ async function runInstanceOperations(instanceID, clusterID) {
};

// Create production instance with given options
const [prodInstance] = await instance.create(instanceOptions);
const [prodInstance, operation] = await instance.create(instanceOptions);
await operation.promise();
console.log(`Created Instance: ${prodInstance.id}`);
// [END bigtable_create_prod_instance]
} else {
Expand Down Expand Up @@ -105,7 +106,11 @@ async function createDevInstance(instanceID, clusterID) {
};

// Create development instance with given options
const [instance] = await bigtable.createInstance(instanceID, options);
const [instance, operation] = await bigtable.createInstance(
instanceID,
options
);
await operation.promise();
console.log(`Created development instance: ${instance.id}`);
// [END bigtable_create_dev_instance]
}
Expand Down Expand Up @@ -141,7 +146,11 @@ async function addCluster(instanceID, clusterID) {
storage: 'ssd',
};

const [cluster] = await instance.createCluster(clusterID, clusterOptions);
const [cluster, operation] = await instance.createCluster(
clusterID,
clusterOptions
);
await operation.promise();
console.log(`Cluster created: ${cluster.id}`);
// [END bigtable_create_cluster]
}
Expand Down

0 comments on commit 3a1e282

Please sign in to comment.