How to use @google-cloud/compute - 2 common examples

To help you get started, we’ve selected a few @google-cloud/compute 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 cloudfoundry-incubator / service-fabrik-broker / test / test_broker / iaas.GcpClient.spec.js View on Github external
it('disk create should fail if promise throws', function () {
        sandbox.restore();
        sandbox.stub(GcpCompute.prototype, 'zone').returns(zoneFailedStub);

        return client.createDiskFromSnapshot(snapshotName, zone)
          .then(() => {
            throw new Error('expected disk create request to fail');
          })
          .catch(err => expect(err.message).to.eql(createDiskFailedMsg));
      });
github cloudfoundry-incubator / service-fabrik-broker / test / test_broker / iaas.GcpClient.spec.js View on Github external
beforeEach(function () {
        sandbox = sinon.createSandbox();
        client = new GcpClient(settings);
        sandbox.stub(GcpCompute.prototype, 'snapshot').returns(snapshotStub);
        sandbox.stub(GcpCompute.prototype, 'zone').returns(zoneStub);
        sandbox.stub(GcpClient.prototype, 'getRandomDiskId').returns(diskName);
      });
      afterEach(function () {

@google-cloud/compute

Google Compute Engine Client Library for Node.js

Apache-2.0
Latest version published 3 days ago

Package Health Score

94 / 100
Full package analysis

Popular @google-cloud/compute functions