Skip to content

Commit

Permalink
Show proper response structure in vm.getMetadata example (#169)
Browse files Browse the repository at this point in the history
This updates the documentation for `vm.getMetadata` calls to show the
real response structure returned by calls using `Promise`s.

- [X] Appropriate docs were updated (if necessary)
  • Loading branch information
pickypg authored and stephenplusplus committed Oct 2, 2018
1 parent 8dbbd10 commit 60e2cc8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/google-cloud-compute/src/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,12 @@ function VM(zone, name) {
* // If the callback is omitted, we'll return a Promise.
* //-
* vm.getMetadata().then(function(data) {
* // Representation of this VM as the API sees it.
* const metadata = data[0];
* const apiResponse = data[1];
*
* // Custom metadata and predefined keys.
* const customMetadata = metadata.metadata;
* });
*/
getMetadata: true,
Expand Down

0 comments on commit 60e2cc8

Please sign in to comment.