Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

docs: update README.md with correct links #66

Merged
merged 1 commit into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .cloud-repo-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"requiresKeyFile": true,
"requiresProjectId": true,
"product": "asset",
"client_reference_url": "https://cloud.google.com/nodejs/docs/reference/asset/latest/",
"release_quality": "alpha",
"samples": [
]
Expand Down
52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Google Cloud Asset API: Node.js Client](https://github.com/googleapis/nodejs-asset)
# [Google Cloud Asset Inventory: Node.js Client](https://github.com/googleapis/nodejs-asset)

[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style&#x3D;flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset)

The [Cloud Asset API](https://cloud.google.com/asset/docs) manages the history and inventory of cloud resources.
[Cloud Asset Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) is a storage service that keeps a five week history of Google Cloud Platform (GCP) asset metadata. It allows you to export all asset metadata at a certain timestamp or timeframe.


* [Using the client library](#using-the-client-library)
Expand All @@ -22,7 +22,7 @@ The [Cloud Asset API](https://cloud.google.com/asset/docs) manages the history a

1. [Enable billing for your project][billing].

1. [Enable the Google Cloud Asset API API][enable_api].
1. [Enable the Google Cloud Asset Inventory API][enable_api].

1. [Set up authentication with a service account][auth] so you can access the
API from your local workstation.
Expand All @@ -34,19 +34,36 @@ The [Cloud Asset API](https://cloud.google.com/asset/docs) manages the history a
1. Try an example:

```javascript
// Imports the Google Cloud client library
const asset = require('@google-cloud/asset');

// eslint-disable-next-line
const client = new asset.AssetServiceClient({
projectId: 'your-project-id',
keyFilename: '/path/to/keyfile.json',
});

const asset = require('@google-cloud/asset');
const client = new asset.v1beta1.AssetServiceClient({
// optional auth parameters.
});

// Your Google Cloud Platform project ID
const projectId = process.env.GCLOUD_PROJECT;
const projectResource = client.projectPath(projectId);

// var dumpFilePath = 'Dump file path, e.g.: gs://<my_bucket>/<my_asset_file>'
const outputConfig = {
gcsDestination: {
uri: dumpFilePath,
},
};
const request = {
parent: projectResource,
outputConfig: outputConfig,
};

// Handle the operation using the promise pattern.
const [operation] = await client.exportAssets(request);
// Operation#promise starts polling for the completion of the operation.
const [result] = await operation.promise();
// Do things with with the response.
console.log(result);
```


The [Cloud Asset API Node.js Client API Reference][client-docs] documentation
The [Cloud Asset Node.js Client API Reference][client-docs] documentation
also contains samples.

## Versioning
Expand All @@ -73,20 +90,19 @@ See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/master/LICENSE)

## What's Next

* [Cloud Asset API Documentation][product-docs]
* [Cloud Asset API Node.js Client API Reference][client-docs]
* [Cloud Asset Documentation][product-docs]
* [Cloud Asset Node.js Client API Reference][client-docs]
* [github.com/googleapis/nodejs-asset](https://github.com/googleapis/nodejs-asset)

Read more about the client libraries for Cloud APIs, including the older
Google APIs Client Libraries, in [Client Libraries Explained][explained].

[explained]: https://cloud.google.com/apis/docs/client-libraries-explained

[client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest/
[client-docs]:
[product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=asset.googleapis.com
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudasset.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started