Method: resourcePolicies.get

Retrieves all information of the specified resource policy.

HTTP request

GET https://www.googleapis.com/compute/beta/projects/{project}/regions/{region}/resourcePolicies/{resourceId}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

region

string

Name of the region for this request.

resourceId

string

Name of the resource policy to retrieve.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "selfLink": string,
  "region": string,
  "description": string,
  "name": string,
  "kind": string,
  "backupSchedulePolicy": {
    "schedule": {

      // Union field policy can be only one of the following:
      "hourlySchedule": {
        "hoursInCycle": number,
        "startTime": string,
        "duration": string
      },
      "dailySchedule": {
        "daysInCycle": number,
        "startTime": string,
        "duration": string
      },
      "weeklySchedule": {
        "dayOfWeeks": [
          {
            "day": enum,
            "startTime": string,
            "duration": string
          }
        ]
      }
      // End of list of possible types for union field policy.
    },
    "retentionPolicy": {
      "maxRetentionDays": number,
      "onSourceDiskDelete": enum
    },
    "snapshotProperties": {
      "labels": {
        string: string,
        ...
      },
      "guestFlush": boolean
    }
  }
}
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.

kind

string

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

backupSchedulePolicy

object

Resource policy for persistent disks for creating snapshots.

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

backupSchedulePolicy.schedule.hourlySchedule

object

backupSchedulePolicy.schedule.hourlySchedule.hoursInCycle

number

Allows to define schedule that runs every nth hour.

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

backupSchedulePolicy.schedule.hourlySchedule.duration

string

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

backupSchedulePolicy.schedule.dailySchedule

object

backupSchedulePolicy.schedule.dailySchedule.daysInCycle

number

Allows to define schedule that runs every nth day of the month.

backupSchedulePolicy.schedule.dailySchedule.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.

backupSchedulePolicy.schedule.dailySchedule.duration

string

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

backupSchedulePolicy.schedule.weeklySchedule

object

backupSchedulePolicy.schedule.weeklySchedule.dayOfWeeks[]

object

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

backupSchedulePolicy.schedule.weeklySchedule.dayOfWeeks[].day

enum

Allows to define schedule that runs specified day of the week.

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

backupSchedulePolicy.schedule.weeklySchedule.dayOfWeeks[].duration

string

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

backupSchedulePolicy.retentionPolicy

object

Retention policy applied to snapshots created by this resource policy.

backupSchedulePolicy.retentionPolicy.maxRetentionDays

number

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

backupSchedulePolicy.retentionPolicy.onSourceDiskDelete

enum

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

backupSchedulePolicy.snapshotProperties

object

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

backupSchedulePolicy.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" }.

backupSchedulePolicy.snapshotProperties.guestFlush

boolean

Indication to perform a ‘guest aware’ snapshot.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/compute
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

In addition to any permissions specified on the fields above, authorization requires one or more of the following Google IAM permissions:

  • compute.resourcePolicies.get
Was this page helpful? Let us know how we did:

Send feedback about...

Compute Engine