Google Cloud Asset V1 Client - Class CustomConstraint (1.10.2)

Reference documentation and code samples for the Google Cloud Asset V1 Client class CustomConstraint.

The definition of a custom constraint.

Generated from protobuf message google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ name string

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.createOnlyE2TypeVms"

↳ resource_types array

The Resource Instance type on which this policy applies to. Format will be of the form : "

↳ method_types array

All the operations being applied for this constraint.

↳ condition string

Organization Policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+")' or, resource.management.auto_upgrade == true

↳ action_type int

Allow or deny type.

↳ display_name string

One line display name for the UI.

↳ description string

Detailed information about this custom policy constraint.

getName

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.createOnlyE2TypeVms"
Returns
TypeDescription
string

setName

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.createOnlyE2TypeVms"
Parameter
NameDescription
var string
Returns
TypeDescription
$this

getResourceTypes

The Resource Instance type on which this policy applies to. Format will be of the form : "

  • compute.googleapis.com/Instance.
Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setResourceTypes

The Resource Instance type on which this policy applies to. Format will be of the form : "

  • compute.googleapis.com/Instance.
Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getMethodTypes

All the operations being applied for this constraint.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setMethodTypes

All the operations being applied for this constraint.

Parameter
NameDescription
var int[]
Returns
TypeDescription
$this

getCondition

Organization Policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+")' or, resource.management.auto_upgrade == true

Returns
TypeDescription
string

setCondition

Organization Policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+")' or, resource.management.auto_upgrade == true

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getActionType

Allow or deny type.

Returns
TypeDescription
int

setActionType

Allow or deny type.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getDisplayName

One line display name for the UI.

Returns
TypeDescription
string

setDisplayName

One line display name for the UI.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDescription

Detailed information about this custom policy constraint.

Returns
TypeDescription
string

setDescription

Detailed information about this custom policy constraint.

Parameter
NameDescription
var string
Returns
TypeDescription
$this