REST Resource: projects.locations.contentPolicies

Resource: ContentPolicy

A policy to apply to content based on its inspection findings.

JSON representation
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "displayName": string,
  "inspectConfig": {
    object (InspectConfig)
  },
  "rules": [
    {
      object (PolicyRule)
    }
  ],
  "unsupportedFileType": {
    object (PolicyAction)
  },
  "inputTooLarge": {
    object (PolicyAction)
  },
  "failedToScanSupportedFileType": {
    object (PolicyAction)
  },
  "defaultAction": {
    object (PolicyAction)
  },
  "loggingConfigs": [
    {
      object (LoggingConfig)
    }
  ],
  "errors": [
    {
      object (Error)
    }
  ]
}
Fields
name

string

Output only. Resource name of the policy.

createTime

string (Timestamp format)

Output only. The creation timestamp of a contentPolicy; output-only field.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

Output only. The last update timestamp of a contentPolicy; output-only field.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

displayName

string

Optional. Display name (max 63 chars)

inspectConfig

object (InspectConfig)

Optional. InspectConfig to use to produce findings.

rules[]

object (PolicyRule)

Required. Policies to apply, based on the findings returned by inspection. The first rule to match applies.

unsupportedFileType

object (PolicyAction)

Optional. Action to take if the content is an unsupported file type.

inputTooLarge

object (PolicyAction)

Optional. Action to take if the content is a supported file type but is too large to be scanned.

failedToScanSupportedFileType

object (PolicyAction)

Optional. Action to take if the content is a supported file type and size but fails to be scanned, for example because the file is encrypted or corrupted.

defaultAction

object (PolicyAction)

Action to take if the content is scanned and no rules match. Defaults to returning an ALLOW verdict if not set.

loggingConfigs[]

object (LoggingConfig)

Optional. Log the actions taken by the content policy to external systems.

errors[]

object (Error)

Output only. A stream of errors encountered when the policy was applied. Output only field. Will return the last 100 errors. Whenever the policy is modified this list will be cleared.

PolicyRule

A single policy rule. The first rule to match from the list above controls the result.

JSON representation
{
  "conditions": [
    {
      object (PolicyCondition)
    }
  ],
  "action": {
    object (PolicyAction)
  }
}
Fields
conditions[]

object (PolicyCondition)

Optional. Conditions that must match for this rule to apply. All conditions must match (AND). For OR conditions, use multiple rules.

action

object (PolicyAction)

Required. Action to take if this rule applies.

PolicyCondition

A condition that must match for this rule to apply.

JSON representation
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "infoTypeCondition": {
    object (InfoTypeCondition)
  }
  // End of mutually exclusive fields.
}
Fields
A condition. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
infoTypeCondition

object (InfoTypeCondition)

A condition based on info types.

End of mutually exclusive fields.

InfoTypeCondition

A info type based condition.

JSON representation
{
  "minCount": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "infoTypes": {
    object (InfoTypes)
  },
  "anyInfoType": {
    object
  }
  // End of mutually exclusive fields.
}
Fields
minCount

string (int64 format)

Optional. The minimum total number of findings of all matching info types required for this condition to evaluate to true. Defaults to 1 if unset.

A condition based on info types. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
infoTypes

object (InfoTypes)

match any of these info types.

anyInfoType

object

match any info types.

End of mutually exclusive fields.

InfoTypes

Info types to match.

JSON representation
{
  "infoTypeNames": [
    string
  ]
}
Fields
infoTypeNames[]

string

Required. A list of info types to match.

PolicyAction

A possible action to take when applying a content policy.

JSON representation
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "returnVerdict": enum (ContentPolicyVerdict)
  // End of mutually exclusive fields.
}
Fields
The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
returnVerdict

enum (ContentPolicyVerdict)

Optional. If set, the verdict will be returned to the user.

End of mutually exclusive fields.

ContentPolicyVerdict

Possible results of applying a content policy. This may expand to include additional result types in the future.

Enums
CONTENT_POLICY_VERDICT_UNSPECIFIED Not used.
ALLOW The policy allows the provided content to be used.
BLOCK The policy prevents the provided content from being used. This should result in a blocked file upload, exclusion from training dataset, or other similar block action. (specific action will depend on the caller).

LoggingConfig

A single logging configuration.

JSON representation
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "logToBigQuery": {
    object (LogToBigQuery)
  }
  // End of mutually exclusive fields.
}
Fields
The destination for the action logs. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
logToBigQuery

object (LogToBigQuery)

Optional. Log the actions taken to a BigQuery table.

End of mutually exclusive fields.

LogToBigQuery

Configuration for logging content policy actions to BigQuery.

JSON representation
{
  "projectId": string,
  "datasetId": string,
  "tableId": string
}
Fields
projectId

string

Required. The ID of the project containing the BigQuery table to write to.

datasetId

string

Required. The ID of the dataset containing the BigQuery table to write to.

tableId

string

Required. The ID of the BigQuery table to write to.

Methods

create

Create a ContentPolicy.

delete

Delete a ContentPolicy.

get

Get a ContentPolicy.

list

Lists ContentPolicies in a parent.

patch

Update a ContentPolicy.