Class: Google::Apis::PolicysimulatorV1::GoogleCloudOrgpolicyV2CustomConstraint

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/policysimulator_v1/classes.rb,
lib/google/apis/policysimulator_v1/representations.rb,
lib/google/apis/policysimulator_v1/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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudOrgpolicyV2CustomConstraint

Returns a new instance of GoogleCloudOrgpolicyV2CustomConstraint.



112
113
114
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 112

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#action_typeString

Allow or deny type. Corresponds to the JSON property actionType

Returns:

  • (String)


63
64
65
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 63

def action_type
  @action_type
end

#conditionString

Org policy condition/expression. 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

Returns:

  • (String)


70
71
72
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 70

def condition
  @condition
end

#descriptionString

Detailed information about this custom policy constraint. The max length of the description is 2000 characters. Corresponds to the JSON property description

Returns:

  • (String)


76
77
78
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 76

def description
  @description
end

#display_nameString

One line display name for the UI. The max length of the display_name is 200 characters. Corresponds to the JSON property displayName

Returns:

  • (String)


82
83
84
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 82

def display_name
  @display_name
end

#method_typesArray<String>

All the operations being applied for this constraint. Corresponds to the JSON property methodTypes

Returns:

  • (Array<String>)


87
88
89
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 87

def method_types
  @method_types
end

#nameString

Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * organizations/organization_id/ customConstraints/custom_constraint_id`Example:organizations/123/ customConstraints/custom.createOnlyE2TypeVmsThe max length is 70 characters and the minimum length is 1. Note that the prefixorganizations/ organization_id/customConstraints/is not counted. Corresponds to the JSON propertyname`

Returns:

  • (String)


97
98
99
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 97

def name
  @name
end

#resource_typesArray<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

Returns:

  • (Array<String>)


103
104
105
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 103

def resource_types
  @resource_types
end

#update_timeString

Output only. The last time this custom constraint was updated. This represents the last time that the CreateCustomConstraint or UpdateCustomConstraint RPC was called Corresponds to the JSON property updateTime

Returns:

  • (String)


110
111
112
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 110

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



117
118
119
120
121
122
123
124
125
126
# File 'lib/google/apis/policysimulator_v1/classes.rb', line 117

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