Skip to main content

GetLast

Returns the last finished ScanResult for the specified Image.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetLastScanResultRequest =
cloudApi.containerregistry.scanner_service.GetLastScanResultRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ScannerServiceClient);

const result = await client.getLast(
GetLastScanResultRequest.fromPartial({
// imageId: "imageId"
})
);
console.log(result);
})();

GetLastScanResultRequest

imageId : string

ID of the Image to get last finished ScanResult.

ScanResult

A ScanResult resource.

Status

  • STATUS_UNSPECIFIED

  • RUNNING

    Image scan is in progress.

  • READY

    Image has been scanned and result is ready.

  • ERROR

    Image scan is failed.

id : string

Output only. ID of the ScanResult.

imageId : string

Output only. ID of the Image that the ScanResult belongs to.

scannedAt : google.protobuf.Timestamp

Output only. The timestamp in RFC3339 text format when the scan been finished.

status : Status

Output only. The status of the ScanResult.

vulnerabilities : VulnerabilityStats

Output only. Summary information about vulnerabilities found.

VulnerabilityStats

A VulnerabilityStats resource.

critical : int64

Count of CRITICAL vulnerabilities.

high : int64

Count of HIGH vulnerabilities.

medium : int64

Count of MEDIUM vulnerabilities.

low : int64

Count of LOW vulnerabilities.

negligible : int64

Count of NEGLIGIBLE vulnerabilities.

undefined : int64

Count of other vulnerabilities.