Get
Returns the specified scan policy.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetScanPolicyRequest =
cloudApi.containerregistry.scan_policy_service.GetScanPolicyRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ScanPolicyServiceClient);
const result = await client.get(
GetScanPolicyRequest.fromPartial({
scanPolicyId: "scanPolicyId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.containerregistry.v1.scan_policy_service_pb2 import GetScanPolicyRequest
from yandex.cloud.containerregistry.v1.scan_policy_service_pb2_grpc import ScanPolicyServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ScanPolicyServiceStub)
response = service.Get(GetScanPolicyRequest(scan_policy_id="scanPolicyId"))
print(response)
GetScanPolicyRequest
scanPolicyId
: string
ID of the scan policy.
ScanPolicy
id
: string
Output only. ID of the scan policy.
registryId
: string
ID of the registry that the scan policy belongs to. Required. The maximum string length in characters is 50.
name
: string
Name of the scan policy.
description
: string
Description of the scan policy. The maximum string length in characters is 256.
rules
: ScanRules
The rules of scan policy.
createdAt
: google.protobuf.Timestamp
Output only. Creation timestamp.
disabled
: bool
Turns off scan policy.
ScanRules
pushRule
: PushRule
Description of on-push scan rule.
scheduleRules
: ScheduledRule
Description of time based rescan rule.
PushRule
repositoryPrefixes
: string
List of repositories that are scanned with rule. Child repositories are included into parent node. "*" - means all repositories in registry
disabled
: bool
Turns off scan rule.
ScheduledRule
repositoryPrefixes
: string
List of repositories that are scanned with rule. Child repositories are included into parent node. "*" - means all repositories in registry
rescanPeriod
: google.protobuf.Duration
Period of time since last scan to trigger automatic rescan.
disabled
: bool
Turns off scan rule.