Skip to main content

occurrences

Creates, updates, deletes, gets or lists an occurrences resource.

Overview​

Nameoccurrences
TypeResource
Idgoogle.containeranalysis.occurrences

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. The name of the occurrence in the form of projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID].
advisoryPublishTimestring (google-datetime)The time this advisory was published by the source.
aiSkillAnalysisobjectDescribes an AI skill analysis. (id: AISkillAnalysisOccurrence)
attestationobjectDescribes an attestation of an artifact. (id: AttestationOccurrence)
buildobjectDescribes a verifiable build. (id: BuildOccurrence)
complianceobjectDescribes a compliance violation on a linked resource. (id: ComplianceOccurrence)
createTimestring (google-datetime)Output only. The time this occurrence was created.
deploymentobjectDescribes the deployment of an artifact on a runtime. (id: DeploymentOccurrence)
discoveryobjectDescribes when a resource was discovered. (id: DiscoveryOccurrence)
dsseAttestationobjectDescribes an attestation of an artifact using dsse. (id: DSSEAttestationOccurrence)
envelopeobjecthttps://github.com/secure-systems-lab/dsse (id: Envelope)
imageobjectDescribes how this resource derives from the basis in the associated note. (id: ImageOccurrence)
kindstringOutput only. This explicitly denotes which of the occurrence details are specified. This field can be used as a filter in list requests. (NOTE_KIND_UNSPECIFIED, VULNERABILITY, BUILD, IMAGE, PACKAGE, DEPLOYMENT, DISCOVERY, ATTESTATION, UPGRADE, COMPLIANCE, DSSE_ATTESTATION, VULNERABILITY_ASSESSMENT, SBOM_REFERENCE, SECRET, AI_SKILL_ANALYSIS)
noteNamestringRequired. Immutable. The analysis note associated with this occurrence, in the form of projects/[PROVIDER_ID]/notes/[NOTE_ID]. This field can be used as a filter in list requests.
packageobjectDescribes the installation of a package on the linked resource. (id: PackageOccurrence)
remediationstringA description of actions that can be taken to remedy the note.
resourceUristringRequired. Immutable. A URI that represents the resource for which the occurrence applies. For example, https://gcr.io/project/image@sha256:123abc for a Docker image.
sbomReferenceobjectDescribes a specific SBOM reference occurrences. (id: SBOMReferenceOccurrence)
secretobjectDescribes a secret. (id: SecretOccurrence)
updateTimestring (google-datetime)Output only. The time this occurrence was last updated.
upgradeobjectDescribes an available package upgrade on the linked resource. (id: UpgradeOccurrence)
vulnerabilityobjectDescribes a security vulnerability. (id: VulnerabilityOccurrence)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_notes_occurrences_listselectprojectsId, locationsId, notesIdfilter, pageSize, pageTokenLists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.
projects_locations_occurrences_getselectprojectsId, locationsId, occurrencesIdGets the specified occurrence.
projects_locations_occurrences_listselectprojectsId, locationsIdfilter, pageSize, pageToken, returnPartialSuccessLists occurrences for the specified project.
projects_notes_occurrences_listselectprojectsId, notesIdfilter, pageSize, pageTokenLists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.
projects_occurrences_getselectprojectsId, occurrencesIdGets the specified occurrence.
projects_occurrences_listselectprojectsIdfilter, pageSize, pageToken, returnPartialSuccessLists occurrences for the specified project.
projects_locations_occurrences_batch_createinsertprojectsId, locationsIdCreates new occurrences in batch.
projects_locations_occurrences_createinsertprojectsId, locationsIdCreates a new occurrence.
projects_occurrences_batch_createinsertprojectsIdCreates new occurrences in batch.
projects_occurrences_createinsertprojectsIdCreates a new occurrence.
projects_locations_occurrences_patchupdateprojectsId, locationsId, occurrencesIdupdateMaskUpdates the specified occurrence.
projects_occurrences_patchupdateprojectsId, occurrencesIdupdateMaskUpdates the specified occurrence.
projects_locations_occurrences_deletedeleteprojectsId, locationsId, occurrencesIdDeletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.
projects_occurrences_deletedeleteprojectsId, occurrencesIdDeletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
notesIdstring
occurrencesIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
returnPartialSuccessboolean
updateMaskstring (google-fieldmask)

SELECT examples​

Lists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.

SELECT
name,
advisoryPublishTime,
aiSkillAnalysis,
attestation,
build,
compliance,
createTime,
deployment,
discovery,
dsseAttestation,
envelope,
image,
kind,
noteName,
package,
remediation,
resourceUri,
sbomReference,
secret,
updateTime,
upgrade,
vulnerability
FROM google.containeranalysis.occurrences
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND notesId = '{{ notesId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;

INSERT examples​

Creates new occurrences in batch.

INSERT INTO google.containeranalysis.occurrences (
data__occurrences,
projectsId,
locationsId
)
SELECT
'{{ occurrences }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
occurrences
;

UPDATE examples​

Updates the specified occurrence.

UPDATE google.containeranalysis.occurrences
SET
data__advisoryPublishTime = '{{ advisoryPublishTime }}',
data__aiSkillAnalysis = '{{ aiSkillAnalysis }}',
data__attestation = '{{ attestation }}',
data__build = '{{ build }}',
data__compliance = '{{ compliance }}',
data__createTime = '{{ createTime }}',
data__deployment = '{{ deployment }}',
data__discovery = '{{ discovery }}',
data__dsseAttestation = '{{ dsseAttestation }}',
data__envelope = '{{ envelope }}',
data__image = '{{ image }}',
data__kind = '{{ kind }}',
data__name = '{{ name }}',
data__noteName = '{{ noteName }}',
data__package = '{{ package }}',
data__remediation = '{{ remediation }}',
data__resourceUri = '{{ resourceUri }}',
data__sbomReference = '{{ sbomReference }}',
data__secret = '{{ secret }}',
data__updateTime = '{{ updateTime }}',
data__upgrade = '{{ upgrade }}',
data__vulnerability = '{{ vulnerability }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND occurrencesId = '{{ occurrencesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
advisoryPublishTime,
aiSkillAnalysis,
attestation,
build,
compliance,
createTime,
deployment,
discovery,
dsseAttestation,
envelope,
image,
kind,
noteName,
package,
remediation,
resourceUri,
sbomReference,
secret,
updateTime,
upgrade,
vulnerability;

DELETE examples​

Deletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.

DELETE FROM google.containeranalysis.occurrences
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND occurrencesId = '{{ occurrencesId }}' --required
;