SnykTarget
Model for Snyk Targets.
Overview
This model represents targets in Snyk. Targets are the source of projects (e.g., a repository, container image, or other scannable resource).
import clearskies
from clearskies_snyk.models import SnykTarget
def my_handler(snyk_target: SnykTarget):
# Fetch all targets for an organization
targets = snyk_target.where("org_id=org-id-123")
for target in targets:
print(f"Target: {target.display_name}")
# Find a specific target
target = targets.find("id=target-id-456")
print(target.display_name)
# Access parent organization
print(f"Org: {target.org.name}")
# Access related projects
for project in target.projects:
print(f" Project: {project.name}")