GetLast
Returns the last finished ScanResult for the specified Image.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.containerregistry.v1.scanner_service_pb2 import GetLastScanResultRequest
from yandex.cloud.containerregistry.v1.scanner_service_pb2_grpc import ScannerServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ScannerServiceStub)
response = service.GetLast(
GetLastScanResultRequest(
# image_id = "imageId"
)
)
print(response)
GetLastScanResultRequest
imageId : string
ID of the Image to get last finished ScanResult.
ScanResult
A ScanResult resource.
Status
STATUS_UNSPECIFIEDRUNNINGImage scan is in progress.
READYImage has been scanned and result is ready.
ERRORImage 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.