Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Google
Cloud Platform logo

Google Cloud DLP API Samples

Description

These samples show how to use the Google Cloud DLP API.

Build and Run

  1. Enable APIs - Enable the DLP API and create a new project or select an existing project.

  2. Install and Initialize Cloud SDK Follow instructions from the available quickstarts

  3. 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
    
  4. Install Dependencies via Bundler.

    bundle install

  5. 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_CREDENTIALS environment variable to the path to the key file, for example:

    export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account.json

  6. Set your Project Environment Variables

    export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"

  7. 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
    

Contributing changes

Licensing