Skip to content

Commit

Permalink
docs(samples): update sample to illustrate AR style urls
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
  • Loading branch information
donmccasland and bcoe authored Nov 16, 2020
1 parent 2e9806b commit d2c50bf
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 8 deletions.
10 changes: 8 additions & 2 deletions container-analysis/snippets/createOccurrence.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ async function main(
noteProjectId = 'your-project-id', // Your GCP Project Id
noteId = 'my-note-id', // Id of the note
occurrenceProjectId = 'your-project-id', // GCP Project Id of Occurrence
imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// If you are using Google Container Registry
imageUrl = 'https://gcr.io/my-project/my-repo/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry
// imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123' // Image to attach metadata to
) {
// [START containeranalysis_create_occurrence]
/**
Expand All @@ -31,7 +34,10 @@ async function main(
// const noteProjectId = 'your-project-id', // Your GCP Project Id
// const noteId = 'my-note-id', // Id of the note
// const occurrenceProjectId = 'your-project-id', // GCP Project Id of Occurrence
// const imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// If you are using Google Container Registry
// const imageUrl = 'https://gcr.io/my-project/my-repo/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry
// const imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123' // Image to attach metadata to

// Import the library and create a client
const {ContainerAnalysisClient} = require('@google-cloud/containeranalysis');
Expand Down
10 changes: 8 additions & 2 deletions container-analysis/snippets/getDiscoveryInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@
// usage: node getDiscoveryInfo.js "project-id" "image-url"
async function main(
projectId = 'your-project-id', // Your GCP Project ID
imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// If you are using Google Container Registry
imageUrl = 'https://gcr.io/my-project/my-repo/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry
// imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123' // Image to attach metadata to
) {
// [START containeranalysis_discovery_info]
/**
* TODO(developer): Uncomment these variables before running the sample
*/
// const projectId = 'your-project-id', // Your GCP Project ID
// const imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// If you are using Google Container Registry
// const imageUrl = 'https://gcr.io/my-project/my-repo/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry
// const imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123' // Image to attach metadata to

// Import the library and create a client
const {ContainerAnalysisClient} = require('@google-cloud/containeranalysis');
Expand Down
7 changes: 6 additions & 1 deletion container-analysis/snippets/highVulnerabilitiesForImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@
async function main(
projectId = 'your-project-id', // Your GCP Project ID
imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// Use imageURL = 'https://LOCATION-docker.pkg.dev/my-project/my-image:123' when
// using Artifact Registry
) {
// [START containeranalysis_filter_vulnerability_occurrences]
/**
* TODO(developer): Uncomment these variables before running the sample
*/
// const projectId = 'your-project-id', // Your GCP Project ID
// const imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// const occurrenceProjectId = 'your-project-id', // GCP Project Id of Occurrence
// If you are using Google Container Registry
// const imageUrl = 'https://gcr.io/my-project/my-repo/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry

// Import the library and create a client
const {ContainerAnalysisClient} = require('@google-cloud/containeranalysis');
Expand Down
7 changes: 6 additions & 1 deletion container-analysis/snippets/occurrencesForImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@
async function main(
projectId = 'your-project-id', // Your GCP Project ID
imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry
// imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123' // Image to attach metadata to
) {
// [START containeranalysis_occurrences_for_image]
/**
* TODO(developer): Uncomment these variables before running the sample
*/
// const projectId = 'your-project-id', // Your GCP Project ID
// const imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// If you are using Google Container Registry
// const imageUrl = 'https://gcr.io/my-project/my-repo/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry
// const imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123' // Image to attach metadata to

// Import the library and create a client
const {ContainerAnalysisClient} = require('@google-cloud/containeranalysis');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@
async function main(
projectId = 'your-project-id', // Your GCP Project ID
imageUrl = 'https://gcr.io/my-project/my-image:123', // Image to attach metadata to
// If you are using Google Artifact Registry
// imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123', // Image to attach metadata to
retries = 5 // The number of retries to listen for the new Pub/Sub messages
) {
// [START containeranalysis_poll_discovery_occurrence_finished]
/**
* TODO(developer): Uncomment these variables before running the sample
*/
// const projectId = 'your-project-id', // Your GCP Project ID
// const imageUrl = 'https://gcr.io/my-project/my-image:123', // Image to attach metadata to
// If you are using Google Container Registry
// const imageUrl = 'https://gcr.io/my-project/my-repo/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry
// const imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123' // Image to attach metadata to
// const retries = 5 // The number of retries to listen for the new Pub/Sub messages

// Import the library and create a client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@
async function main(
projectId = 'your-project-id', // Your GCP Project ID
imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry
// imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123' // Image to attach metadata to
) {
// [START containeranalysis_vulnerability_occurrences_for_image]
/**
* TODO(developer): Uncomment these variables before running the sample
*/
// const projectId = 'your-project-id', // Your GCP Project ID
// const imageUrl = 'https://gcr.io/my-project/my-image:123' // Image to attach metadata to
// If you are using Google Container Registry
// const imageUrl = 'https://gcr.io/my-project/my-repo/my-image:123' // Image to attach metadata to
// If you are using Google Artifact Registry
// const imageUrl = 'https://LOCATION-docker.pkg.dev/my-project/my-repo/my-image:123' // Image to attach metadata to

// Import the library and create a client
const {ContainerAnalysisClient} = require('@google-cloud/containeranalysis');
Expand Down

0 comments on commit d2c50bf

Please sign in to comment.