Skip to main content

hosts

Creates, updates, deletes, gets or lists a hosts resource.

Overview

Namehosts
TypeResource
Idgoogle.compute.hosts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uint64)Output only. The unique identifier for this resource. This identifier is defined by the server.
namestringOutput only. The name of the host.
aliasLinksarrayOutput only. All aliases for this resource. e.g. projects/123/zones/us-centra1-a/reservation/r1/reservationBlock/b1/hosts/h1
creationTimestampstringOutput only. The creation timestamp, formatted asRFC3339 text.
descriptionstringAn optional description of this resource.
kindstringOutput only. The type of resource. Alwayscompute#host for hosts. (default: compute#host)
selfLinkstringOutput only. The self link of the host.
selfLinkWithIdstringOutput only. The self link with id of the host.
statestringOutput only. The state of the host. (ACTIVE, CREATING, DELETING, STATE_UNSPECIFIED, UNAVAILABLE)
statusobjectOutput only. The status of the host (id: HostStatus)
zonestringOutput only. The zone in which the host resides.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, zone, association, hostRetrieves information about the specified host.
listselectproject, zone, associationorderBy, maxResults, pageToken, filter, returnPartialSuccessRetrieves a list of hosts.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
associationstring
hoststring
projectstring
zonestring
filterstring
maxResultsinteger (uint32)
orderBystring
pageTokenstring
returnPartialSuccessboolean

SELECT examples

Retrieves information about the specified host.

SELECT
id,
name,
aliasLinks,
creationTimestamp,
description,
kind,
selfLink,
selfLinkWithId,
state,
status,
zone
FROM google.compute.hosts
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND association = '{{ association }}' -- required
AND host = '{{ host }}' -- required
;