How to do it...

In this recipe, we take an input data.csv which has some sensitive data. A Python program parses the file and generates a request JSON file for the API. The second part of the same Python program validates the response and gives a custom output to the user:

  1. Navigate to the Chapter04/using_dlp_api folder.
  2. The Python program check-with-dlp.py reads the data from the data.csv file and generates a request. The request is sent to the DLP API and the response is parsed to find if there is sensitive information in the data sent. The first part of the code is the initial setup for the program:
# -*- coding: utf-8 -*-"""@author: Legorie# The code identifies sensitive information and logs it on the console"""import jsonimport requests ...

Get Google Cloud Platform Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.