Constructor
new Project(compute)
Parameters:
| Name | Type | Description |
|---|---|---|
compute |
Compute |
Compute object this project belongs to. |
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(callbackopt)
Get the project's metadata.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
callback |
function |
<optional> |
The callback function. Properties
|
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];
});