MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / getKeyLabels

Function getKeyLabels

kms/getKeyLabels.js:41–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 const keyName = client.cryptoKeyPath(projectId, locationId, keyRingId, keyId);
40
41 async function getKeyLabels() {
42 const [key] = await client.getCryptoKey({
43 name: keyName,
44 });
45
46 for (const k in key.labels) {
47 console.log(`${k}: ${key.labels[k]}`);
48 }
49
50 return key;
51 }
52
53 return getKeyLabels();
54 // [END kms_get_key_labels]

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected