README.md
1Terraform Cloud/Enterprise Go Client
2==============================
3
4[![Build Status](https://circleci.com/gh/hashicorp/go-tfe.svg?style=shield)](https://circleci.com/gh/hashicorp/go-tfe)
5[![GitHub license](https://img.shields.io/github/license/hashicorp/go-tfe.svg)](https://github.com/hashicorp/go-tfe/blob/master/LICENSE)
6[![GoDoc](https://godoc.org/github.com/hashicorp/go-tfe?status.svg)](https://godoc.org/github.com/hashicorp/go-tfe)
7[![Go Report Card](https://goreportcard.com/badge/github.com/hashicorp/go-tfe)](https://goreportcard.com/report/github.com/hashicorp/go-tfe)
8[![GitHub issues](https://img.shields.io/github/issues/hashicorp/go-tfe.svg)](https://github.com/hashicorp/go-tfe/issues)
9
10The official Go API client for [Terraform Cloud/Enterprise](https://www.hashicorp.com/products/terraform).
11
12This client supports the [Terraform Cloud V2 API](https://www.terraform.io/docs/cloud/api/index.html).
13As Terraform Enterprise is a self-hosted distribution of Terraform Cloud, this
14client supports both Cloud and Enterprise use cases. In all package
15documentation and API, the platform will always be stated as 'Terraform
16Enterprise' - but a feature will be explicitly noted as only supported in one or
17the other, if applicable (rare).
18
19Note this client is in beta and is subject to change (though it is generally
20quite stable). We will indicate any breaking changes by releasing new versions.
21Until the release of v1.0, any minor version changes will indicate possible
22breaking changes. Patch version changes will be used for both bugfixes and
23non-breaking changes.
24
25## Installation
26
27Installation can be done with a normal `go get`:
28
29```
30go get -u github.com/hashicorp/go-tfe
31```
32
33## Usage
34
35```go
36import tfe "github.com/hashicorp/go-tfe"
37```
38
39Construct a new TFE client, then use the various endpoints on the client to
40access different parts of the Terraform Enterprise API. For example, to list
41all organizations:
42
43```go
44config := &tfe.Config{
45 Token: "insert-your-token-here",
46}
47
48client, err := tfe.NewClient(config)
49if err != nil {
50 log.Fatal(err)
51}
52
53orgs, err := client.Organizations.List(context.Background(), tfe.OrganizationListOptions{})
54if err != nil {
55 log.Fatal(err)
56}
57```
58
59## Documentation
60
61For complete usage of the API client, see the full [package docs](https://godoc.org/github.com/hashicorp/go-tfe).
62
63## API Coverage
64
65Most of the [Terraform Cloud/Enterprise V2 API](https://www.terraform.io/docs/cloud/api/index.html) is supported in this
66client. Currently, the separate [Admin API](https://www.terraform.io/docs/cloud/api/admin/index.html) - applicable only
67to Terraform Enterprise - is not.
68
69
70## Examples
71
72See the [examples directory](https://github.com/hashicorp/go-tfe/tree/master/examples).
73
74## Running tests
75
76See [TESTS.md](https://github.com/hashicorp/go-tfe/tree/master/TESTS.md).
77
78## Issues and Contributing
79
80If you find an issue with this package, please report an issue. If you'd like,
81we welcome any contributions. Fork this repository and submit a pull request.
82
83## Releases
84
85Documentation updates and test fixes that only touch test files don't require a release or tag. You can just merge these changes into master once they have been approved.
86
87### Creating a release
881. Merge your approved branch into master.
891. [Create a new release in GitHub](https://help.github.com/en/github/administering-a-repository/creating-releases).
90 - Click on "Releases" and then "Draft a new release"
91 - Set the `tag version` to a new tag, using [Semantic Versioning](https://semver.org/) as a guideline.
92 - Set the `target` as master.
93 - Set the `Release title` to the tag you created, `vX.Y.Z`
94 - Use the description section to describe why you're releasing and what changes you've made. You should include links to merged PRs
95 - Consider using the following headers in the description of your release:
96 - BREAKING CHANGES: Use this for any changes that aren't backwards compatible. Include details on how to handle these changes.
97 - FEATURES: Use this for any large new features added,
98 - ENHANCEMENTS: Use this for smaller new features added
99 - BUG FIXES: Use this for any bugs that were fixed.
100 - NOTES: Use this section if you need to include any additional notes on things like upgrading, upcoming deprecations, or any other information you might want to highlight.
101
102 Markdown example:
103
104 ```markdown
105 ENHANCEMENTS
106 * Add description of new small feature (#3)[link-to-pull-request]
107
108 BUG FIXES
109 * Fix description of a bug (#2)[link-to-pull-request]
110 * Fix description of another bug (#1)[link-to-pull-request]
111 ```
112
113 - Don't attach any binaries. The zip and tar.gz assets are automatically created and attached after you publish your release.
114 - Click "Publish release" to save and publish your release.
115
116