Project Logistics, UTilization and Operations (PLUTO)
Open Cloud Shell
Clone in the https://github.com/ROIGCP/PLUTO
repo
Command: git clone https://github.com/ROIGCP/PLUTO
Command: cd PLUTO
Make sure you have a project set
Command: gcloud config set project YOURPROJECTNAME
Bucket named projectid-bucket
Command: gsutil mb gs://$GOOGLE_CLOUD_PROJECT"-bucket"
BigQuery Dataset called "activities"
Command: bq mk activities
BigQuery Table called "resources" - starting schema
Command: bq mk --schema messages:STRING -t activities.resources
PubSub Topic called "activities"
Command: gcloud pubsub topics create activities
PubSub Subscription called "activites-catchall"
Command : gcloud pubsub subscriptions create activites-catchall --topic projects/$GOOGLE_CLOUD_PROJECT/topics/activities
Create a Cloud Function
Python
Trigger by topic activities
Use the sample in CloudFunction folder
Enabling the APIs
Command: gcloud services enable cloudasset.googleapis.com
Command: gcloud services enable cloudresourcemanager.googleapis.com
Command: gcloud services list
Asset Export to BigQuery Example
Command: gcloud asset export --project $GOOGLE_CLOUD_PROJECT --bigquery-table export --bigquery-dataset activities
Asset Feed Creation
Command: gcloud asset feeds create activities --project=$GOOGLE_CLOUD_PROJECT --content-type=resource --asset-types="compute.googleapis.com.*" --pubsub-topic=projects/$GOOGLE_CLOUD_PROJECT/topics/activities