List
Retrieves the list of ScanResults for specified Image.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListScanResultsRequest =
cloudApi.containerregistry.scanner_service.ListScanResultsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ScannerServiceClient);
const result = await client.list(
ListScanResultsRequest.fromPartial({
// imageId: "imageId",
// repositoryId: "repositoryId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter",
// orderBy: "orderBy"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.containerregistry.v1.scanner_service_pb2 import ListScanResultsRequest
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.List(
ListScanResultsRequest(
# image_id = "imageId",
# repository_id = "repositoryId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter",
# order_by = "orderBy"
)
)
print(response)
ListScanResultsRequest
One of id
ID of the Image or Repository to list ScanResults for.
To get the image ID use a yandex.cloud.containerregistry.v1.ImageService.List request. To get the repository ID use a yandex.cloud.containerregistry.v1.RepositoryService.List request.
imageId: string
repositoryId: string
pageSize : int64
The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListRegistriesResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.
pageToken : string
Page token. To get the next page of results, set page_token to the ListRegistriesResponse.next_page_token returned by a previous list request.
filter : string
A filter expression that filters resources listed in the response. The expression must specify:
- The field name. Currently you can use filtering only on ScanResult.status field.
- An
=operator. - The value in double quotes (
").
orderBy : string
An order expression that orders resources listed in the response. The expression must specify:
- The field name. Currently you can use filtering only on ScanResult.status field.
- Order selector. Currently you can use ordering only on
ScanResult.statusfield (critical first).
ListScanResultsResponse
scanResults : ScanResult
List of ScanResult resources.
nextPageToken : string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListImagesRequest.page_size, use the next_page_token as the value for the ListImagesRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.
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.