resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | google.compute.resource_policies |
Fields
The following fields are returned by SELECT queries:
- get
- list
- aggregated_list
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. 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?) |
creationTimestamp | string | [Output Only] Creation timestamp in RFC3339 text format. |
description | string | |
diskConsistencyGroupPolicy | object | Resource policy for disk consistency groups. (id: ResourcePolicyDiskConsistencyGroupPolicy) |
groupPlacementPolicy | object | Resource policy for instances for placement configuration. (id: ResourcePolicyGroupPlacementPolicy) |
instanceSchedulePolicy | object | Resource policy for scheduling instance operations. (id: ResourcePolicyInstanceSchedulePolicy) |
kind | string | [Output Only] Type of the resource. Always compute#resource_policies for resource policies. (default: compute#resourcePolicy) |
region | string | |
resourceStatus | object | [Output Only] The system status of the resource policy. (id: ResourcePolicyResourceStatus) |
selfLink | string | [Output Only] Server-defined fully-qualified URL for this resource. |
snapshotSchedulePolicy | object | Resource policy for persistent disks for creating snapshots. (id: ResourcePolicySnapshotSchedulePolicy) |
status | string | [Output Only] The status of resource policy creation. |
workloadPolicy | object | Resource policy for defining instance placement for MIGs. (id: ResourcePolicyWorkloadPolicy) |
| Name | Datatype | Description |
|---|---|---|
id | string | [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
etag | string | |
items | array | [Output Only] A list of ResourcePolicy resources. |
kind | string | [Output Only] Type of resource.Always compute#resourcePoliciesList for listsof resourcePolicies (default: compute#resourcePolicyList) |
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 than maxResults, 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] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. 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?) |
creationTimestamp | string | [Output Only] Creation timestamp in RFC3339 text format. |
description | string | |
diskConsistencyGroupPolicy | object | Resource policy for disk consistency groups. (id: ResourcePolicyDiskConsistencyGroupPolicy) |
groupPlacementPolicy | object | Resource policy for instances for placement configuration. (id: ResourcePolicyGroupPlacementPolicy) |
instanceSchedulePolicy | object | Resource policy for scheduling instance operations. (id: ResourcePolicyInstanceSchedulePolicy) |
kind | string | [Output Only] Type of the resource. Always compute#resource_policies for resource policies. (default: compute#resourcePolicy) |
region | string | |
resourceStatus | object | [Output Only] The system status of the resource policy. (id: ResourcePolicyResourceStatus) |
selfLink | string | [Output Only] Server-defined fully-qualified URL for this resource. |
snapshotSchedulePolicy | object | Resource policy for persistent disks for creating snapshots. (id: ResourcePolicySnapshotSchedulePolicy) |
status | string | [Output Only] The status of resource policy creation. |
workloadPolicy | object | Resource policy for defining instance placement for MIGs. (id: ResourcePolicyWorkloadPolicy) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, region, resourcePolicy | Retrieves all information of the specified resource policy. | |
list | select | project, region | filter, maxResults, orderBy, pageToken, returnPartialSuccess | A list all the resource policies that have been configured for the specified project in specified region. |
aggregated_list | select | project | filter, includeAllScopes, maxResults, orderBy, pageToken, returnPartialSuccess, serviceProjectNumber | Retrieves an aggregated list of resource policies. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true. |
insert | insert | project, region | requestId | Creates a new resource policy. |
patch | update | project, region, resourcePolicy | requestId, updateMask | Modify the specified resource policy. |
delete | delete | project, region, resourcePolicy | requestId | Deletes the specified resource policy. |
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 | |
region | string | |
resourcePolicy | string | |
filter | string | |
includeAllScopes | boolean | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean | |
serviceProjectNumber | string (int64) | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
- aggregated_list
Retrieves all information of the specified resource policy.
SELECT
id,
name,
creationTimestamp,
description,
diskConsistencyGroupPolicy,
groupPlacementPolicy,
instanceSchedulePolicy,
kind,
region,
resourceStatus,
selfLink,
snapshotSchedulePolicy,
status,
workloadPolicy
FROM google.compute.resource_policies
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND resourcePolicy = '{{ resourcePolicy }}' -- required
;
A list all the resource policies that have been configured for the specified project in specified region.
SELECT
id,
etag,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.resource_policies
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;
Retrieves an aggregated list of resource policies. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
SELECT
id,
name,
creationTimestamp,
description,
diskConsistencyGroupPolicy,
groupPlacementPolicy,
instanceSchedulePolicy,
kind,
region,
resourceStatus,
selfLink,
snapshotSchedulePolicy,
status,
workloadPolicy
FROM google.compute.resource_policies
WHERE project = '{{ project }}' -- required
AND filter = '{{ filter }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}'
;
INSERT examples
- insert
- Manifest
Creates a new resource policy.
INSERT INTO google.compute.resource_policies (
data__snapshotSchedulePolicy,
data__groupPlacementPolicy,
data__instanceSchedulePolicy,
data__diskConsistencyGroupPolicy,
data__workloadPolicy,
data__kind,
data__id,
data__creationTimestamp,
data__selfLink,
data__region,
data__description,
data__name,
data__status,
data__resourceStatus,
project,
region,
requestId
)
SELECT
'{{ snapshotSchedulePolicy }}',
'{{ groupPlacementPolicy }}',
'{{ instanceSchedulePolicy }}',
'{{ diskConsistencyGroupPolicy }}',
'{{ workloadPolicy }}',
'{{ kind }}',
'{{ id }}',
'{{ creationTimestamp }}',
'{{ selfLink }}',
'{{ region }}',
'{{ description }}',
'{{ name }}',
'{{ status }}',
'{{ resourceStatus }}',
'{{ project }}',
'{{ region }}',
'{{ 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
;
# Description fields are for documentation purposes
- name: resource_policies
props:
- name: project
value: string
description: Required parameter for the resource_policies resource.
- name: region
value: string
description: Required parameter for the resource_policies resource.
- name: snapshotSchedulePolicy
value: object
description: >
Resource policy for persistent disks for creating snapshots.
- name: groupPlacementPolicy
value: object
description: >
Resource policy for instances for placement configuration.
- name: instanceSchedulePolicy
value: object
description: >
Resource policy for scheduling instance operations.
- name: diskConsistencyGroupPolicy
value: object
description: >
Resource policy for disk consistency groups.
- name: workloadPolicy
value: object
description: >
Resource policy for defining instance placement for MIGs.
- name: kind
value: string
description: >
[Output Only] Type of the resource. Always compute#resource_policies for resource policies.
default: compute#resourcePolicy
- name: id
value: string
description: >
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- name: creationTimestamp
value: string
description: >
[Output Only] Creation timestamp in RFC3339 text format.
- name: selfLink
value: string
description: >
[Output Only] Server-defined fully-qualified URL for this resource.
- name: region
value: string
- name: description
value: string
- name: name
value: string
description: >
The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. 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: status
value: string
description: >
[Output Only] The status of resource policy creation.
valid_values: ['CREATING', 'DELETING', 'EXPIRED', 'INVALID', 'READY']
- name: resourceStatus
value: object
description: >
[Output Only] The system status of the resource policy.
- name: requestId
value: string
UPDATE examples
- patch
Modify the specified resource policy.
UPDATE google.compute.resource_policies
SET
data__snapshotSchedulePolicy = '{{ snapshotSchedulePolicy }}',
data__groupPlacementPolicy = '{{ groupPlacementPolicy }}',
data__instanceSchedulePolicy = '{{ instanceSchedulePolicy }}',
data__diskConsistencyGroupPolicy = '{{ diskConsistencyGroupPolicy }}',
data__workloadPolicy = '{{ workloadPolicy }}',
data__kind = '{{ kind }}',
data__id = '{{ id }}',
data__creationTimestamp = '{{ creationTimestamp }}',
data__selfLink = '{{ selfLink }}',
data__region = '{{ region }}',
data__description = '{{ description }}',
data__name = '{{ name }}',
data__status = '{{ status }}',
data__resourceStatus = '{{ resourceStatus }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND resourcePolicy = '{{ resourcePolicy }}' --required
AND requestId = '{{ requestId}}'
AND updateMask = '{{ updateMask}}'
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
- delete
Deletes the specified resource policy.
DELETE FROM google.compute.resource_policies
WHERE project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND resourcePolicy = '{{ resourcePolicy }}' --required
AND requestId = '{{ requestId }}'
;