mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-13 22:56:18 +00:00
875 B
875 B
gcp-metadata
Get the metadata from a Google Cloud Platform environment
$ 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