Skip to main content

zone_vm_extension_policies

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

Overview

Namezone_vm_extension_policies
TypeResource
Idgoogle.compute.zone_vm_extension_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uint64)Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.
namestringName 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])?)
creationTimestampstringOutput only. [Output Only] Creation timestamp inRFC3339 text format.
descriptionstringAn optional description of this resource.
extensionPoliciesobjectRequired. A map of extension names (for example, "ops-agent") to their corresponding policy configurations.
globalResourceLinkstringOptional. Output only. [Output Only] Link to the global policy that manages this zone policy, if applicable.
instanceSelectorsarrayOptional. 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.
kindstringOutput only. [Output Only] Type of the resource. Alwayscompute#vmExtensionPolicy. (default: compute#vmExtensionPolicy)
managedByGlobalbooleanOptional. Output only. [Output Only] Indicates if this policy is managed by a global policy.
priorityinteger (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.
selfLinkstringOutput only. [Output Only] Server-defined fully-qualified URL for this resource.
selfLinkWithIdstringOutput only. [Output Only] Server-defined URL for this resource's resource id.
statestringOptional. Output only. [Output Only] Current state of the policy: ACTIVE or DELETING. (ACTIVE, DELETING, STATE_UNSPECIFIED)
updateTimestampstringOutput only. [Output Only] Update timestamp inRFC3339 text format.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, zone, vmExtensionPolicyRetrieves details of a specific zone VM extension policy within a project.
listselectproject, zonereturnPartialSuccess, maxResults, pageToken, filter, orderByLists all VM extension policies within a specific zone for a project.
insertinsertproject, zonerequestIdCreates a new zone-level VM extension policy within a project.
updateupdateproject, zone, vmExtensionPolicyrequestIdModifies an existing zone VM extension policy within a project.
deletedeleteproject, zone, vmExtensionPolicyrequestIdDeletes 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.

NameDatatypeDescription
projectstring
vmExtensionPolicystring
zonestring
filterstring
maxResultsinteger (uint32)
orderBystring
pageTokenstring
requestIdstring
returnPartialSuccessboolean

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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 }}'
;