Skip to content

Commit

Permalink
docs: update README and add repo metadata (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored and NimJay committed Nov 19, 2022
1 parent cab5152 commit b367866
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions dataproc/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@
'use strict';

// [START dataproc_quickstart]
async function quickstart() {
const dataproc = require('@google-cloud/dataproc');
const client = new dataproc.v1.ClusterControllerClient({
// optional auth parameters.
});

const projectId = process.env.GCLOUD_PROJECT;

// Iterate over all elements.
const region = 'global';
const request = {projectId, region};
const dataproc = require('@google-cloud/dataproc');
const client = new dataproc.v1.ClusterControllerClient();

async function quickstart() {
const projectId = await client.getProjectId();
const request = {
region: 'global',
projectId,
};
const [resources] = await client.listClusters(request);
console.log('Total resources:', resources.length);
for (const resource of resources) {
Expand All @@ -54,6 +51,6 @@ async function quickstart() {
console.log(element);
});
}
// [END dataproc_quickstart]

quickstart().catch(console.error);
quickstart();
// [END dataproc_quickstart]

0 comments on commit b367866

Please sign in to comment.