- List sitemaps
- List sites that user have access
- Search analytics for a specific site URL
For this method, you'll need to create a service account, and download a key.
- In the GCP Console, go to the Create service account key page;
- From the Service account drop-down list, select New service account;
- In the Service account name field, enter a name;
- From the Role drop-down list, select Project > Owner or if you wanna more restrict roles you can choose:
cloudfunctions.admin
(Cloud Functions Admin) andiam.serviceAccountUser
(Service Account User);- The service account needs to Cloud Functions Admin to have permission to update the IAM policies;
- Click Create. A JSON file that contains your key downloads to your computer;
- Save the JSON file to a safe place on your local machine (I create a hidden folder and save it in
~/.google-cloud-keys/key.json
); - Update the constant
projectID
with the name of your project atmain.go
;
GOOGLE_APPLICATION_CREDENTIALS=~/.google-cloud-keys/key.json go run *.go