Skip to main content

instances_resource_policies

Creates, updates, deletes, gets or lists an instances_resource_policies resource.

Overview

Nameinstances_resource_policies
TypeResource
Idgoogle.compute.instances_resource_policies

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
add_resource_policiesinsertproject, zone, instancerequestIdAdds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.
remove_resource_policiesdeleteproject, zone, instancerequestIdRemoves resource policies from an instance.

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
instancestring
projectstring
zonestring
requestIdstring

INSERT examples

Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.

INSERT INTO google.compute.instances_resource_policies (
data__resourcePolicies,
project,
zone,
instance,
requestId
)
SELECT
'{{ resourcePolicies }}',
'{{ project }}',
'{{ zone }}',
'{{ instance }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;

DELETE examples

Removes resource policies from an instance.

DELETE FROM google.compute.instances_resource_policies
WHERE project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND instance = '{{ instance }}' --required
AND requestId = '{{ requestId }}';