Skip to content

Workspace API Specs - #15

Merged
iam404 merged 6 commits into
mainfrom
Sivaselvan32/WorkspaceImplementation
Sep 17, 2025
Merged

Workspace API Specs#15
iam404 merged 6 commits into
mainfrom
Sivaselvan32/WorkspaceImplementation

Conversation

@isivaselvan

@isivaselvan isivaselvan commented Sep 12, 2025

Copy link
Copy Markdown
Collaborator

Description

Added the Core features of Workspace resources with methods below at resource/workspace.py

  • Creation of workspace --> create()
  • Update the already created workspace using ID, Name --> update(), update_by_id()
  • Provides a list of created workspace --> list()
  • Reads the created workspace --> read(), read_with_options(), read_by_id(), read_by_id_with_options()
  • Delete the existing workspace --> delete(), delete_by_id(), safe_delete(), safe_delete_by_id()
  • VCS Operations --> remove_vcs_connection(), remove_vcs_connection_by_id()
  • Lock Operations --> lock(), unlock(), force_unlock()
  • SSH Key Operations --> assign_ssh_key(), unassign_ssh_key()
  • Remote State Consumer Operations --> list_remote_state_consumers(), add_remote_state_consumers(), remove_remote_state_consumers(), update_remote_state_consumers()
  • Tag Operations --> list_tags(), add_tags(), remove_tags()
  • Tag Binding Operations --> list_tag_bindings(), list_effective_tag_bindings(), add_tag_bindings(), delete_all_tag_bindings()
  • Data Retention Policy Operations --> read_data_retention_policy(), read_data_retention_policy_choice(), set_data_retention_policy(), set_data_retention_policy_delete_older(), set_data_retention_policy_dont_delete(), delete_data_retention_policy()

Added the Workspace specific

  • Validation and Parameter Errors at errors.py
  • Types at types.py
  • Validations at utils.py

Testing plan

Refer the files

  • Test file at tests/units/test_workspace.py
  • Usage of module at examples/workspace_example.py

External links

JIRA

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

Rollback Plan

Changes to Security Controls

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.

  • If applicable, I've documented the impact of any changes to security controls.

    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

If you have any questions, please contact your direct supervisor, GRC (#team-grc), or the PCI working group (#proj-pci-reboot). You can also find more information at PCI Compliance.

@isivaselvan
isivaselvan requested a review from a team as a code owner September 12, 2025 06:29
@isivaselvan isivaselvan changed the title Workspace CRUD, VCS, Lock, SSH key Ops methods were added Workspace API Specs Sep 15, 2025
Comment thread examples/workspace_example.py Outdated
# Add the source directory to the path for direct execution
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))

from tfe import Client

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be TFEClient right ?

Comment thread examples/workspace_example.py Outdated

def __init__(self, token: str, address: str = "https://app.terraform.io"):
"""Initialize the workspace manager."""
self.client = Client(token=token, address=address)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFEClient ?

Comment thread src/tfe/workspace_validation.py Outdated
@@ -0,0 +1,152 @@
"""Workspace validation functions similar to Go implementation."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content of this file should go under utils.py

@iam404
iam404 merged commit 938566f into main Sep 17, 2025
11 checks passed
@iam404
iam404 deleted the Sivaselvan32/WorkspaceImplementation branch October 28, 2025 06:37
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