These samples show how to use the Google Cloud DLP API.
-
Enable APIs - Enable the DLP API and create a new project or select an existing project.
-
Install and Initialize Cloud SDK Follow instructions from the available quickstarts
-
Clone the repo and cd into this directory
$ git clone https://github.com/GoogleCloudPlatform/google-cloud-ruby $ cd google-cloud-ruby/google-cloud-dlp/samples -
Install Dependencies via Bundler.
bundle install -
Create a Service Account key file - This file can be used to authenticate to Google Cloud Platform services from any environment. To use the file, set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to the path to the key file, for example:export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account.json -
Set your Project Environment Variables
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" -
Run samples
Usage: ruby sample.rb <command> [arguments] Commands: inspect_string <content> <max_findings> Inspect a string. inspect_file <filename> <max_findings> Inspect a local file. Environment variables: GOOGLE_CLOUD_PROJECT must be set to your Google Cloud project ID GOOGLE_APPLICATION_CREDENTIALS set to the path to your JSON credentials
- See CONTRIBUTING.md
- See LICENSE