REST Resource: resourcePolicies

Resource: 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 to schedule persistent disk snapshots.

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "selfLink": string,
  "region": string,
  "description": string,
  "name": string,
  "status": enum,
  "kind": string,

  // Union field policy can be only one of the following:
  "snapshotSchedulePolicy": {
    "schedule": {

      // Union field policy can be only one of the following:
      "hourlySchedule": {
        "hoursInCycle": integer,
        "startTime": string,
        "duration": string
      },
      "dailySchedule": {
        "daysInCycle": integer,
        "startTime": string,
        "duration": string
      },
      "weeklySchedule": {
        "dayOfWeeks": [
          {
            "day": enum,
            "startTime": string,
            "duration": string
          }
        ]
      }
      // End of list of possible types for union field policy.
    },
    "retentionPolicy": {
      "maxRetentionDays": integer,
      "onSourceDiskDelete": enum
    },
    "snapshotProperties": {
      "labels": {
        string: string,
        ...
      },
      "storageLocations": [
        string
      ],
      "guestFlush": boolean,
      "chainName": string
    }
  },
  "groupPlacementPolicy": {
    "vmCount": integer,
    "availabilityDomainCount": integer,
    "collocation": enum
  }
  // End of list of possible types for union field policy.
}
Fields
id

string (fixed64 format)

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

creationTimestamp

string

[Output Only] Creation timestamp in RFC3339 text format.

region

string

description

string

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.

status

enum

[Output Only] The status of resource policy creation.

kind

string

[Output Only] Type of the resource. Always compute#resource_policies for resource policies.

Union field policy.

policy can be only one of the following:

snapshotSchedulePolicy

object

Resource policy for persistent disks for creating snapshots.

snapshotSchedulePolicy.schedule

object

A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy.

snapshotSchedulePolicy.schedule.hourlySchedule

object

snapshotSchedulePolicy.schedule.hourlySchedule.hoursInCycle

integer

Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.

snapshotSchedulePolicy.schedule.hourlySchedule.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.

snapshotSchedulePolicy.schedule.hourlySchedule.duration

string

[Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.

snapshotSchedulePolicy.schedule.dailySchedule

object

snapshotSchedulePolicy.schedule.dailySchedule.daysInCycle

integer

Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle.

snapshotSchedulePolicy.schedule.dailySchedule.startTime

string

instances.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.

snapshotSchedulePolicy.schedule.dailySchedule.duration

string

[Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.

snapshotSchedulePolicy.schedule.weeklySchedule

object

snapshotSchedulePolicy.schedule.weeklySchedule.dayOfWeeks[]

object

Up to 7 intervals/windows, one for each day of the week.

snapshotSchedulePolicy.schedule.weeklySchedule.dayOfWeeks[].day

enum

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.

snapshotSchedulePolicy.schedule.weeklySchedule.dayOfWeeks[].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.

snapshotSchedulePolicy.schedule.weeklySchedule.dayOfWeeks[].duration

string

[Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.

snapshotSchedulePolicy.retentionPolicy

object

Retention policy applied to snapshots created by this resource policy.

snapshotSchedulePolicy.retentionPolicy.maxRetentionDays

integer

Maximum age of the snapshot that is allowed to be kept.

snapshotSchedulePolicy.retentionPolicy.onSourceDiskDelete

enum

Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.

snapshotSchedulePolicy.snapshotProperties

object

Properties with which snapshots are created such as labels, encryption keys.

snapshotSchedulePolicy.snapshotProperties.labels

map (key: string, value: string)

Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

snapshotSchedulePolicy.snapshotProperties.storageLocations[]

string

Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional).

snapshotSchedulePolicy.snapshotProperties.guestFlush

boolean

Indication to perform a 'guest aware' snapshot.

snapshotSchedulePolicy.snapshotProperties.chainName

string

Chain name that the snapshot is created in.

groupPlacementPolicy

object

Resource policy for instacnes for placement configuration.

groupPlacementPolicy.vmCount

integer

Number of vms in this placement group

groupPlacementPolicy.availabilityDomainCount

integer

The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network

groupPlacementPolicy.collocation

enum

Specifies network collocation

Methods

aggregatedList

Retrieves an aggregated list of resource policies.

delete

Deletes the specified resource policy.

get

Retrieves all information of the specified resource policy.

getIamPolicy

Gets the access control policy for a resource.

insert

Creates a new resource policy.

list

A list all the resource policies that have been configured for the specified project in specified region.

setIamPolicy

Sets the access control policy on the specified resource.

testIamPermissions

Returns permissions that a caller has on the specified resource.