(name)
| 15 | 'use strict'; |
| 16 | |
| 17 | async function main(name) { |
| 18 | // [START secretmanager_view_secret_annotations] |
| 19 | /** |
| 20 | * TODO(developer): Uncomment these variables before running the sample. |
| 21 | */ |
| 22 | // const parent = 'projects/my-project/secrets/my-secret'; |
| 23 | |
| 24 | // Imports the Secret Manager library |
| 25 | const {SecretManagerServiceClient} = require('@google-cloud/secret-manager'); |
| 26 | |
| 27 | // Instantiates a client |
| 28 | const client = new SecretManagerServiceClient(); |
| 29 | |
| 30 | async function viewSecretAnnotations() { |
| 31 | const [secret] = await client.getSecret({ |
| 32 | name: name, |
| 33 | }); |
| 34 | |
| 35 | for (const key in secret.annotations) { |
| 36 | console.log(`${key} : ${secret.annotations[key]}`); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | viewSecretAnnotations(); |
| 41 | // [END secretmanager_view_secret_annotations] |
| 42 | } |
| 43 | |
| 44 | const args = process.argv.slice(2); |
| 45 | main(...args).catch(console.error); |
no test coverage detected