zone_vm_extension_policies
Creates, updates, deletes, gets or lists a zone_vm_extension_policies resource.
Overview
| Name | zone_vm_extension_policies |
| Type | Resource |
| Id | google.compute.zone_vm_extension_policies |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply withRFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. (pattern: [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?) |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
description | string | An optional description of this resource. |
extensionPolicies | object | Required. A map of extension names (for example, "ops-agent") to their corresponding policy configurations. |
globalResourceLink | string | Optional. Output only. [Output Only] Link to the global policy that manages this zone policy, if applicable. |
instanceSelectors | array | Optional. Selectors to target VMs for this policy. VMs are selected if they match any of the provided selectors (logical OR). If this list is empty, the policy applies to all VMs. |
kind | string | Output only. [Output Only] Type of the resource. Alwayscompute#vmExtensionPolicy. (default: compute#vmExtensionPolicy) |
managedByGlobal | boolean | Optional. Output only. [Output Only] Indicates if this policy is managed by a global policy. |
priority | integer (int32) | Optional. Priority of this policy. Used to resolve conflicts when multiple policies apply to the same extension. The policy priority is an integer from 0 to 65535, inclusive. Lower integers indicate higher priorities. If you do not specify a priority when creating a rule, it is assigned a priority of 1000. If priorities are equal, the policy with the most recent creation timestamp takes precedence. |
selfLink | string | Output only. [Output Only] Server-defined fully-qualified URL for this resource. |
selfLinkWithId | string | Output only. [Output Only] Server-defined URL for this resource's resource id. |
state | string | Optional. Output only. [Output Only] Current state of the policy: ACTIVE or DELETING. (ACTIVE, DELETING, STATE_UNSPECIFIED) |
updateTimestamp | string | Output only. [Output Only] Update timestamp inRFC3339 text format. |
| Name | Datatype | Description |
|---|---|---|
id | string | Output only. [Output Only] Unique identifier for the resource; defined by the server. |
etag | string | Output only. [Output Only] Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a VmExtensionPolicy. An up-to-date fingerprint must be provided in order to update the VmExtensionPolicy. To see the latest value of the fingerprint, make a get() request to retrieve a VmExtensionPolicy. |
items | array | Output only. [Output Only] A list of VM extension policy resources. |
kind | string | Output only. Type of resource. (default: compute#vmExtensionPolicyList) |
nextPageToken | string | Output only. [Output Only] 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 | Output only. [Output Only] Server-defined URL for this resource. |
unreachables | array | Output only. [Output Only] Unreachable resources. |
warning | object | Output only. [Output Only] Informational warning message. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, zone, vmExtensionPolicy | Retrieves details of a specific zone VM extension policy within a project. | |
list | select | project, zone | returnPartialSuccess, maxResults, pageToken, filter, orderBy | Lists all VM extension policies within a specific zone for a project. |
insert | insert | project, zone | requestId | Creates a new zone-level VM extension policy within a project. |
update | update | project, zone, vmExtensionPolicy | requestId | Modifies an existing zone VM extension policy within a project. |
delete | delete | project, zone, vmExtensionPolicy | requestId | Deletes a specified zone VM extension policy within a project. |
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 |
|---|---|---|
project | string | |
vmExtensionPolicy | string | |
zone | string | |
filter | string | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean |
SELECT examples
- get
- list
Retrieves details of a specific zone VM extension policy within a project.
SELECT
id,
name,
creationTimestamp,
description,
extensionPolicies,
globalResourceLink,
instanceSelectors,
kind,
managedByGlobal,
priority,
selfLink,
selfLinkWithId,
state,
updateTimestamp
FROM google.compute.zone_vm_extension_policies
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND vmExtensionPolicy = '{{ vmExtensionPolicy }}' -- required
;
Lists all VM extension policies within a specific zone for a project.
SELECT
id,
etag,
items,
kind,
nextPageToken,
selfLink,
unreachables,
warning
FROM google.compute.zone_vm_extension_policies
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
;
INSERT examples
- insert
- Manifest
Creates a new zone-level VM extension policy within a project.
INSERT INTO google.compute.zone_vm_extension_policies (
data__priority,
data__name,
data__instanceSelectors,
data__description,
data__extensionPolicies,
project,
zone,
requestId
)
SELECT
{{ priority }},
'{{ name }}',
'{{ instanceSelectors }}',
'{{ description }}',
'{{ extensionPolicies }}',
'{{ project }}',
'{{ zone }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;
# Description fields are for documentation purposes
- name: zone_vm_extension_policies
props:
- name: project
value: "{{ project }}"
description: Required parameter for the zone_vm_extension_policies resource.
- name: zone
value: "{{ zone }}"
description: Required parameter for the zone_vm_extension_policies resource.
- name: priority
value: {{ priority }}
description: |
Optional. Priority of this policy. Used to resolve conflicts when multiple policies
apply to the same extension.
The policy priority is an integer from 0 to 65535, inclusive. Lower
integers indicate higher priorities. If you do not specify a priority when
creating a rule, it is assigned a priority of 1000. If priorities are
equal, the policy with the most recent creation timestamp takes precedence.
- name: name
value: "{{ name }}"
description: |
Name of the resource. Provided by the client when the resource is created.
The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `[a-z]([-a-z0-9]*[a-z0-9])?`
which means the first character must be a lowercase letter, and all
following characters must be a dash, lowercase letter, or digit, except
the last character, which cannot be a dash.
- name: instanceSelectors
description: |
Optional. Selectors to target VMs for this policy. VMs are selected if they match
*any* of the provided selectors (logical OR). If this list is empty, the
policy applies to all VMs.
value:
- labelSelector:
inclusionLabels: "{{ inclusionLabels }}"
- name: description
value: "{{ description }}"
description: |
An optional description of this resource.
- name: extensionPolicies
value: "{{ extensionPolicies }}"
description: |
Required. A map of extension names (for example, "ops-agent") to their corresponding
policy configurations.
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- update
Modifies an existing zone VM extension policy within a project.
UPDATE google.compute.zone_vm_extension_policies
SET
data__priority = {{ priority }},
data__name = '{{ name }}',
data__instanceSelectors = '{{ instanceSelectors }}',
data__description = '{{ description }}',
data__extensionPolicies = '{{ extensionPolicies }}'
WHERE
project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND vmExtensionPolicy = '{{ vmExtensionPolicy }}' --required
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;
DELETE examples
- delete
Deletes a specified zone VM extension policy within a project.
DELETE FROM google.compute.zone_vm_extension_policies
WHERE project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND vmExtensionPolicy = '{{ vmExtensionPolicy }}' --required
AND requestId = '{{ requestId }}'
;