tra-analysis/website/functions/node_modules/gcp-metadata/README.md
2019-01-06 13:14:45 -06:00

875 B

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