Coder Social home page Coder Social logo

terraform-enterprise-api-python-client's Introduction

Hey, I'm James

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-api-python-client's People

Contributors

angad87 avatar flaviotorres avatar jfryy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

terraform-enterprise-api-python-client's Issues

workspace - change execution mode

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

workspace update doesn't work

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,
        )

No page management in list queries

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.

Add update workspace

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.