Before running the samples, make sure you've followed the steps outlined in Using the client library.
cd samples
npm install
cd ..
Creates a Note with specified ID
View the source code.
Usage:
node createNote.js "project-id" "note-id"
Creates an Occurrence of a Note and attaches it as a metadata to an image
View the source code.
Usage:
node createOccurrence.js "note-project-id" "note-id" "occurrence-project-id" "image url"
Deletes a specified Note
View the source code.
Usage:
node deleteNote.js "project-id" "note-id"
Deletes a specified Occurrence
View the source code.
Usage:
node deleteOccurrence.js "project-id" "occurrence-id"
Gets all Discovery Occurrences attached to specified image
View the source code.
Usage:
node getDiscoveryInfo.js "project-id" "image-url"
Retrieves and prints a specified note
View the source code.
Usage:
node getNote.js "project-id" "note-id"
Retrieves and prints a specified Occurrence
View the source code.
Usage:
node getOccurrence.js "project-id" "occurrence-id"
Retrieves all Vulnerability Occurrences of High Severity from Specified Image
View the source code.
Usage:
node highVulnerabilitiesForImage.js "project-id" "image-url"
Polls a specified PubSub subscription for Occurrences. Requires a subscription to a topic named 'container-analysis-occurrences-v1'
View the source code.
Usage:
node occurrencePubSub.js "project-id" "subscription-id" "timeout-in-seconds"
Retrieves all Occurrences attached to the metadata of a specified image
View the source code.
Usage:
node occurrencesForImage.js "project-id" "image-url"
Retrieves all Occurrences of a specified Note
View the source code.
Usage:
node occurrencesForNote.js "project-id" "note-id"
Waits for a Discovery Occurrence to reach a terminal state
View the source code.
Usage:
node pollDiscoveryOccurrenceFinished.js "project-id" "image-url" "retries"
fetching an instance of Grafeas and creating a note.
View the source code.
Usage:
node quickstart.js "project-id" "note-id"
Retrieves all Vulnerability Occurrences attached to a specified image
View the source code.
Usage:
node vulnerabilityOccurrencesForImage.js "project-id" "image-url"
