---
title: "PATCH /projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}"
method: PATCH
path: "/projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}"
tags: ["resourcePolicies"]
---

# PATCH /projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}

`PATCH /projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}`

Modify the specified resource policy.

## Path parameters

- `project` string, required
- `region` string, required
- `resourcePolicy` string, required

## Query parameters

- `requestId` string
- `updateMask` string

## Request body

- ResourcePolicy — Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them toschedule persistent disk snapshots.
  - `diskConsistencyGroupPolicy` ResourcePolicyDiskConsistencyGroupPolicy — Resource policy for disk consistency groups.
  - `status` 'CREATING' | 'DELETING' | 'EXPIRED' | 'INVALID' | 'READY' — Output only. [Output Only] The status of resource policy creation.
  - `id` string, uint64 — Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.
  - `resourceStatus` ResourcePolicyResourceStatus — Contains output only fields. Use this sub-message for all output fields set on ResourcePolicy. The internal structure of this "status" field should mimic the structure of ResourcePolicy proto specification.
    - `instanceSchedulePolicy` ResourcePolicyResourceStatusInstanceSchedulePolicyStatus
      - `nextRunStartTime` string — Output only. [Output Only] The next time the schedule is planned to run. The actual time might be slightly different. The timestamp is an RFC3339 string.
      - `lastRunStartTime` string — Output only. [Output Only] The last time the schedule successfully ran. The timestamp is an RFC3339 string.
  - `instanceSchedulePolicy` ResourcePolicyInstanceSchedulePolicy — An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance.
    - `vmStopSchedule` ResourcePolicyInstanceSchedulePolicySchedule — Schedule for an instance operation.
      - `schedule` string — Specifies the frequency for the operation, using the unix-cron format.
    - `timeZone` string — Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: https://wikipedia.org/wiki/Tz_database.
    - `expirationTime` string — The expiration time of the schedule. The timestamp is an RFC3339 string.
    - `vmStartSchedule` ResourcePolicyInstanceSchedulePolicySchedule — Schedule for an instance operation.
      - `schedule` string — Specifies the frequency for the operation, using the unix-cron format.
    - `startTime` string — The start time of the schedule. The timestamp is an RFC3339 string.
  - `selfLink` string — Output only. [Output Only] Server-defined fully-qualified URL for this resource.
  - `groupPlacementPolicy` ResourcePolicyGroupPlacementPolicy — A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation
    - `collocation` 'COLLOCATED' | 'UNSPECIFIED_COLLOCATION' — Specifies network collocation
    - `acceleratorTopologyMode` 'AUTO_CONNECT' | 'PROVISION_ONLY' — Specifies the connection mode for the accelerator topology. If not specified, the default is AUTO_CONNECT.
    - `vmCount` integer — Number of VMs in this placement group. Google does not recommend that you use this field unless you use a compact policy and you want your policy to work only if it contains this exact number of VMs.
    - `gpuTopology` string — Specifies the shape of the GPU slice, in slice based GPU families eg. A4X.
    - `availabilityDomainCount` integer — The number of availability domains to spread instances across. If two instances are in different availability domain, they are not in the same low latency network.
  - `workloadPolicy` ResourcePolicyWorkloadPolicy — Represents the workload policy.
    - `type` 'HIGH_AVAILABILITY' | 'HIGH_THROUGHPUT' — Specifies the intent of the instance placement in the MIG.
    - `maxTopologyDistance` 'BLOCK' | 'CLUSTER' | 'SUBBLOCK' — Specifies the maximum distance between instances.
    - `acceleratorTopology` string — Specifies the topology required to create a partition for VMs that have interconnected GPUs.
    - `acceleratorTopologyMode` 'AUTO_CONNECT' | 'PROVISION_ONLY' — Specifies the connection mode for the accelerator topology. If not specified, the default is AUTO_CONNECT.
  - `region` string
  - `description` string
  - `creationTimestamp` string — Output only. [Output Only] Creation timestamp inRFC3339 text format.
  - `kind` string — Output only. [Output Only] Type of the resource. Alwayscompute#resource_policies for resource policies.
  - `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 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.
  - `snapshotSchedulePolicy` ResourcePolicySnapshotSchedulePolicy — A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained.
    - `schedule` ResourcePolicySnapshotSchedulePolicySchedule — A schedule for disks where the schedueled operations are performed.
      - `weeklySchedule` ResourcePolicyWeeklyCycle — Time window specified for weekly operations.
        - `dayOfWeeks` ResourcePolicyWeeklyCycleDayOfWeek[] — Up to 7 intervals/windows, one for each day of the week.
          - `day` 'FRIDAY' | 'INVALID' | 'MONDAY' | 'SATURDAY' | 'SUNDAY' | 'THURSDAY' | 'TUESDAY' | 'WEDNESDAY' — Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY.
          - `duration` string — Output only. [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
          - `startTime` string — Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
      - `hourlySchedule` ResourcePolicyHourlyCycle — Time window specified for hourly operations.
        - `hoursInCycle` integer — Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.
        - `duration` string — Output only. [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
        - `startTime` string — Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
      - `dailySchedule` ResourcePolicyDailyCycle — Time window specified for daily operations.
        - `startTime` string — Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00,12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.
        - `duration` string — Output only. [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.
        - `daysInCycle` integer — Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle.
    - `retentionPolicy` ResourcePolicySnapshotSchedulePolicyRetentionPolicy — Policy for retention of scheduled snapshots.
      - `maxRetentionDays` integer — Maximum age of the snapshot that is allowed to be kept.
      - `onSourceDiskDelete` 'APPLY_RETENTION_POLICY' | 'KEEP_AUTO_SNAPSHOTS' | 'UNSPECIFIED_ON_SOURCE_DISK_DELETE' — Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
    - `snapshotProperties` ResourcePolicySnapshotSchedulePolicySnapshotProperties — Specified snapshot properties for scheduled snapshots created by this policy.
      - `guestFlush` boolean — Indication to perform a 'guest aware' snapshot.
      - `labels` object — Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty.
      - `storageLocations` string[] — Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional).
      - `chainName` string — Chain name that the snapshot is created in.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/compute.md) · [All operations](https://skmtc.net/google/apis/compute/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/compute/revisions/6120ed8969d4/schema)
