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:

Successful response

NameDatatypeDescription
namestringOutput only. The name of the occurrence in the form of projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID].
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.
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_occurrences_getselectprojectsId, locationsId, occurrencesIdGets the specified occurrence.
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_occurrences_getselectprojectsId, 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_listselectprojectsIdfilter, pageSize, pageToken, returnPartialSuccessLists occurrences for the specified project.
projects_locations_occurrences_createinsertprojectsId, locationsIdCreates a new occurrence.
projects_locations_occurrences_batch_createinsertprojectsId, locationsIdCreates new occurrences in batch.
projects_occurrences_createinsertprojectsIdCreates a new occurrence.
projects_occurrences_batch_createinsertprojectsIdCreates new occurrences in batch.
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

Gets the specified occurrence.

SELECT
name,
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 occurrencesId = '{{ occurrencesId }}' -- required;

INSERT examples

Creates a new occurrence.

INSERT INTO google.containeranalysis.occurrences (
data__name,
data__resourceUri,
data__noteName,
data__kind,
data__remediation,
data__createTime,
data__updateTime,
data__vulnerability,
data__build,
data__image,
data__package,
data__deployment,
data__discovery,
data__attestation,
data__upgrade,
data__compliance,
data__dsseAttestation,
data__sbomReference,
data__secret,
data__envelope,
projectsId,
locationsId
)
SELECT
'{{ name }}',
'{{ resourceUri }}',
'{{ noteName }}',
'{{ kind }}',
'{{ remediation }}',
'{{ createTime }}',
'{{ updateTime }}',
'{{ vulnerability }}',
'{{ build }}',
'{{ image }}',
'{{ package }}',
'{{ deployment }}',
'{{ discovery }}',
'{{ attestation }}',
'{{ upgrade }}',
'{{ compliance }}',
'{{ dsseAttestation }}',
'{{ sbomReference }}',
'{{ secret }}',
'{{ envelope }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
attestation,
build,
compliance,
createTime,
deployment,
discovery,
dsseAttestation,
envelope,
image,
kind,
noteName,
package,
remediation,
resourceUri,
sbomReference,
secret,
updateTime,
upgrade,
vulnerability
;

UPDATE examples

Updates the specified occurrence.

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