[Grafeas](https://grafeas.io) API.
Retrieves analysis results of Cloud components such as Docker container images.
Analysis results are stored as a series of occurrences. An Occurrence
contains information about a specific analysis instance on a resource. An occurrence refers to a Note
. A note contains details describing the analysis and is generally stored in a separate project, called a Provider
. Multiple occurrences can refer to the same note.
For example, an SSL vulnerability could affect multiple images. In this case, there would be one note for the vulnerability and an occurrence for each image with the vulnerability referring to that note. v1beta1
Package
@google-cloud/containeranalysis
Constructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of GrafeasV1Beta1Client.
Parameters
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.fallback
: loaded instance of google-gax . Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new GrafeasV1Beta1Client({fallback: 'rest'}, gax); ```
|
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
descriptors
descriptors: Descriptors;
grafeasV1Beta1Stub
grafeasV1Beta1Stub?: Promise<{
[name: string]: Function;
}>;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
batchCreateNotes(request, options)
batchCreateNotes(request?: protos.grafeas.v1beta1.IBatchCreateNotesRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.IBatchCreateNotesResponse,
protos.grafeas.v1beta1.IBatchCreateNotesRequest | undefined,
{} | undefined
]>;
Creates new notes in batch.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IBatchCreateNotesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.IBatchCreateNotesResponse,
protos.grafeas.v1beta1.IBatchCreateNotesRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [BatchCreateNotesResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the project in the form of `projects/[PROJECT_ID]`, under which
* the notes are to be created.
*/
// const parent = 'abc123'
/**
* The notes to create.
*/
// const notes = 1234
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callBatchCreateNotes() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.batchCreateNotes(request);
console.log(response);
}
callBatchCreateNotes();
batchCreateNotes(request, options, callback)
batchCreateNotes(request: protos.grafeas.v1beta1.IBatchCreateNotesRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.IBatchCreateNotesResponse, protos.grafeas.v1beta1.IBatchCreateNotesRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IBatchCreateNotesRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.IBatchCreateNotesResponse, protos.grafeas.v1beta1.IBatchCreateNotesRequest | null | undefined, {} | null | undefined>
|
Returns
batchCreateNotes(request, callback)
batchCreateNotes(request: protos.grafeas.v1beta1.IBatchCreateNotesRequest, callback: Callback<protos.grafeas.v1beta1.IBatchCreateNotesResponse, protos.grafeas.v1beta1.IBatchCreateNotesRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IBatchCreateNotesRequest
|
callback |
Callback<protos.grafeas.v1beta1.IBatchCreateNotesResponse, protos.grafeas.v1beta1.IBatchCreateNotesRequest | null | undefined, {} | null | undefined>
|
Returns
batchCreateOccurrences(request, options)
batchCreateOccurrences(request?: protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.IBatchCreateOccurrencesResponse,
protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest | undefined,
{} | undefined
]>;
Creates new occurrences in batch.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.IBatchCreateOccurrencesResponse,
protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [BatchCreateOccurrencesResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the project in the form of `projects/[PROJECT_ID]`, under which
* the occurrences are to be created.
*/
// const parent = 'abc123'
/**
* The occurrences to create.
*/
// const occurrences = 1234
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callBatchCreateOccurrences() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.batchCreateOccurrences(request);
console.log(response);
}
callBatchCreateOccurrences();
batchCreateOccurrences(request, options, callback)
batchCreateOccurrences(request: protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.IBatchCreateOccurrencesResponse, protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.IBatchCreateOccurrencesResponse, protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest | null | undefined, {} | null | undefined>
|
Returns
batchCreateOccurrences(request, callback)
batchCreateOccurrences(request: protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest, callback: Callback<protos.grafeas.v1beta1.IBatchCreateOccurrencesResponse, protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest
|
callback |
Callback<protos.grafeas.v1beta1.IBatchCreateOccurrencesResponse, protos.grafeas.v1beta1.IBatchCreateOccurrencesRequest | null | undefined, {} | null | undefined>
|
Returns
close()
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed.
|
createNote(request, options)
createNote(request?: protos.grafeas.v1beta1.ICreateNoteRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.INote,
protos.grafeas.v1beta1.ICreateNoteRequest | undefined,
{} | undefined
]>;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.ICreateNoteRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.INote,
protos.grafeas.v1beta1.ICreateNoteRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Note]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the project in the form of `projects/[PROJECT_ID]`, under which
* the note is to be created.
*/
// const parent = 'abc123'
/**
* The ID to use for this note.
*/
// const noteId = 'abc123'
/**
* The note to create.
*/
// const note = {}
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callCreateNote() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.createNote(request);
console.log(response);
}
callCreateNote();
createNote(request, options, callback)
createNote(request: protos.grafeas.v1beta1.ICreateNoteRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.ICreateNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.ICreateNoteRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.ICreateNoteRequest | null | undefined, {} | null | undefined>
|
Returns
createNote(request, callback)
createNote(request: protos.grafeas.v1beta1.ICreateNoteRequest, callback: Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.ICreateNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.ICreateNoteRequest
|
callback |
Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.ICreateNoteRequest | null | undefined, {} | null | undefined>
|
Returns
createOccurrence(request, options)
createOccurrence(request?: protos.grafeas.v1beta1.ICreateOccurrenceRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.IOccurrence,
protos.grafeas.v1beta1.ICreateOccurrenceRequest | undefined,
{} | undefined
]>;
Creates a new occurrence.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.ICreateOccurrenceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.IOccurrence,
protos.grafeas.v1beta1.ICreateOccurrenceRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Occurrence]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the project in the form of `projects/[PROJECT_ID]`, under which
* the occurrence is to be created.
*/
// const parent = 'abc123'
/**
* The occurrence to create.
*/
// const occurrence = {}
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callCreateOccurrence() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.createOccurrence(request);
console.log(response);
}
callCreateOccurrence();
createOccurrence(request, options, callback)
createOccurrence(request: protos.grafeas.v1beta1.ICreateOccurrenceRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.ICreateOccurrenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.ICreateOccurrenceRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.ICreateOccurrenceRequest | null | undefined, {} | null | undefined>
|
Returns
createOccurrence(request, callback)
createOccurrence(request: protos.grafeas.v1beta1.ICreateOccurrenceRequest, callback: Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.ICreateOccurrenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.ICreateOccurrenceRequest
|
callback |
Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.ICreateOccurrenceRequest | null | undefined, {} | null | undefined>
|
Returns
deleteNote(request, options)
deleteNote(request?: protos.grafeas.v1beta1.IDeleteNoteRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.grafeas.v1beta1.IDeleteNoteRequest | undefined,
{} | undefined
]>;
Deletes the specified note.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IDeleteNoteRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
protos.grafeas.v1beta1.IDeleteNoteRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the note in the form of
* `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
*/
// const name = 'abc123'
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callDeleteNote() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.deleteNote(request);
console.log(response);
}
callDeleteNote();
deleteNote(request, options, callback)
deleteNote(request: protos.grafeas.v1beta1.IDeleteNoteRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.grafeas.v1beta1.IDeleteNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IDeleteNoteRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.grafeas.v1beta1.IDeleteNoteRequest | null | undefined, {} | null | undefined>
|
Returns
deleteNote(request, callback)
deleteNote(request: protos.grafeas.v1beta1.IDeleteNoteRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.grafeas.v1beta1.IDeleteNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IDeleteNoteRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.grafeas.v1beta1.IDeleteNoteRequest | null | undefined, {} | null | undefined>
|
Returns
deleteOccurrence(request, options)
deleteOccurrence(request?: protos.grafeas.v1beta1.IDeleteOccurrenceRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.grafeas.v1beta1.IDeleteOccurrenceRequest | undefined,
{} | undefined
]>;
Deletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IDeleteOccurrenceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
protos.grafeas.v1beta1.IDeleteOccurrenceRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the occurrence in the form of
* `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
*/
// const name = 'abc123'
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callDeleteOccurrence() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.deleteOccurrence(request);
console.log(response);
}
callDeleteOccurrence();
deleteOccurrence(request, options, callback)
deleteOccurrence(request: protos.grafeas.v1beta1.IDeleteOccurrenceRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.grafeas.v1beta1.IDeleteOccurrenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IDeleteOccurrenceRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.grafeas.v1beta1.IDeleteOccurrenceRequest | null | undefined, {} | null | undefined>
|
Returns
deleteOccurrence(request, callback)
deleteOccurrence(request: protos.grafeas.v1beta1.IDeleteOccurrenceRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.grafeas.v1beta1.IDeleteOccurrenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IDeleteOccurrenceRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.grafeas.v1beta1.IDeleteOccurrenceRequest | null | undefined, {} | null | undefined>
|
Returns
getNote(request, options)
getNote(request?: protos.grafeas.v1beta1.IGetNoteRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.INote,
protos.grafeas.v1beta1.IGetNoteRequest | undefined,
{} | undefined
]>;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetNoteRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.INote,
protos.grafeas.v1beta1.IGetNoteRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Note]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the note in the form of
* `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
*/
// const name = 'abc123'
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callGetNote() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.getNote(request);
console.log(response);
}
callGetNote();
getNote(request, options, callback)
getNote(request: protos.grafeas.v1beta1.IGetNoteRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IGetNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetNoteRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IGetNoteRequest | null | undefined, {} | null | undefined>
|
Returns
getNote(request, callback)
getNote(request: protos.grafeas.v1beta1.IGetNoteRequest, callback: Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IGetNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetNoteRequest
|
callback |
Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IGetNoteRequest | null | undefined, {} | null | undefined>
|
Returns
getOccurrence(request, options)
getOccurrence(request?: protos.grafeas.v1beta1.IGetOccurrenceRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.IOccurrence,
protos.grafeas.v1beta1.IGetOccurrenceRequest | undefined,
{} | undefined
]>;
Gets the specified occurrence.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetOccurrenceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.IOccurrence,
protos.grafeas.v1beta1.IGetOccurrenceRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Occurrence]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the occurrence in the form of
* `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
*/
// const name = 'abc123'
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callGetOccurrence() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.getOccurrence(request);
console.log(response);
}
callGetOccurrence();
getOccurrence(request, options, callback)
getOccurrence(request: protos.grafeas.v1beta1.IGetOccurrenceRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.IGetOccurrenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetOccurrenceRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.IGetOccurrenceRequest | null | undefined, {} | null | undefined>
|
Returns
getOccurrence(request, callback)
getOccurrence(request: protos.grafeas.v1beta1.IGetOccurrenceRequest, callback: Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.IGetOccurrenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetOccurrenceRequest
|
callback |
Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.IGetOccurrenceRequest | null | undefined, {} | null | undefined>
|
Returns
getOccurrenceNote(request, options)
getOccurrenceNote(request?: protos.grafeas.v1beta1.IGetOccurrenceNoteRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.INote,
protos.grafeas.v1beta1.IGetOccurrenceNoteRequest | undefined,
{} | undefined
]>;
Gets the note attached to the specified occurrence. Consumer projects can use this method to get a note that belongs to a provider project.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetOccurrenceNoteRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.INote,
protos.grafeas.v1beta1.IGetOccurrenceNoteRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Note]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the occurrence in the form of
* `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
*/
// const name = 'abc123'
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callGetOccurrenceNote() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.getOccurrenceNote(request);
console.log(response);
}
callGetOccurrenceNote();
getOccurrenceNote(request, options, callback)
getOccurrenceNote(request: protos.grafeas.v1beta1.IGetOccurrenceNoteRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IGetOccurrenceNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetOccurrenceNoteRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IGetOccurrenceNoteRequest | null | undefined, {} | null | undefined>
|
Returns
getOccurrenceNote(request, callback)
getOccurrenceNote(request: protos.grafeas.v1beta1.IGetOccurrenceNoteRequest, callback: Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IGetOccurrenceNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetOccurrenceNoteRequest
|
callback |
Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IGetOccurrenceNoteRequest | null | undefined, {} | null | undefined>
|
Returns
getProjectId()
getProjectId(): Promise<string>;
Returns
Type | Description |
Promise<string> | |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns
getVulnerabilityOccurrencesSummary(request, options)
getVulnerabilityOccurrencesSummary(request?: protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.IVulnerabilityOccurrencesSummary,
(protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest | undefined),
{} | undefined
]>;
Gets a summary of the number and severity of occurrences.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.IVulnerabilityOccurrencesSummary,
(protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [VulnerabilityOccurrencesSummary]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the project to get a vulnerability summary for in the form of
* `projects/[PROJECT_ID]`.
*/
// const parent = 'abc123'
/**
* The filter expression.
*/
// const filter = 'abc123'
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callGetVulnerabilityOccurrencesSummary() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.getVulnerabilityOccurrencesSummary(request);
console.log(response);
}
callGetVulnerabilityOccurrencesSummary();
getVulnerabilityOccurrencesSummary(request, options, callback)
getVulnerabilityOccurrencesSummary(request: protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.IVulnerabilityOccurrencesSummary, protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.IVulnerabilityOccurrencesSummary, protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest | null | undefined, {} | null | undefined>
|
Returns
getVulnerabilityOccurrencesSummary(request, callback)
getVulnerabilityOccurrencesSummary(request: protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest, callback: Callback<protos.grafeas.v1beta1.IVulnerabilityOccurrencesSummary, protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest
|
callback |
Callback<protos.grafeas.v1beta1.IVulnerabilityOccurrencesSummary, protos.grafeas.v1beta1.IGetVulnerabilityOccurrencesSummaryRequest | null | undefined, {} | null | undefined>
|
Returns
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub.
|
listNoteOccurrences(request, options)
listNoteOccurrences(request?: protos.grafeas.v1beta1.IListNoteOccurrencesRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.IOccurrence[],
protos.grafeas.v1beta1.IListNoteOccurrencesRequest | null,
protos.grafeas.v1beta1.IListNoteOccurrencesResponse
]>;
Lists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNoteOccurrencesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.IOccurrence[],
protos.grafeas.v1beta1.IListNoteOccurrencesRequest | null,
protos.grafeas.v1beta1.IListNoteOccurrencesResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Occurrence]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listNoteOccurrencesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
listNoteOccurrences(request, options, callback)
listNoteOccurrences(request: protos.grafeas.v1beta1.IListNoteOccurrencesRequest, options: CallOptions, callback: PaginationCallback<protos.grafeas.v1beta1.IListNoteOccurrencesRequest, protos.grafeas.v1beta1.IListNoteOccurrencesResponse | null | undefined, protos.grafeas.v1beta1.IOccurrence>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNoteOccurrencesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.grafeas.v1beta1.IListNoteOccurrencesRequest, protos.grafeas.v1beta1.IListNoteOccurrencesResponse | null | undefined, protos.grafeas.v1beta1.IOccurrence>
|
Returns
listNoteOccurrences(request, callback)
listNoteOccurrences(request: protos.grafeas.v1beta1.IListNoteOccurrencesRequest, callback: PaginationCallback<protos.grafeas.v1beta1.IListNoteOccurrencesRequest, protos.grafeas.v1beta1.IListNoteOccurrencesResponse | null | undefined, protos.grafeas.v1beta1.IOccurrence>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNoteOccurrencesRequest
|
callback |
PaginationCallback<protos.grafeas.v1beta1.IListNoteOccurrencesRequest, protos.grafeas.v1beta1.IListNoteOccurrencesResponse | null | undefined, protos.grafeas.v1beta1.IOccurrence>
|
Returns
listNoteOccurrencesAsync(request, options)
listNoteOccurrencesAsync(request?: protos.grafeas.v1beta1.IListNoteOccurrencesRequest, options?: CallOptions): AsyncIterable<protos.grafeas.v1beta1.IOccurrence>;
Equivalent to listNoteOccurrences
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNoteOccurrencesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
AsyncIterable<protos.grafeas.v1beta1.IOccurrence> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Occurrence]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the note to list occurrences for in the form of
* `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
*/
// const name = 'abc123'
/**
* The filter expression.
*/
// const filter = 'abc123'
/**
* Number of occurrences to return in the list.
*/
// const pageSize = 1234
/**
* Token to provide to skip to a particular spot in the list.
*/
// const pageToken = 'abc123'
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callListNoteOccurrences() {
// Construct request
const request = {
};
// Run request
const iterable = await containeranalysisClient.listNoteOccurrencesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListNoteOccurrences();
listNoteOccurrencesStream(request, options)
listNoteOccurrencesStream(request?: protos.grafeas.v1beta1.IListNoteOccurrencesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNoteOccurrencesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Occurrence] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listNoteOccurrencesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
listNotes(request, options)
listNotes(request?: protos.grafeas.v1beta1.IListNotesRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.INote[],
protos.grafeas.v1beta1.IListNotesRequest | null,
protos.grafeas.v1beta1.IListNotesResponse
]>;
Lists notes for the specified project.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNotesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.INote[],
protos.grafeas.v1beta1.IListNotesRequest | null,
protos.grafeas.v1beta1.IListNotesResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Note]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listNotesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
listNotes(request, options, callback)
listNotes(request: protos.grafeas.v1beta1.IListNotesRequest, options: CallOptions, callback: PaginationCallback<protos.grafeas.v1beta1.IListNotesRequest, protos.grafeas.v1beta1.IListNotesResponse | null | undefined, protos.grafeas.v1beta1.INote>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNotesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.grafeas.v1beta1.IListNotesRequest, protos.grafeas.v1beta1.IListNotesResponse | null | undefined, protos.grafeas.v1beta1.INote>
|
Returns
listNotes(request, callback)
listNotes(request: protos.grafeas.v1beta1.IListNotesRequest, callback: PaginationCallback<protos.grafeas.v1beta1.IListNotesRequest, protos.grafeas.v1beta1.IListNotesResponse | null | undefined, protos.grafeas.v1beta1.INote>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNotesRequest
|
callback |
PaginationCallback<protos.grafeas.v1beta1.IListNotesRequest, protos.grafeas.v1beta1.IListNotesResponse | null | undefined, protos.grafeas.v1beta1.INote>
|
Returns
listNotesAsync(request, options)
listNotesAsync(request?: protos.grafeas.v1beta1.IListNotesRequest, options?: CallOptions): AsyncIterable<protos.grafeas.v1beta1.INote>;
Equivalent to listNotes
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNotesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
AsyncIterable<protos.grafeas.v1beta1.INote> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Note]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the project to list notes for in the form of
* `projects/[PROJECT_ID]`.
*/
// const parent = 'abc123'
/**
* The filter expression.
*/
// const filter = 'abc123'
/**
* Number of notes to return in the list.
*/
// const pageSize = 1234
/**
* Token to provide to skip to a particular spot in the list.
*/
// const pageToken = 'abc123'
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callListNotes() {
// Construct request
const request = {
};
// Run request
const iterable = await containeranalysisClient.listNotesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListNotes();
listNotesStream(request, options)
listNotesStream(request?: protos.grafeas.v1beta1.IListNotesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListNotesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Note] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listNotesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
listOccurrences(request, options)
listOccurrences(request?: protos.grafeas.v1beta1.IListOccurrencesRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.IOccurrence[],
protos.grafeas.v1beta1.IListOccurrencesRequest | null,
protos.grafeas.v1beta1.IListOccurrencesResponse
]>;
Lists occurrences for the specified project.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListOccurrencesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.IOccurrence[],
protos.grafeas.v1beta1.IListOccurrencesRequest | null,
protos.grafeas.v1beta1.IListOccurrencesResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Occurrence]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listOccurrencesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
listOccurrences(request, options, callback)
listOccurrences(request: protos.grafeas.v1beta1.IListOccurrencesRequest, options: CallOptions, callback: PaginationCallback<protos.grafeas.v1beta1.IListOccurrencesRequest, protos.grafeas.v1beta1.IListOccurrencesResponse | null | undefined, protos.grafeas.v1beta1.IOccurrence>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListOccurrencesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.grafeas.v1beta1.IListOccurrencesRequest, protos.grafeas.v1beta1.IListOccurrencesResponse | null | undefined, protos.grafeas.v1beta1.IOccurrence>
|
Returns
listOccurrences(request, callback)
listOccurrences(request: protos.grafeas.v1beta1.IListOccurrencesRequest, callback: PaginationCallback<protos.grafeas.v1beta1.IListOccurrencesRequest, protos.grafeas.v1beta1.IListOccurrencesResponse | null | undefined, protos.grafeas.v1beta1.IOccurrence>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListOccurrencesRequest
|
callback |
PaginationCallback<protos.grafeas.v1beta1.IListOccurrencesRequest, protos.grafeas.v1beta1.IListOccurrencesResponse | null | undefined, protos.grafeas.v1beta1.IOccurrence>
|
Returns
listOccurrencesAsync(request, options)
listOccurrencesAsync(request?: protos.grafeas.v1beta1.IListOccurrencesRequest, options?: CallOptions): AsyncIterable<protos.grafeas.v1beta1.IOccurrence>;
Equivalent to listOccurrences
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListOccurrencesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
AsyncIterable<protos.grafeas.v1beta1.IOccurrence> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Occurrence]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the project to list occurrences for in the form of
* `projects/[PROJECT_ID]`.
*/
// const parent = 'abc123'
/**
* The filter expression.
*/
// const filter = 'abc123'
/**
* Number of occurrences to return in the list.
*/
// const pageSize = 1234
/**
* Token to provide to skip to a particular spot in the list.
*/
// const pageToken = 'abc123'
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callListOccurrences() {
// Construct request
const request = {
};
// Run request
const iterable = await containeranalysisClient.listOccurrencesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListOccurrences();
listOccurrencesStream(request, options)
listOccurrencesStream(request?: protos.grafeas.v1beta1.IListOccurrencesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IListOccurrencesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Occurrence] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listOccurrencesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
matchProjectFromScanConfigName(scanConfigName)
matchProjectFromScanConfigName(scanConfigName: string): string | number;
Parse the project from ScanConfig resource.
Parameter
Name | Description |
scanConfigName |
string
A fully-qualified path representing ScanConfig resource.
|
Returns
Type | Description |
string | number | {string} A string representing the project.
|
matchScanConfigFromScanConfigName(scanConfigName)
matchScanConfigFromScanConfigName(scanConfigName: string): string | number;
Parse the scan_config from ScanConfig resource.
Parameter
Name | Description |
scanConfigName |
string
A fully-qualified path representing ScanConfig resource.
|
Returns
Type | Description |
string | number | {string} A string representing the scan_config.
|
scanConfigPath(project, scanConfig)
scanConfigPath(project: string, scanConfig: string): string;
Return a fully-qualified scanConfig resource name string.
Parameters
Name | Description |
project |
string
|
scanConfig |
string
|
Returns
Type | Description |
string | {string} Resource name string.
|
updateNote(request, options)
updateNote(request?: protos.grafeas.v1beta1.IUpdateNoteRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.INote,
protos.grafeas.v1beta1.IUpdateNoteRequest | undefined,
{} | undefined
]>;
Updates the specified note.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IUpdateNoteRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.INote,
protos.grafeas.v1beta1.IUpdateNoteRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Note]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the note in the form of
* `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
*/
// const name = 'abc123'
/**
* The updated note.
*/
// const note = {}
/**
* The fields to update.
*/
// const updateMask = {}
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callUpdateNote() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.updateNote(request);
console.log(response);
}
callUpdateNote();
updateNote(request, options, callback)
updateNote(request: protos.grafeas.v1beta1.IUpdateNoteRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IUpdateNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IUpdateNoteRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IUpdateNoteRequest | null | undefined, {} | null | undefined>
|
Returns
updateNote(request, callback)
updateNote(request: protos.grafeas.v1beta1.IUpdateNoteRequest, callback: Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IUpdateNoteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IUpdateNoteRequest
|
callback |
Callback<protos.grafeas.v1beta1.INote, protos.grafeas.v1beta1.IUpdateNoteRequest | null | undefined, {} | null | undefined>
|
Returns
updateOccurrence(request, options)
updateOccurrence(request?: protos.grafeas.v1beta1.IUpdateOccurrenceRequest, options?: CallOptions): Promise<[
protos.grafeas.v1beta1.IOccurrence,
protos.grafeas.v1beta1.IUpdateOccurrenceRequest | undefined,
{} | undefined
]>;
Updates the specified occurrence.
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IUpdateOccurrenceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[
protos.grafeas.v1beta1.IOccurrence,
protos.grafeas.v1beta1.IUpdateOccurrenceRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Occurrence]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the occurrence in the form of
* `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
*/
// const name = 'abc123'
/**
* The updated occurrence.
*/
// const occurrence = {}
/**
* The fields to update.
*/
// const updateMask = {}
// Imports the Containeranalysis library
const {GrafeasV1Beta1Client} = require('@google-cloud/containeranalysis').v1beta1;
// Instantiates a client
const containeranalysisClient = new GrafeasV1Beta1Client();
async function callUpdateOccurrence() {
// Construct request
const request = {
};
// Run request
const response = await containeranalysisClient.updateOccurrence(request);
console.log(response);
}
callUpdateOccurrence();
updateOccurrence(request, options, callback)
updateOccurrence(request: protos.grafeas.v1beta1.IUpdateOccurrenceRequest, options: CallOptions, callback: Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.IUpdateOccurrenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IUpdateOccurrenceRequest
|
options |
CallOptions
|
callback |
Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.IUpdateOccurrenceRequest | null | undefined, {} | null | undefined>
|
Returns
updateOccurrence(request, callback)
updateOccurrence(request: protos.grafeas.v1beta1.IUpdateOccurrenceRequest, callback: Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.IUpdateOccurrenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.grafeas.v1beta1.IUpdateOccurrenceRequest
|
callback |
Callback<protos.grafeas.v1beta1.IOccurrence, protos.grafeas.v1beta1.IUpdateOccurrenceRequest | null | undefined, {} | null | undefined>
|
Returns