I like sharing and collaborating on software. I like simple, performant, and ergonomic software development tools too.
Fed by hand and caught with force
Our bed, sweet death will foreclose on everybody's tongues
Terraform Enterprise Python Client Library
License: MIT License
Can we update variables?
Hi, we are using your library and we need to change the workspace execution mode from organisation default to workspace level. I tried to use it and got an error. I have checked the code and there's no mentioning of this attribute.
options = {
"tf_version": self.tf_version,
"auto_apply": False,
"queue_all_runs": True,
"execution_mode": "agent",
"agent_pool_id": self.agent_pool_id,
}
workspace = self.tfe.create_workspace(name=self.data.workspace_name, options=options)
Error
TypeError: Organization.create_workspace() got an unexpected keyword argument 'execution_mode'
TypeError: Organization.create_workspace() got an unexpected keyword argument 'execution-mode'
Does your library support this? The TFE Agent is in your docs https://developer.hashicorp.com/terraform/cloud-docs/agents
and workspace api endpoints have it as well https://developer.hashicorp.com/terraform/cloud-docs/api-docs/workspaces
If i understand your code correctly, you allow passing only a few set of parameters for creation of workspace and updating it. I don't see the execution-mode in the workspace class.
https://github.com/JFryy/terraform-enterprise-api-python-client/blob/master/pyterprise/workspace.py#L133
https://github.com/JFryy/terraform-enterprise-api-python-client/blob/master/pyterprise/organization.py#L76
Hi,
trying to update multiple workspaces by updating working directories to normalized.
workspace.update(
working_directory=normalized,
)
Error:
TypeError: Object of type object_helper is not JSON serializable
After debugging, the payload send:
{
"data": {
"attributes": {
"name": "xxx",
"terraform_version": "1.1-latest",
"working-directory": "xxx",
"auto-apply": false,
"queue-all-runs": false,
"trigger-prefixes": [],
"vcs-repo": <pyterprise._api_response_object.object_helper object at 0x10bdedf00>
},
"type": "workspaces"
}
}
solving my issue with
workspace.update(
working_directory=normalized,
vcs_repo=workspace.vcs_repo.d,
)
workspace.update(vcs_repo=None)
or
workspace.update(vcs_repo={})
doesn't work.
Fix workspace list pagination.
Method that can retreive a paginated list of element (like workspaces) return only the first page (20 elements by default).
A good solution could be to use generator.
Refactor module to be entirely object oriented.
First of all thanks again for this working on this library. It has been invaluable to me and my team to have this library get things started quickly with our existing Python skils.
Just to report that the library is currently missing the option to update a TFE workspace (https://www.terraform.io/docs/cloud/api/workspaces.html#update-a-workspace).
I want to check on the status on this before I attempt to add it myself in my fork (for later upstream). And if I start on this, if you will be open to a PR.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.