Skip to main content

GetByRegistry

Returns scan policy for the registry if any exists.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetScanPolicyByRegistryRequest =
cloudApi.containerregistry.scan_policy_service.GetScanPolicyByRegistryRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ScanPolicyServiceClient);

const result = await client.getByRegistry(
GetScanPolicyByRegistryRequest.fromPartial({
registryId: "registryId",
})
);
console.log(result);
})();

GetScanPolicyByRegistryRequest

registryId : string

ID of the registry with 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.