Skip to content

Add agent pool relationship update APIs#161

Closed
TanyaSingh369-svg wants to merge 2 commits into
next-1.0.0from
feature/agent-pool-api-parity
Closed

Add agent pool relationship update APIs#161
TanyaSingh369-svg wants to merge 2 commits into
next-1.0.0from
feature/agent-pool-api-parity

Conversation

@TanyaSingh369-svg

@TanyaSingh369-svg TanyaSingh369-svg commented May 21, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds dedicated agent pool relationship update APIs to improve parity and support full relationship replacement behavior for workspaces and projects.

Changes included

  • Added dedicated relationship update methods:
    - update_allowed_workspaces()
    - update_allowed_projects()
    - update_excluded_workspaces()
  • Added new option models:
    - AgentPoolAllowedWorkspacesUpdateOptions
    - AgentPoolAllowedProjectsUpdateOptions
    - AgentPoolExcludedWorkspacesUpdateOptions
  • Added support for clearing relationship arrays by passing an empty list.
    - This resolves the issue where the generic update() flow skipped empty relationships and could not clear existing values.
  • Updated agent pool examples to demonstrate:
    - assigning/removing workspaces
    - updating allowed workspaces
    - clearing allowed workspaces
    - updating excluded workspaces
    - updating allowed projects
    - clearing allowed projects

Output

Unit tests

Screenshot 2026-05-21 at 1 09 38 PM

Example validation

Executed:

PYTHONPATH=. python examples/agent_pool.py

Validated:
- allowed workspace updates
- excluded workspace updates
- allowed project updates
- clearing relationship arrays using empty lists
- workspace/project relationship assignment flows
- agent token creation and cleanup

Example completed successfully against a real TFE organization.
Screenshot 2026-05-21 at 1 12 49 PM

@TanyaSingh369-svg TanyaSingh369-svg requested a review from a team as a code owner May 21, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants