Skip to content

Commit

Permalink
refactor: use repo-metadata to generate readme (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored and Ace Nassri committed Nov 17, 2022
1 parent cb365bd commit 601afd5
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions container/snippets/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,27 @@
*/

'use strict';

async function main() {
// [START container_quickstart]
const container = require('@google-cloud/container');

if (
!process.env.GCLOUD_PROJECT ||
!process.env.GOOGLE_APPLICATION_CREDENTIALS
) {
throw new Error(
'Usage: GCLOUD_PROJECT=<project_id> GOOGLE_APPLICATION_CREDENTIALS=<path to key json file> node #{$0}'
);
}

const client = new container.v1.ClusterManagerClient({
// optional auth parameters.
});
// Create the Cluster Manager Client
const client = new container.v1.ClusterManagerClient();

const projectId = process.env.GCLOUD_PROJECT;
const zone = 'us-central1-a';
const request = {
projectId: projectId,
zone: zone,
};
async function quickstart() {
const zone = 'us-central1-a';
const projectId = await client.getProjectId();
const request = {
projectId: projectId,
zone: zone,
};

const [response] = await client.listClusters(request);
console.log('Clusters:');
console.log(response);
const [response] = await client.listClusters(request);
console.log('Clusters:');
console.log(response);
}
quickstart();
// [END container_quickstart]
}

Expand Down

0 comments on commit 601afd5

Please sign in to comment.