Organization Policy v2 API - Class Policy (2.2.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 a Cloud Organization Policy which is used to specify Constraints for configurations of Cloud Platform 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
NameDescription
otherPolicy

Properties

Alternate

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

Deprecated.

Property Value
TypeDescription
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
TypeDescription
PolicySpec

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
TypeDescription
String

PolicyName

public PolicyName PolicyName { get; set; }

PolicyName-typed view over the Name resource name property.

Property Value
TypeDescription
PolicyName

Spec

public PolicySpec Spec { get; set; }

Basic information about the Organization Policy.

Property Value
TypeDescription
PolicySpec