I need to list all the compute instance snapshots successfully created in a project (only for compute instance types), along with the compute engine names.
I am using this API: https://compute.googleapis.com/compute/v1/projects/my-project/global/snapshots
It lists the snapshot and I get the response like this:
"items": [
{
"id": "36734343434334343",
"creationTimestamp": "2020-09-16T11:38:54.780-07:00",
"name": "backup-data1-us-central1-c-3234234324-202009161",
"status": "READY",
"sourceDisk": "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c/disks/backup-data1",
"sourceDiskId": "323434232434970709",
"diskSizeGb": "10",
"storageBytes": "452416",
"storageBytesStatus": "UP_TO_DATE",
"selfLink": "https://www.googleapis.com/compute/v1/projects/my-project/global/snapshots/amtest-backup-data1-us-central1-c-3234234324-202009161",
"labelFingerprint": "23WmSpBrSM=",
"storageLocations": [
"us-central1"
],
"autoCreated": true,
"downloadBytes": "456717",
"kind": "compute#snapshot"
},
{
"id": "343486082509657007",
"creationTimestamp": "2020-09-17T11:38:56.840-07:00",
"name": "backup-data1-us-central1-c-3234234324-202009161",
"status": "READY",
"sourceDisk": "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c/disks/backup-data1",
"sourceDiskId": "323434232434970709",
"diskSizeGb": "10",
"storageBytes": "0",
"storageBytesStatus": "UP_TO_DATE",
"selfLink": "https://www.googleapis.com/compute/v1/projects/my-project/global/snapshots/amtest-backup-data1-us-central1-c-20200917183856-n2ipabzb",
"labelFingerprint": "23WmSpB8rSM=",
"storageLocations": [
"us-central1"
],
"autoCreated": true,
"downloadBytes": "456717",
"kind": "compute#snapshot"
}
From this information, I need to find out what is the VM which is associated with this snapshot. How can I find out the compute engine for which this snapshot is created? Is there any REST API for finding the compute engine from the snapshot?