tra-analysis/website/functions/node_modules/gcp-metadata
2019-01-06 13:14:45 -06:00
..
build/src push all website files 2019-01-06 13:14:45 -06:00
LICENSE push all website files 2019-01-06 13:14:45 -06:00
package.json push all website files 2019-01-06 13:14:45 -06:00
README.md push all website files 2019-01-06 13:14:45 -06:00

gcp-metadata

Get the metadata from a Google Cloud Platform environment

codecov

$ npm install --save gcp-metadata
const gcpMetadata = require('gcp-metadata');

Access all metadata

const res = await gcpMetadata.instance();
console.log(res.data); // ... All metadata properties

Access specific properties

const res = await gcpMetadata.instance('hostname');
console.log(res.data) // ...All metadata properties

Access specific properties with query parameters

const res = await gcpMetadata.instance({
  property: 'tags',
  params: { alt: 'text' }
});
console.log(res.data) // ...Tags as newline-delimited list