Skip to main content

Get

Returns the specified scan policy.

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);
})();

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.