Skip to main content

global_vm_extension_policies

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

Overview

Nameglobal_vm_extension_policies
TypeResource
Idgoogle.compute.global_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. Provide this property when you create the resource.
extensionPoliciesobjectRequired. Map from extension (eg: "cloudops") to its policy configuration. The key is the name of the extension.
instanceSelectorsarrayOptional. Selector to target VMs for a policy. There is a logical "AND" between instance_selectors.
kindstringOutput only. [Output Only] Type of the resource. Alwayscompute#globalVmExtensionPolicy for globalVmExtensionPolicies. (default: compute#globalVmExtensionPolicy)
priorityinteger (int32)Optional. Used to resolve conflicts when multiple policies are active for the same extension. Defaults to 0. Larger the number, higher the priority. When the priority is the same, the policy with the newer create time has higher priority.
rolloutOperationobjectRequired. The rollout strategy and status. (id: GlobalVmExtensionPolicyRolloutOperation)
scopedResourceStatusstringOutput only. [Output Only] The scoped resource status. It's only for tracking the purging status of the policy. (SCOPED_RESOURCE_STATUS_DELETING, SCOPED_RESOURCE_STATUS_UNSPECIFIED)
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.
updateTimestampstringOutput only. [Output Only] Update timestamp inRFC3339 text format.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, globalVmExtensionPolicyGets details of a global VM extension policy.
listselectprojectreturnPartialSuccess, orderBy, filter, maxResults, pageTokenLists global VM extension policies.
aggregated_listselectprojectreturnPartialSuccess, maxResults, pageToken, filter, serviceProjectNumber, includeAllScopes, orderByRetrieves the list of all VM Extension Policy resources
available to the specified project.

To prevent failure, it's recommended that you set the
returnPartialSuccess parameter to true.
insertinsertprojectrequestIdCreates a new project level GlobalVmExtensionPolicy.
updateupdateproject, globalVmExtensionPolicyrequestIdUpdates a global VM extension policy.
deletedeleteproject, globalVmExtensionPolicyrequestIdPurge scoped resources (zonal policies) from a global VM extension
policy, and then delete the global VM extension policy. Purge of the scoped
resources is a pre-condition of the global VM extension policy deletion.
The deletion of the global VM extension policy happens after the purge
rollout is done, so it's not a part of the LRO. It's an automatic process
that triggers in the backend.

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
globalVmExtensionPolicystring
projectstring
filterstring
includeAllScopesboolean
maxResultsinteger (uint32)
orderBystring
pageTokenstring
requestIdstring
returnPartialSuccessboolean
serviceProjectNumberstring (int64)

SELECT examples

Gets details of a global VM extension policy.

SELECT
id,
name,
creationTimestamp,
description,
extensionPolicies,
instanceSelectors,
kind,
priority,
rolloutOperation,
scopedResourceStatus,
selfLink,
selfLinkWithId,
updateTimestamp
FROM google.compute.global_vm_extension_policies
WHERE project = '{{ project }}' -- required
AND globalVmExtensionPolicy = '{{ globalVmExtensionPolicy }}' -- required
;

INSERT examples

Creates a new project level GlobalVmExtensionPolicy.

INSERT INTO google.compute.global_vm_extension_policies (
data__rolloutOperation,
data__name,
data__priority,
data__description,
data__extensionPolicies,
data__instanceSelectors,
project,
requestId
)
SELECT
'{{ rolloutOperation }}',
'{{ name }}',
{{ priority }},
'{{ description }}',
'{{ extensionPolicies }}',
'{{ instanceSelectors }}',
'{{ project }}',
'{{ 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

Updates a global VM extension policy.

UPDATE google.compute.global_vm_extension_policies
SET
data__rolloutOperation = '{{ rolloutOperation }}',
data__name = '{{ name }}',
data__priority = {{ priority }},
data__description = '{{ description }}',
data__extensionPolicies = '{{ extensionPolicies }}',
data__instanceSelectors = '{{ instanceSelectors }}'
WHERE
project = '{{ project }}' --required
AND globalVmExtensionPolicy = '{{ globalVmExtensionPolicy }}' --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

Purge scoped resources (zonal policies) from a global VM extension
policy, and then delete the global VM extension policy. Purge of the scoped
resources is a pre-condition of the global VM extension policy deletion.
The deletion of the global VM extension policy happens after the purge
rollout is done, so it's not a part of the LRO. It's an automatic process
that triggers in the backend.

DELETE FROM google.compute.global_vm_extension_policies
WHERE project = '{{ project }}' --required
AND globalVmExtensionPolicy = '{{ globalVmExtensionPolicy }}' --required
AND requestId = '{{ requestId }}'
;