Google Cloud Asset V1 Client - Class CustomConstraint (2.1.0)

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

Namespace

Google \ Cloud \ Asset \ V1 \ AnalyzerOrgPolicyConstraint

Methods

__construct

Constructor.

Parameters
Name Description
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
Type Description
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
Name Description
var string
Returns
Type Description
$this

getResourceTypes

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

  • compute.googleapis.com/Instance.
Returns
Type Description
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
Name Description
var string[]
Returns
Type Description
$this

getMethodTypes

All the operations being applied for this constraint.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setMethodTypes

All the operations being applied for this constraint.

Parameter
Name Description
var int[]
Returns
Type Description
$this

getCondition

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

Returns
Type Description
string

setCondition

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

Parameter
Name Description
var string
Returns
Type Description
$this

getActionType

Allow or deny type.

Returns
Type Description
int

setActionType

Allow or deny type.

Parameter
Name Description
var int
Returns
Type Description
$this

getDisplayName

One line display name for the UI.

Returns
Type Description
string

setDisplayName

One line display name for the UI.

Parameter
Name Description
var string
Returns
Type Description
$this

getDescription

Detailed information about this custom policy constraint.

Returns
Type Description
string

setDescription

Detailed information about this custom policy constraint.

Parameter
Name Description
var string
Returns
Type Description
$this