Project

Project

A Project object allows you to interact with your Google Compute Engine project.

Constructor

new Project(compute)

Parameters:
Name Type Description
compute Compute

Compute object this project belongs to.

Source:
See:
Example
const Compute = require('@google-cloud/compute');
const compute = new Compute();
const project = compute.project();

Methods

get()

Get a Project object.

Source:
Example
const Compute = require('@google-cloud/compute');
const compute = new Compute();
const project = compute.project();

project.get(function(err, project, apiResponse) {
  // `project` is a Project object.
});

//-
// If the callback is omitted, we'll return a Promise.
//-
project.get().then(function(data) {
  const project = data[0];
  const apiResponse = data[1];
});

getMetadata(callbackopt)

Get the project's metadata.

Parameters:
Name Type Attributes Description
callback function <optional>

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

metadata object

The machine type's metadata.

apiResponse object

The full API response.

Source:
See:
Example
const Compute = require('@google-cloud/compute');
const compute = new Compute();
const project = compute.project();

project.getMetadata(function(err, metadata, apiResponse) {});

//-
// If the callback is omitted, we'll return a Promise.
//-
project.getMetadata().then(function(data) {
  var metadata = data[0];
  var apiResponse = data[1];
});