How to use @google-cloud/container - 5 common examples

To help you get started, we’ve selected a few @google-cloud/container examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oslabs-beta / KuberOptic / src / main / gcp / gcp.ts View on Github external
const container = require('@google-cloud/container');
require('babel-polyfill');

const GOOGLE_APPLICATION_CREDENTIALS = require('./creds.json');
const client: any = new container.v1.ClusterManagerClient(GOOGLE_APPLICATION_CREDENTIALS);

// console.log(client)
console.log('-------------------------------------');
async function quickstart() {
  const zone = 'us-west2-a';
  const projectId = await client.getProjectId();
  const request = {
    projectId: projectId,
    zone: zone,
 };
 const [response] = await client.listClusters(request);
 const [listOperation] = await client.listOperations(request);
 console.log('Clusters:');
 console.log(response);
 console.log('-------------------------------------');
 console.log(response.clusters[0].nodePools.length)
github googleapis / nodejs-cloud-container / samples / quickstart.js View on Github external
async function main() {
  // [START container_quickstart]
  const container = require('@google-cloud/container');

  // Create the Cluster Manager Client
  const client = new container.v1.ClusterManagerClient();

  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);
  }
  quickstart();
  // [END container_quickstart]
}
github googleapis / nodejs-cloud-container / system-test / fixtures / sample / src / index.js View on Github external
function main() {
  const clusterManagerClient = new container.ClusterManagerClient();
}
github googleapis / nodejs-cloud-container / system-test / fixtures / sample / src / index.ts View on Github external
function main() {
  const clusterManagerClient = new ClusterManagerClient();
}
github oslabs-beta / KuberOptic / src / main / gcp / getGCPdata.ts View on Github external
async function create(GOOGLE_APPLICATION_CREDENTIALS:any, zone:string ='us-central1-a', input:object = {'clusterType':'affordable', 'name':'deployCluster', 'zone':'us-central1-a'}){
  const client:any = new container.v1.ClusterManagerClient(GOOGLE_APPLICATION_CREDENTIALS);
  GOOGLE_APPLICATION_CREDENTIALS = JSON.parse(GOOGLE_APPLICATION_CREDENTIALS);
  const projectId:string = GOOGLE_APPLICATION_CREDENTIALS["project_id"];
  let cluster:object ={};
  console.log(`we're invoking create input is:` , input)
  console.log('gcptype: ', GOOGLE_APPLICATION_CREDENTIALS["project_id"])
 
  if(input['clusterType'] == 'affordable'){
    cluster = {
      "name": input['name'],
      "masterAuth": {
        "clientCertificateConfig": {}
      },
      "loggingService": "none",
      "monitoringService": "none",
      "network": `projects/${projectId}/global/networks/default`,
      "addonsConfig": {

@google-cloud/container

Google Container Engine API client for Node.js

Apache-2.0
Latest version published 8 days ago

Package Health Score

94 / 100
Full package analysis