Organization Policy v2 API - Class Policy (2.6.0)

public sealed class Policy : IMessage<Policy>, IEquatable<Policy>, IDeepCloneable<Policy>, IBufferMessage, IMessage

Reference documentation and code samples for the Organization Policy v2 API class Policy.

Defines an organization policy which is used to specify constraints for configurations of Google Cloud resources.

Inheritance

object > Policy

Namespace

Google.Cloud.OrgPolicy.V2

Assembly

Google.Cloud.OrgPolicy.V2.dll

Constructors

Policy()

public Policy()

Policy(Policy)

public Policy(Policy other)
Parameter
Name Description
other Policy

Properties

Alternate

[Obsolete]
public AlternatePolicySpec Alternate { get; set; }

Deprecated.

Property Value
Type Description
AlternatePolicySpec

DryRunSpec

public PolicySpec DryRunSpec { get; set; }

Dry-run policy. Audit-only policy, can be used to monitor how the policy would have impacted the existing and future resources if it's enforced.

Property Value
Type Description
PolicySpec

Etag

public string Etag { get; set; }

Optional. An opaque tag indicating the current state of the policy, used for concurrency control. This 'etag' is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

Property Value
Type Description
string

Name

public string Name { get; set; }

Immutable. The resource name of the policy. Must be one of the following forms, where constraint_name is the name of the constraint which this policy configures:

  • projects/{project_number}/policies/{constraint_name}
  • folders/{folder_id}/policies/{constraint_name}
  • organizations/{organization_id}/policies/{constraint_name}

For example, projects/123/policies/compute.disableSerialPortAccess.

Note: projects/{project_id}/policies/{constraint_name} is also an acceptable name for API requests, but responses will return the name using the equivalent project number.

Property Value
Type Description
string

PolicyName

public PolicyName PolicyName { get; set; }

PolicyName-typed view over the Name resource name property.

Property Value
Type Description
PolicyName

Spec

public PolicySpec Spec { get; set; }

Basic information about the Organization Policy.

Property Value
Type Description
PolicySpec