List Compute Instances
Retrieves the list of instances contained within the specified zone.
External Documentation
To learn more, visit the GCP documentation.
Basic Parameters
Parameter | Description |
---|---|
Project | Project ID for this request. |
Return All Pages | Automatically fetch all resources, page by page. |
Zone | The name of the zone for this request. |
Advanced Parameters
Parameter | Description |
---|---|
Filter | A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either = , != , > , or < . For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance . You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) |
Max Results | The maximum number of results per page that should be returned. If the number of available results is larger than maxResults , Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500 , inclusive. (Default: 500 ). |
Order By | Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc" . This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. |
Return Partial Success | Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. |
Example Output
{
"kind": "compute#instanceList",
"id": "https://blinkops.com",
"items": [
{
"kind": "compute#instance",
"id": "9167772395593820681",
"creationTimestamp": "2022-12-29T09:56:54.771-08:00",
"name": "test-instance",
"description": "",
"tags": {
"fingerprint": "42WmSpB8rSM="
},
"machineType": "https://blinkops.com",
"status": "RUNNING",
"zone": "https://blinkops.com",
"canIpForward": false,
"networkInterfaces": [
{
"kind": "compute#networkInterface",
"network": "https://blinkops.com",
"subnetwork": "https://blinkops.com",
"networkIP": "1.1.1.1",
"name": "nic0",
"accessConfigs": [
{
"kind": "compute#accessConfig",
"type": "ONE_TO_ONE_NAT",
"name": "External NAT",
"natIP": "1.1.1.1",
"networkTier": "PREMIUM"
}
],
"fingerprint": "xkwN6FFa7Tw=",
"stackType": "IPV4_ONLY"
}
],
"disks": [
{
"kind": "compute#attachedDisk",
"type": "PERSISTENT",
"mode": "READ_WRITE",
"source": "https://blinkops.com",
"deviceName": "test-instance",
"index": 0,
"boot": true,
"autoDelete": true,
"licenses": [
"https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-11-bullseye"
],
"interface": "SCSI",
"guestOsFeatures": [
{
"type": "UEFI_COMPATIBLE"
},
{
"type": "VIRTIO_SCSI_MULTIQUEUE"
},
{
"type": "GVNIC"
}
],
"diskSizeGb": "10",
"architecture": "X86_64"
}
],
"metadata": {
"kind": "compute#metadata",
"fingerprint": "5c6Q1lcqqGY="
},
"serviceAccounts": [
{
"email": "test@blinkops.com",
"scopes": [
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring.write",
"https://www.googleapis.com/auth/servicecontrol",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/trace.append"
]
}
],
"selfLink": "https://blinkops.com",
"scheduling": {
"onHostMaintenance": "MIGRATE",
"automaticRestart": true,
"preemptible": false,
"provisioningModel": "STANDARD"
},
"cpuPlatform": "Intel Broadwell",
"labelFingerprint": "42WmSpB8rSM=",
"startRestricted": false,
"deletionProtection": false,
"reservationAffinity": {
"consumeReservationType": "ANY_RESERVATION"
},
"displayDevice": {
"enableDisplay": false
},
"shieldedInstanceConfig": {
"enableSecureBoot": false,
"enableVtpm": true,
"enableIntegrityMonitoring": true
},
"shieldedInstanceIntegrityPolicy": {
"updateAutoLearnPolicy": true
},
"confidentialInstanceConfig": {
"enableConfidentialCompute": false
},
"fingerprint": "_tRWvOmUzR0=",
"lastStartTimestamp": "2022-12-29T09:57:02.305-08:00",
"keyRevocationActionType": "NONE"
}
],
"selfLink": "https://blinkops.com"
}
Workflow Library Example
List Compute Instances with Gcp and Send Results Via Email
Preview this Workflow on desktop