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

feat: adds getGrafeasClient() method on ContainerAnalysisClient instance #46

Merged
merged 6 commits into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"Container Analysis API"
],
"dependencies": {
"@google-cloud/grafeas": "^2.0.0",
"google-gax": "^1.0.0"
},
"devDependencies": {
Expand Down
8 changes: 5 additions & 3 deletions samples/createNote.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ async function main(
// const noteId = 'my-note-id' // Id of the note

// Import the library and create a client
const containerAnalysis = require('@google-cloud/containeranalysis');
const client = new containerAnalysis.v1beta1.GrafeasV1Beta1Client();
const { GrafeasClient } = require('@google-cloud/containeranalysis');
const client = new GrafeasClient();
bcoe marked this conversation as resolved.
Show resolved Hide resolved

// Construct request
// Associate the Note with a metadata type
Expand All @@ -28,7 +28,9 @@ async function main(
parent: formattedParent,
noteId: noteId,
note: {
vulnerability: {},
vulnerability: {
details: [{affected_cpe_uri: 'aaa', affected_package: 'aaa'}]
},
},
});

Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const gapic = Object.freeze({
* @property {constructor} ContainerAnalysisClient
* Reference to {@link v1.ContainerAnalysisClient}
*/
module.exports = gapic.v1;
module.exports = require('@google-cloud/grafeas');

/**
* @type {object}
Expand Down