Class: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint
- Inherits:
-
Object
- Object
- Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/orgpolicy_v2/classes.rb,
lib/google/apis/orgpolicy_v2/representations.rb,
lib/google/apis/orgpolicy_v2/representations.rb
Overview
A custom constraint defined by customers which can only be applied to the given resource types and organization. By creating a custom constraint, customers can apply policies of this custom constraint. Creating a custom constraint itself does NOT apply any policy enforcement.
Instance Attribute Summary collapse
-
#action_type ⇒ String
Allow or deny type.
-
#condition ⇒ String
A Common Expression Language (CEL) condition which is used in the evaluation of the constraint.
-
#description ⇒ String
Detailed information about this custom policy constraint.
-
#display_name ⇒ String
One line display name for the UI.
-
#method_types ⇒ Array<String>
All the operations being applied for this constraint.
-
#name ⇒ String
Immutable.
-
#resource_types ⇒ Array<String>
Immutable.
-
#update_time ⇒ String
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudOrgpolicyV2CustomConstraint
constructor
A new instance of GoogleCloudOrgpolicyV2CustomConstraint.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudOrgpolicyV2CustomConstraint
Returns a new instance of GoogleCloudOrgpolicyV2CustomConstraint.
370 371 372 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 370 def initialize(**args) update!(**args) end |
Instance Attribute Details
#action_type ⇒ String
Allow or deny type.
Corresponds to the JSON property actionType
320 321 322 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 320 def action_type @action_type end |
#condition ⇒ String
A Common Expression Language (CEL) condition which is used in the evaluation
of the constraint. For example: resource.instanceName.matches("(production|
test)_(.+_)?[\d]+") or, resource.management.auto_upgrade == true The max
length of the condition is 1000 characters.
Corresponds to the JSON property condition
328 329 330 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 328 def condition @condition end |
#description ⇒ String
Detailed information about this custom policy constraint. The max length of
the description is 2000 characters.
Corresponds to the JSON property description
334 335 336 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 334 def description @description end |
#display_name ⇒ String
One line display name for the UI. The max length of the display_name is 200
characters.
Corresponds to the JSON property displayName
340 341 342 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 340 def display_name @display_name end |
#method_types ⇒ Array<String>
All the operations being applied for this constraint.
Corresponds to the JSON property methodTypes
345 346 347 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 345 def method_types @method_types end |
#name ⇒ String
Immutable. Name of the constraint. This is unique within the organization. The
name must be of the form: * organizations/organization_id/customConstraints/
custom_constraint_id`Example:organizations/123/customConstraints/custom.
createOnlyE2TypeVms` The max length is 71 characters and the minimum length is
- Note that the prefix
organizations/organization_id/customConstraints/ custom.is not counted. Corresponds to the JSON propertyname
355 356 357 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 355 def name @name end |
#resource_types ⇒ Array<String>
Immutable. The resource instance type on which this policy applies. Format
will be of the form : / Example: * compute.googleapis.com/Instance.
Corresponds to the JSON property resourceTypes
361 362 363 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 361 def resource_types @resource_types end |
#update_time ⇒ String
Output only. The last time this custom constraint was updated. This represents
the last time that the CreateCustomConstraint or UpdateCustomConstraint
methods were called.
Corresponds to the JSON property updateTime
368 369 370 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 368 def update_time @update_time end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
375 376 377 378 379 380 381 382 383 384 |
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 375 def update!(**args) @action_type = args[:action_type] if args.key?(:action_type) @condition = args[:condition] if args.key?(:condition) @description = args[:description] if args.key?(:description) @display_name = args[:display_name] if args.key?(:display_name) @method_types = args[:method_types] if args.key?(:method_types) @name = args[:name] if args.key?(:name) @resource_types = args[:resource_types] if args.key?(:resource_types) @update_time = args[:update_time] if args.key?(:update_time) end |