class
Project
Source: project.
A Project object allows you to interact with your Google Compute Engine project.
Methods
new Project(compute)
Example
const Compute = require('@google-cloud/compute');
const compute = new Compute();
const project = compute.project();
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
compute |
|
|
Compute object this project belongs to. |
- See also
Methods
get()
Get a Project object.
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([callback])
Get the project's metadata.
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];
});
Parameters
| Name | Type | Optional | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
callback |
function() |
Yes |
The callback function. Values in
|