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
{
  "kind": string,
  "id": string,
  "creationTimestamp": string,
  "selfLink": string,
  "region": string,
  "description": string,
  "name": string,
  "status": enum (Status),
  "resourceStatus": {
    object (ResourceStatus)
  },

  // Union field policy can be only one of the following:
  "snapshotSchedulePolicy": {
    object (SnapshotSchedulePolicy)
  },
  "groupPlacementPolicy": {
    object (GroupPlacementPolicy)
  },
  "instanceSchedulePolicy": {
    object (InstanceSchedulePolicy)
  },
  "diskConsistencyGroupPolicy": {
    object (DiskConsistencyGroupPolicy)
  }
  // End of list of possible types for union field policy.
}
Fields
kind

string

[Output Only] Type of the resource. Always

compute#resourcePolicies

for resource policies.

id

string (uint64 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 (Status)

[Output Only] The status of resource policy creation.

resourceStatus

object (ResourceStatus)

[Output Only] The system status of the resource policy.

Union field policy.

policy can be only one of the following:

snapshotSchedulePolicy

object (SnapshotSchedulePolicy)

Resource policy for persistent disks for creating snapshots.

groupPlacementPolicy

object (GroupPlacementPolicy)

Resource policy for instances for placement configuration.

instanceSchedulePolicy

object (InstanceSchedulePolicy)

Resource policy for scheduling instance operations.

diskConsistencyGroupPolicy

object (DiskConsistencyGroupPolicy)

Resource policy for disk consistency groups.

SnapshotSchedulePolicy

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.

JSON representation
{
  "schedule": {
    object (Schedule)
  },
  "retentionPolicy": {
    object (RetentionPolicy)
  },
  "snapshotProperties": {
    object (SnapshotProperties)
  }
}
Fields
schedule

object (Schedule)

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.

retentionPolicy

object (RetentionPolicy)

Retention policy applied to snapshots created by this resource policy.

snapshotProperties

object (SnapshotProperties)

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

Schedule

A schedule for disks where the schedueled operations are performed.

JSON representation
{

  // Union field policy can be only one of the following:
  "hourlySchedule": {
    object (HourlyCycle)
  },
  "dailySchedule": {
    object (DailyCycle)
  },
  "weeklySchedule": {
    object (WeeklyCycle)
  }
  // End of list of possible types for union field policy.
}
Fields

Union field policy.

policy can be only one of the following:

hourlySchedule

object (HourlyCycle)

dailySchedule

object (DailyCycle)

weeklySchedule

object (WeeklyCycle)

HourlyCycle

Time window specified for hourly operations.

JSON representation
{
  "hoursInCycle": integer,
  "startTime": string,
  "duration": string
}
Fields
hoursInCycle

integer

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

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.

duration

string

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

DailyCycle

Time window specified for daily operations.

JSON representation
{
  "daysInCycle": integer,
  "startTime": string,
  "duration": string
}
Fields
daysInCycle

integer

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

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] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.

WeeklyCycle

Time window specified for weekly operations.

JSON representation
{
  "dayOfWeeks": [
    {
      object (DayOfWeek)
    }
  ]
}
Fields
dayOfWeeks[]

object (DayOfWeek)

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

DayOfWeek

JSON representation
{
  "day": enum (Day),
  "startTime": string,
  "duration": string
}
Fields
day

enum (Day)

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.

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.

duration

string

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

Day

Enums
INVALID
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY

RetentionPolicy

Policy for retention of scheduled snapshots.

JSON representation
{
  "maxRetentionDays": integer,
  "onSourceDiskDelete": enum (OnSourceDiskDelete)
}
Fields
maxRetentionDays

integer

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

onSourceDiskDelete

enum (OnSourceDiskDelete)

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

OnSourceDiskDelete

Enums
UNSPECIFIED_ON_SOURCE_DISK_DELETE
KEEP_AUTO_SNAPSHOTS
APPLY_RETENTION_POLICY

SnapshotProperties

Specified snapshot properties for scheduled snapshots created by this policy.

JSON representation
{
  "labels": {
    string: string,
    ...
  },
  "storageLocations": [
    string
  ],
  "guestFlush": boolean,
  "chainName": string
}
Fields
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.

storageLocations[]

string

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

guestFlush

boolean

Indication to perform a 'guest aware' snapshot.

chainName

string

Chain name that the snapshot is created in.

GroupPlacementPolicy

A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation

JSON representation
{
  "vmCount": integer,
  "availabilityDomainCount": integer,
  "collocation": enum (Collocation)
}
Fields
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.

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.

collocation

enum (Collocation)

Specifies network collocation

Collocation

Enums
UNSPECIFIED_COLLOCATION
COLLOCATED

InstanceSchedulePolicy

An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance.

JSON representation
{
  "vmStartSchedule": {
    object (Schedule)
  },
  "vmStopSchedule": {
    object (Schedule)
  },
  "timeZone": string,
  "startTime": string,
  "expirationTime": string
}
Fields
vmStartSchedule

object (Schedule)

Specifies the schedule for starting instances.

vmStopSchedule

object (Schedule)

Specifies the schedule for stopping instances.

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.

startTime

string

The start time of the schedule. The timestamp is an RFC3339 string.

expirationTime

string

The expiration time of the schedule. The timestamp is an RFC3339 string.

Schedule

Schedule for an instance operation.

JSON representation
{
  "schedule": string
}
Fields
schedule

string

Specifies the frequency for the operation, using the unix-cron format.

DiskConsistencyGroupPolicy

This type has no fields.

Resource policy for disk consistency groups.

Status

Enums
INVALID
CREATING Resource policy is being created.
READY Resource policy is ready to be used.
DELETING Resource policy is being deleted.
EXPIRED Resource policy is expired and will not run again.

ResourceStatus

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.

JSON representation
{
  "instanceSchedulePolicy": {
    object (InstanceSchedulePolicyStatus)
  }
}
Fields
instanceSchedulePolicy

object (InstanceSchedulePolicyStatus)

[Output Only] Specifies a set of output values reffering to the instanceSchedulePolicy system status. This field should have the same name as corresponding policy field.

InstanceSchedulePolicyStatus

JSON representation
{
  "nextRunStartTime": string,
  "lastRunStartTime": string
}
Fields
nextRunStartTime

string

[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] The last time the schedule successfully ran. The timestamp is an RFC3339 string.

Methods

aggregatedList

The method compute.v1.ResourcePoliciesService.AggregatedList is not available in this (s3nsapis.fr) universe.

delete

The method compute.v1.ResourcePoliciesService.Delete is not available in this (s3nsapis.fr) universe.

get

The method compute.v1.ResourcePoliciesService.Get is not available in this (s3nsapis.fr) universe.

getIamPolicy

The method compute.v1.ResourcePoliciesService.GetPolicy is not available in this (s3nsapis.fr) universe.

insert

The method compute.v1.ResourcePoliciesService.Insert is not available in this (s3nsapis.fr) universe.

list

The method compute.v1.ResourcePoliciesService.List is not available in this (s3nsapis.fr) universe.

patch

The method compute.v1.ResourcePoliciesService.Patch is not available in this (s3nsapis.fr) universe.

setIamPolicy

The method compute.v1.ResourcePoliciesService.SetPolicy is not available in this (s3nsapis.fr) universe.

testIamPermissions

The method compute.v1.ResourcePoliciesService.TestPermissions is not available in this (s3nsapis.fr) universe.