Get
Returns the specified ScanResult resource.
To get the list of ScanResults for specified Image, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetScanResultRequest =
cloudApi.containerregistry.scanner_service.GetScanResultRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ScannerServiceClient);
const result = await client.get(
GetScanResultRequest.fromPartial({
scanResultId: "scanResultId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.containerregistry.v1.scanner_service_pb2 import GetScanResultRequest
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.Get(GetScanResultRequest(scan_result_id="scanResultId"))
print(response)
GetScanResultRequest
scanResultId
: string
ID of the ScanResult to return.
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.