Metadata-Version: 2.1
Name: tfc_admin
Version: 1.1.0
Summary: Make Terraform Cloud API calls for common platform administration tasks.
Home-page: https://gitlab.com/fer1035_python/modules/pypi-tfc_admin
License: GPL-2.0-only
Keywords: terraform,cloud,administration,api,calls
Author: Ahmad Ferdaus Abd Razak
Author-email: fer1035@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: requests (>=2.27.1,<3.0.0)
Project-URL: Repository, https://gitlab.com/fer1035_python/modules/pypi-tfc_admin
Description-Content-Type: text/x-rst

=============
**tfc_admin**
=============

Overview
--------

Make Terraform Cloud API calls for common platform administration tasks.

Reference
---------

`Terraform Cloud API Documentation <https://developer.hashicorp.com/terraform/cloud-docs/api-docs>`_

Available Functions
-------------------

- Show organization details
- List teams
- List projects
- Get project ID from project name
- List workspaces in a project
- Get workspace ID from workspace name
- Move workspace into a project

Examples
--------

.. code-block:: PYTHON

   import sys
   import tfc_admin

   # List all teams in an organization.
   teams_list = []
   page_number = 1

   # Iterate through all pages of teams.
   while True:
      teams = tfc_admin.get_teams(
         sys.argv[1],  # token
         sys.argv[2],  # organization
         page_number
      )
      if not teams['data']:
         break
      for team in teams['data']:
         teams_list.append(team['attributes']['name'])
      page_number += 1
   
   # Print the list of teams.
   print(teams_list)

