hosts
Creates, updates, deletes, gets or lists a hosts resource.
Overview
| Name | hosts |
| Type | Resource |
| Id | google.compute.hosts |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. The unique identifier for this resource. This identifier is defined by the server. |
name | string | Output only. The name of the host. |
aliasLinks | array | Output only. All aliases for this resource. e.g. projects/123/zones/us-centra1-a/reservation/r1/reservationBlock/b1/hosts/h1 |
creationTimestamp | string | Output only. The creation timestamp, formatted asRFC3339 text. |
description | string | An optional description of this resource. |
kind | string | Output only. The type of resource. Alwayscompute#host for hosts. (default: compute#host) |
selfLink | string | Output only. The self link of the host. |
selfLinkWithId | string | Output only. The self link with id of the host. |
state | string | Output only. The state of the host. (ACTIVE, CREATING, DELETING, STATE_UNSPECIFIED, UNAVAILABLE) |
status | object | Output only. The status of the host (id: HostStatus) |
zone | string | Output only. The zone in which the host resides. |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the resource; defined by the server. |
etag | string | |
items | array | A list of host resources. |
kind | string | The type of resource. Always compute#host for a list of hosts. (default: compute#hostList) |
nextPageToken | string | This token allows you to get the next page of results for list requests. If the number of results is larger thanmaxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. |
selfLink | string | The server-defined URL for this resource. |
unreachables | array | Unreachable resources. end_interface: MixerListResponseWithEtagBuilder |
warning | object | An informational warning message. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, zone, association, host | Retrieves information about the specified host. | |
list | select | project, zone, association | orderBy, maxResults, pageToken, filter, returnPartialSuccess | Retrieves 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.
| Name | Datatype | Description |
|---|---|---|
association | string | |
host | string | |
project | string | |
zone | string | |
filter | string | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
returnPartialSuccess | boolean |
SELECT examples
- get
- list
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
;
Retrieves a list of hosts.
SELECT
id,
etag,
items,
kind,
nextPageToken,
selfLink,
unreachables,
warning
FROM google.compute.hosts
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND association = '{{ association }}' -- required
AND orderBy = '{{ orderBy }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;