Skip to content

Commit

Permalink
feat: Deprecates AlternativePolicySpec
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 428897918
  • Loading branch information
Google APIs authored and copybara-github committed Feb 16, 2022
1 parent 3f75ee1 commit bbb3c1f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
48 changes: 24 additions & 24 deletions google/cloud/orgpolicy/v2/constraint.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,11 +31,11 @@ option ruby_package = "Google::Cloud::OrgPolicy::V2";
// example, you could enforce a constraint that controls which cloud services
// can be activated across an organization, or whether a Compute Engine instance
// can have serial port connections established. `Constraints` can be configured
// by the organization's policy adminstrator to fit the needs of the organzation
// by setting a `policy` that includes `constraints` at different locations in
// the organization's resource hierarchy. Policies are inherited down the
// resource hierarchy from higher levels, but can also be overridden. For
// details about the inheritance rules please read about
// by the organization's policy administrator to fit the needs of the
// organization by setting a `policy` that includes `constraints` at different
// locations in the organization's resource hierarchy. Policies are inherited
// down the resource hierarchy from higher levels, but can also be overridden.
// For details about the inheritance rules please read about
// [`policies`][google.cloud.OrgPolicy.v2.Policy].
//
// `Constraints` have a default behavior determined by the `constraint_default`
Expand All @@ -49,6 +49,24 @@ message Constraint {
pattern: "organizations/{organization}/constraints/{constraint}"
};

// Specifies the default behavior in the absence of any `Policy` for the
// `Constraint`. This must not be `CONSTRAINT_DEFAULT_UNSPECIFIED`.
//
// Immutable after creation.
enum ConstraintDefault {
// This is only used for distinguishing unset values and should never be
// used.
CONSTRAINT_DEFAULT_UNSPECIFIED = 0;

// Indicate that all values are allowed for list constraints.
// Indicate that enforcement is off for boolean constraints.
ALLOW = 1;

// Indicate that all values are denied for list constraints.
// Indicate that enforcement is on for boolean constraints.
DENY = 2;
}

// A `Constraint` that allows or disallows a list of string values, which are
// configured by an Organization's policy administrator with a `Policy`.
message ListConstraint {
Expand All @@ -73,24 +91,6 @@ message Constraint {

}

// Specifies the default behavior in the absence of any `Policy` for the
// `Constraint`. This must not be `CONSTRAINT_DEFAULT_UNSPECIFIED`.
//
// Immutable after creation.
enum ConstraintDefault {
// This is only used for distinguishing unset values and should never be
// used.
CONSTRAINT_DEFAULT_UNSPECIFIED = 0;

// Indicate that all values are allowed for list constraints.
// Indicate that enforcement is off for boolean constraints.
ALLOW = 1;

// Indicate that all values are denied for list constraints.
// Indicate that enforcement is on for boolean constraints.
DENY = 2;
}

// Immutable. The resource name of the Constraint. Must be in one of
// the following forms:
// * `projects/{project_number}/constraints/{constraint_name}`
Expand Down
22 changes: 11 additions & 11 deletions google/cloud/orgpolicy/v2/orgpolicy.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -214,11 +214,8 @@ message Policy {
// Basic information about the Organization Policy.
PolicySpec spec = 2;

// An alternate policy configuration that will be used instead of the baseline
// policy configurations as determined by the launch.
// Currently the only way the launch can trigger the alternate configuration
// is via dry-run/darklaunch.
AlternatePolicySpec alternate = 3;
// Deprecated.
AlternatePolicySpec alternate = 3 [deprecated = true];
}

// Similar to PolicySpec but with an extra 'launch' field for launch reference.
Expand Down Expand Up @@ -284,11 +281,14 @@ message PolicySpec {
// in the evaluation of the policy. When set, the `expression` field in
// the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
// or "&&" operators. Each subexpression must be of the form
// "resource.matchLabels(key_name, value_name)",
// where key_name and value_name are the resource names for Label Keys
// and Values. These names are available from the Label Manager Service. An
// example expression is:
// "resource.matchLabels('labelKeys/123, 'labelValues/456')".
// "resource.matchTag('<ORG_ID>/tag_key_short_name,
// 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id',
// 'tagValues/value_id')". where key_name and value_name are the resource
// names for Label Keys and Values. These names are available from the Tag
// Manager Service. An example expression is:
// "resource.matchTag('123456789/environment,
// 'prod')". or "resource.matchTagId('tagKeys/123',
// 'tagValues/456')".
google.type.Expr condition = 5;
}

Expand Down

0 comments on commit bbb3c1f

Please sign in to comment.