How to read pub sub alerts using python in cloud functions and read the json

146 Views Asked by At

I am trying to read the alerts from pub/sub topics message which is integrated with the security center in the GCP console using the Cloud function with python code. Is there any way to read the alerts resource type and check its status and make changes to that resource using python? Since I have tried searching all docs I didn't get the proper doc on this part. Can anyone guide me on this?

import base64
def hello_pubsub(event, context):
  pubsub_message = base64.b64decode(event['data']).decode('utf-8')
  print(pubsub_message)
0

There are 0 best solutions below