Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Google Cloud Platform logo

Open in Cloud Shell

Table of Contents

Before you begin

Before running the samples, make sure you've followed the steps outlined in Using the client library.

cd samples

npm install

cd ..

Samples

Create Note

Creates a Note with specified ID

View the source code.

Open in Cloud Shell

Usage:

node createNote.js "project-id" "note-id"


Create Occurrence

Creates an Occurrence of a Note and attaches it as a metadata to an image

View the source code.

Open in Cloud Shell

Usage:

node createOccurrence.js "note-project-id" "note-id" "occurrence-project-id" "image url"


Delete Note

Deletes a specified Note

View the source code.

Open in Cloud Shell

Usage:

node deleteNote.js "project-id" "note-id"


Delete Occurrence

Deletes a specified Occurrence

View the source code.

Open in Cloud Shell

Usage:

node deleteOccurrence.js "project-id" "occurrence-id"


Get Discovery Info

Gets all Discovery Occurrences attached to specified image

View the source code.

Open in Cloud Shell

Usage:

node getDiscoveryInfo.js "project-id" "image-url"


Get Note

Retrieves and prints a specified note

View the source code.

Open in Cloud Shell

Usage:

node getNote.js "project-id" "note-id"


Get Occurrence

Retrieves and prints a specified Occurrence

View the source code.

Open in Cloud Shell

Usage:

node getOccurrence.js "project-id" "occurrence-id"


Get High Vulnerabilities for Image

Retrieves all Vulnerability Occurrences of High Severity from Specified Image

View the source code.

Open in Cloud Shell

Usage:

node highVulnerabilitiesForImage.js "project-id" "image-url"


Occurrence PubSub

Polls a specified PubSub subscription for Occurrences. Requires a subscription to a topic named 'container-analysis-occurrences-v1'

View the source code.

Open in Cloud Shell

Usage:

node occurrencePubSub.js "project-id" "subscription-id" "timeout-in-seconds"


Occurrences for Image

Retrieves all Occurrences attached to the metadata of a specified image

View the source code.

Open in Cloud Shell

Usage:

node occurrencesForImage.js "project-id" "image-url"


Occurrences for Note

Retrieves all Occurrences of a specified Note

View the source code.

Open in Cloud Shell

Usage:

node occurrencesForNote.js "project-id" "note-id"


Poll Discovery Occurrence Finished

Waits for a Discovery Occurrence to reach a terminal state

View the source code.

Open in Cloud Shell

Usage:

node pollDiscoveryOccurrenceFinished.js "project-id" "image-url" "retries"


Quickstart

fetching an instance of Grafeas and creating a note.

View the source code.

Open in Cloud Shell

Usage:

node quickstart.js "project-id" "note-id"


Vulnerability Occurrences for Image

Retrieves all Vulnerability Occurrences attached to a specified image

View the source code.

Open in Cloud Shell

Usage:

node vulnerabilityOccurrencesForImage.js "project-id" "image-url"