Retrieves analysis results of Cloud components such as Docker container images. The Container Analysis API is an implementation of the [Grafeas](https://grafeas.io) API.
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. v1
Package
@google-cloud/containeranalysis
Constructors
(constructor)(opts)
constructor(opts?: ClientOptions);
Construct an instance of ContainerAnalysisClient.
Parameter
Name | Description |
opts |
ClientOptions
|
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
Property Value
auth
Property Value
Type | Description |
gax.GoogleAuth | |
containerAnalysisStub
containerAnalysisStub?: Promise<{
[name: string]: Function;
}>;
Property Value
Type | Description |
Promise<{
[name: string]: Function;
}> | |
descriptors
descriptors: Descriptors;
Property Value
Type | Description |
Descriptors | |
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
Property Value
Type | Description |
{
[name: string]: Function;
} | |
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
Property Value
Type | Description |
{
[name: string]: gax.PathTemplate;
} | |
port
static get port(): number;
The port for this API service.
Property Value
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
Property Value
servicePath
static get servicePath(): string;
The DNS address for this API service.
Property Value
warn
warn: (code: string, message: string, warnType?: string) => void;
Property Value
Type | Description |
(code: string, message: string, warnType?: string) => void | |
Methods
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.
|
getGrafeasClient()
getGrafeasClient(): import("@google-cloud/grafeas/build/src/v1").GrafeasClient;
Returns
Type | Description |
import("@google-cloud/grafeas/build/src/v1").GrafeasClient | {GrafeasClient} - An instance of a Grafeas client.
|
getIamPolicy(request, options)
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>;
Parameters
Name | Description |
request |
protos.google.iam.v1.IGetIamPolicyRequest
|
options |
CallOptions
|
Returns
Type | Description |
Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]> | |
getIamPolicy(request, options, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.iam.v1.IGetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns
getIamPolicy(request, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.iam.v1.IGetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | 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.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest, options?: CallOptions): Promise<[protos.google.devtools.containeranalysis.v1.IVulnerabilityOccurrencesSummary, (protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest | undefined), {} | undefined]>;
Parameters
Name | Description |
request |
protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest
|
options |
CallOptions
|
Returns
Type | Description |
Promise<[protos.google.devtools.containeranalysis.v1.IVulnerabilityOccurrencesSummary, (protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest | undefined), {} | undefined]> | |
getVulnerabilityOccurrencesSummary(request, options, callback)
getVulnerabilityOccurrencesSummary(request: protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest, options: CallOptions, callback: Callback<protos.google.devtools.containeranalysis.v1.IVulnerabilityOccurrencesSummary, protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.devtools.containeranalysis.v1.IVulnerabilityOccurrencesSummary, protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest | null | undefined, {} | null | undefined>
|
Returns
getVulnerabilityOccurrencesSummary(request, callback)
getVulnerabilityOccurrencesSummary(request: protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest, callback: Callback<protos.google.devtools.containeranalysis.v1.IVulnerabilityOccurrencesSummary, protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest
|
callback |
Callback<protos.google.devtools.containeranalysis.v1.IVulnerabilityOccurrencesSummary, protos.google.devtools.containeranalysis.v1.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.
|
matchNoteFromNoteName(noteName)
matchNoteFromNoteName(noteName: string): string | number;
Parse the note from Note resource.
Parameter
Name | Description |
noteName |
string
A fully-qualified path representing Note resource.
|
Returns
Type | Description |
string | number | {string} A string representing the note.
|
matchOccurrenceFromOccurrenceName(occurrenceName)
matchOccurrenceFromOccurrenceName(occurrenceName: string): string | number;
Parse the occurrence from Occurrence resource.
Parameter
Name | Description |
occurrenceName |
string
A fully-qualified path representing Occurrence resource.
|
Returns
Type | Description |
string | number | {string} A string representing the occurrence.
|
matchProjectFromNoteName(noteName)
matchProjectFromNoteName(noteName: string): string | number;
Parse the project from Note resource.
Parameter
Name | Description |
noteName |
string
A fully-qualified path representing Note resource.
|
Returns
Type | Description |
string | number | {string} A string representing the project.
|
matchProjectFromOccurrenceName(occurrenceName)
matchProjectFromOccurrenceName(occurrenceName: string): string | number;
Parse the project from Occurrence resource.
Parameter
Name | Description |
occurrenceName |
string
A fully-qualified path representing Occurrence resource.
|
Returns
Type | Description |
string | number | {string} A string representing the project.
|
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Parameter
Name | Description |
projectName |
string
A fully-qualified path representing Project resource.
|
Returns
Type | Description |
string | number | {string} A string representing the project.
|
notePath(project, note)
notePath(project: string, note: string): string;
Return a fully-qualified note resource name string.
Parameters
Name | Description |
project |
string
|
note |
string
|
Returns
Type | Description |
string | {string} Resource name string.
|
occurrencePath(project, occurrence)
occurrencePath(project: string, occurrence: string): string;
Return a fully-qualified occurrence resource name string.
Parameters
Name | Description |
project |
string
|
occurrence |
string
|
Returns
Type | Description |
string | {string} Resource name string.
|
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Parameter
Name | Description |
project |
string
|
Returns
Type | Description |
string | {string} Resource name string.
|
setIamPolicy(request, options)
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>;
Parameters
Name | Description |
request |
protos.google.iam.v1.ISetIamPolicyRequest
|
options |
CallOptions
|
Returns
Type | Description |
Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]> | |
setIamPolicy(request, options, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.iam.v1.ISetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns
setIamPolicy(request, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.iam.v1.ISetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns
testIamPermissions(request, options)
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>;
Parameters
Name | Description |
request |
protos.google.iam.v1.ITestIamPermissionsRequest
|
options |
CallOptions
|
Returns
Type | Description |
Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]> | |
testIamPermissions(request, options, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.iam.v1.ITestIamPermissionsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
Returns
testIamPermissions(request, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.iam.v1.ITestIamPermissionsRequest
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
Returns