Manage Boundaries with the VB-OS Python SDK
The client.boundaries namespace manages boundary definitions and their versioned lifecycle. Boundaries use a review workflow: drafts are updated, submitted for review, then approved or rejected.
Methods
Section titled “Methods”| Method | Signature | Description |
|---|---|---|
list |
(project_id, *, limit=20, cursor=None) |
List boundaries in a project |
create |
(project_id, **kwargs) |
Create a new boundary |
get |
(project_id, boundary_ref) |
Get a boundary by reference |
update_draft |
(project_id, boundary_ref, **kwargs) |
Update the draft version |
submit |
(project_id, boundary_ref) |
Submit draft for review |
versions |
(project_id, boundary_ref, *, limit=20, cursor=None) |
List versions |
get_version |
(project_id, boundary_ref, version_id) |
Get a specific version |
approve |
(project_id, boundary_ref, version_id) |
Approve a submitted version |
reject |
(project_id, boundary_ref, version_id) |
Reject a submitted version |
diff |
(project_id, boundary_ref, **kwargs) |
Diff two versions |
List boundaries
Section titled “List boundaries”from vbos import VBOSClient
with VBOSClient(api_key="vbos_your_key_here") as client: result = client.boundaries.list(project_id="proj_abc123")
for boundary in result["items"]: print(boundary["boundary_ref"], boundary["display_name"])Pagination
Section titled “Pagination”All list methods use cursor-based pagination:
result = client.boundaries.list(project_id="proj_abc123", limit=10)while result.get("cursor"): result = client.boundaries.list( project_id="proj_abc123", limit=10, cursor=result["cursor"], )Create a boundary
Section titled “Create a boundary”boundary = client.boundaries.create( project_id="proj_abc123", name="Loan Limit Check", ref="loan-limit-check", source='require_evidence: amount\npredicate: within_limit: amount <= 50000',)print(boundary["boundary_ref"])Get a boundary
Section titled “Get a boundary”boundary = client.boundaries.get( project_id="proj_abc123", boundary_ref="loan-limit-check",)print(boundary["name"])print(boundary["status"])Update a draft
Section titled “Update a draft”Modify the draft version of a boundary before submitting for review:
client.boundaries.update_draft( project_id="proj_abc123", boundary_ref="loan-limit-check", source='require_evidence: amount\npredicate: within_limit: amount <= 75000',)Submit for review
Section titled “Submit for review”client.boundaries.submit( project_id="proj_abc123", boundary_ref="loan-limit-check",)Approve or reject a version
Section titled “Approve or reject a version”# Approveclient.boundaries.approve( project_id="proj_abc123", boundary_ref="loan-limit-check", version_id="bv_ver001",)
# Rejectclient.boundaries.reject( project_id="proj_abc123", boundary_ref="loan-limit-check", version_id="bv_ver001",)List versions
Section titled “List versions”versions = client.boundaries.versions( project_id="proj_abc123", boundary_ref="loan-limit-check",)
for v in versions["items"]: print(v["id"], v["status"])Get a specific version
Section titled “Get a specific version”version = client.boundaries.get_version( project_id="proj_abc123", boundary_ref="loan-limit-check", version_id="bv_ver001",)print(version["dsl_source"])Diff two versions
Section titled “Diff two versions”Compare two boundary versions to see what changed:
diff = client.boundaries.diff( project_id="proj_abc123", boundary_ref="loan-limit-check", v1="bv_ver001", v2="bv_ver002",)print(diff)