global_vm_extension_policies
Creates, updates, deletes, gets or lists a global_vm_extension_policies resource.
Overview
| Name | global_vm_extension_policies |
| Type | Resource |
| Id | google.compute.global_vm_extension_policies |
Fields
The following fields are returned by SELECT queries:
- get
- list
- aggregated_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. Provide this property when you create the resource. |
extensionPolicies | object | Required. Map from extension (eg: "cloudops") to its policy configuration. The key is the name of the extension. |
instanceSelectors | array | Optional. Selector to target VMs for a policy. There is a logical "AND" between instance_selectors. |
kind | string | Output only. [Output Only] Type of the resource. Alwayscompute#globalVmExtensionPolicy for globalVmExtensionPolicies. (default: compute#globalVmExtensionPolicy) |
priority | integer (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. |
rolloutOperation | object | Required. The rollout strategy and status. (id: GlobalVmExtensionPolicyRolloutOperation) |
scopedResourceStatus | string | Output 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) |
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. |
updateTimestamp | string | Output only. [Output Only] Update timestamp inRFC3339 text format. |
| Name | Datatype | Description |
|---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
etag | string | |
items | array | A list of GlobalVmExtensionPolicy resources. |
kind | string | Output only. Type of resource. (default: compute#globalVmExtensionPolicyList) |
nextPageToken | string | [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] Informational warning message. |
| Name | Datatype | Description |
|---|
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, globalVmExtensionPolicy | Gets details of a global VM extension policy. | |
list | select | project | returnPartialSuccess, orderBy, filter, maxResults, pageToken | Lists global VM extension policies. |
aggregated_list | select | project | returnPartialSuccess, maxResults, pageToken, filter, serviceProjectNumber, includeAllScopes, orderBy | Retrieves 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. |
insert | insert | project | requestId | Creates a new project level GlobalVmExtensionPolicy. |
update | update | project, globalVmExtensionPolicy | requestId | Updates a global VM extension policy. |
delete | delete | project, globalVmExtensionPolicy | requestId | 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. |
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 |
|---|---|---|
globalVmExtensionPolicy | string | |
project | string | |
filter | string | |
includeAllScopes | boolean | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean | |
serviceProjectNumber | string (int64) |
SELECT examples
- get
- list
- aggregated_list
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
;
Lists global VM extension policies.
SELECT
id,
etag,
items,
kind,
nextPageToken,
selfLink,
unreachables,
warning
FROM google.compute.global_vm_extension_policies
WHERE project = '{{ project }}' -- required
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
;
Retrieves the list of all VM Extension Policy resources
available to the specified project.
To prevent failure, it's recommended that you set thereturnPartialSuccess parameter to true.
SELECT
*
FROM google.compute.global_vm_extension_policies
WHERE project = '{{ project }}' -- required
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND orderBy = '{{ orderBy }}'
;
INSERT examples
- insert
- Manifest
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
;
# Description fields are for documentation purposes
- name: global_vm_extension_policies
props:
- name: project
value: "{{ project }}"
description: Required parameter for the global_vm_extension_policies resource.
- name: rolloutOperation
description: |
Required. The rollout strategy and status.
value:
rolloutInput:
name: "{{ name }}"
predefinedRolloutPlan: "{{ predefinedRolloutPlan }}"
conflictBehavior: "{{ conflictBehavior }}"
retryUuid: "{{ retryUuid }}"
rolloutStatus:
currentRollouts:
- rollout: "{{ rollout }}"
rolloutPlan: "{{ rolloutPlan }}"
state: "{{ state }}"
locationRolloutStatus: "{{ locationRolloutStatus }}"
previousRollout:
rollout: "{{ rollout }}"
rolloutPlan: "{{ rolloutPlan }}"
state: "{{ state }}"
locationRolloutStatus: "{{ locationRolloutStatus }}"
- 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: priority
value: {{ priority }}
description: |
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.
- name: description
value: "{{ description }}"
description: |
An optional description of this resource. Provide this property when you
create the resource.
- name: extensionPolicies
value: "{{ extensionPolicies }}"
description: |
Required. Map from extension (eg: "cloudops") to its policy configuration.
The key is the name of the extension.
- name: instanceSelectors
description: |
Optional. Selector to target VMs for a policy.
There is a logical "AND" between instance_selectors.
value:
- labelSelector:
inclusionLabels: "{{ inclusionLabels }}"
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- update
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
- delete
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 }}'
;