Skip to content

Commit

Permalink
docs & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thulasirajkomminar committed Feb 14, 2024
1 parent 0637bcc commit a9eef01
Show file tree
Hide file tree
Showing 37 changed files with 177 additions and 193 deletions.
42 changes: 42 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!---
See what makes a good Pull Request at: https://hashicorp.github.io/terraform-provider-aws/raising-a-pull-request/
--->
### Description
<!---
Please provide a helpful description of what change this pull request will introduce.
--->


### Relations
<!---
If your pull request fully resolves and should automatically close the linked issue, use Closes. Otherwise, use Relates.
For Example:
Relates #0000
or
Closes #0000
--->

Closes #0000

### References
<!---
Optionally, provide any helpful references that may help the reviewer(s).
--->


### Output from Acceptance Testing
<!--
Replace TestAccXXX with a pattern that matches the tests affected by this PR.
Replace ec2 with the service package corresponding to your tests.
For more information on the `-run` flag, see the `go test` documentation at https://tip.golang.org/cmd/go/#hdr-Testing_flags.
-->

```console
% make testacc

...
```
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.1.0
## [0.1.0] - 2024-02-14

### Added:

FEATURES:
* **New Data Source:** `influxdb_authorization`
* **New Data Source:** `influxdb_authorizations`
* **New Data Source:** `influxdb_bucket`
Expand Down
6 changes: 0 additions & 6 deletions GNUmakefile

This file was deleted.

17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
default: testacc

# Run acceptance tests
.PHONY: testacc
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m

.PHONY: golint
golint:
golangci-lint run

.PHONY: docs
docs:
export GOBIN=$PWD/bin
export PATH=$GOBIN:$PATH
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
tfplugindocs generate
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ If you wish to work on the provider, you'll first need [Go](http://www.golang.or

To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

To generate or update documentation, run `go generate`.
To generate or update documentation, run `make docs`.

In order to run the full suite of Acceptance tests, run `make testacc`.

Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "influxdb_authorization Data Source - terraform-provider-influxdb"
subcategory: ""
description: |-
Retrieves an authorization. Use this data source to retrieve information about an API token, including the token's permissions and the user that the token is scoped to.
---

# influxdb_authorization (Data Source)


Retrieves an authorization. Use this data source to retrieve information about an API token, including the token's permissions and the user that the token is scoped to.



Expand Down
9 changes: 3 additions & 6 deletions docs/data-sources/authorizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "influxdb_authorizations Data Source - terraform-provider-influxdb"
subcategory: ""
description: |-
Lists all authorizations.
---

# influxdb_authorizations (Data Source)


Lists all authorizations.



Expand All @@ -22,14 +22,11 @@ description: |-
<a id="nestedatt--authorizations"></a>
### Nested Schema for `authorizations`

Required:

- `id` (String) The authorization ID.

Read-Only:

- `created_at` (String) Authorizations creation date.
- `description` (String) A description of the token.
- `id` (String) The authorization ID.
- `org` (String) An Organization name. Specifies the organization that owns the authorization.
- `org_id` (String) An organization ID. Specifies the organization that owns the authorization.
- `permissions` (Attributes List) A list of permissions for an authorization. (see [below for nested schema](#nestedatt--authorizations--permissions))
Expand Down
5 changes: 2 additions & 3 deletions docs/data-sources/bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "influxdb_bucket Data Source - terraform-provider-influxdb"
subcategory: ""
description: |-
Retrieves a bucket. Use this data source to retrieve information for a specific bucket.
---

# influxdb_bucket (Data Source)


Retrieves a bucket. Use this data source to retrieve information for a specific bucket.



Expand All @@ -26,6 +26,5 @@ description: |-
- `id` (String) A Bucket ID.
- `org_id` (String) An organization ID.
- `retention_days` (Number) The retention days for the bucket.
- `schema_type` (String) The Bucket schema type.
- `type` (String) The Bucket type.
- `updated_at` (String) Last bucket update date.
5 changes: 2 additions & 3 deletions docs/data-sources/buckets.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "influxdb_buckets Data Source - terraform-provider-influxdb"
subcategory: ""
description: |-
Lists buckets. InfluxDB retrieves buckets owned by the organization associated with the authorization (API token).
---

# influxdb_buckets (Data Source)


Lists buckets. InfluxDB retrieves buckets owned by the organization associated with the authorization (API token).



Expand All @@ -30,6 +30,5 @@ Read-Only:
- `name` (String) A Bucket name.
- `org_id` (String) An organization ID.
- `retention_days` (Number) The retention days for the bucket.
- `schema_type` (String) The Bucket schema type.
- `type` (String) The Bucket type.
- `updated_at` (String) Last bucket update date.
4 changes: 2 additions & 2 deletions docs/data-sources/organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "influxdb_organization Data Source - terraform-provider-influxdb"
subcategory: ""
description: |-
Retrieves an organization. Use this data source to retrieve information for a specific organization.
---

# influxdb_organization (Data Source)


Retrieves an organization. Use this data source to retrieve information for a specific organization.



Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/organizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "influxdb_organizations Data Source - terraform-provider-influxdb"
subcategory: ""
description: |-
Lists organizations. InfluxDB returns all organizations.
---

# influxdb_organizations (Data Source)


Lists organizations. InfluxDB returns all organizations.



Expand Down
19 changes: 9 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
page_title: "InfluxDB Provider"
subcategory: ""
description: |-
Use the InfluxDB provider to deploy and manage resources supported by InfluxDB. You must configure the provider with the proper credentials before you can use it.
---

# InfluxDB Provider
Expand All @@ -16,15 +16,6 @@ Use the InfluxDB provider to deploy and manage resources supported by InfluxDB.
provider "influxdb" {}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `token` (String, Sensitive) An InfluxDB token string
- `url` (String) The InfluxDB Cloud Dedicated server URL


## Environment Variables

Credentials can be provided by using the `INFLUXDB_URL` and `INFLUXDB_TOKEN`.
Expand All @@ -39,3 +30,11 @@ export INFLUXDB_TOKEN="influxdb-token"
terraform plan
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `token` (String, Sensitive) An InfluxDB token string
- `url` (String) The InfluxDB Cloud Dedicated server URL
4 changes: 2 additions & 2 deletions docs/resources/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "influxdb_authorization Resource - terraform-provider-influxdb"
subcategory: ""
description: |-
Manages an InfluxDB Authorization
Creates and manages an authorization and returns the authorization with the generated API token. Use this resource to create/manage an authorization, which generates an API token with permissions to read or write to a specific resource or type of resource.
---

# influxdb_authorization (Resource)

Manages an InfluxDB Authorization
Creates and manages an authorization and returns the authorization with the generated API token. Use this resource to create/manage an authorization, which generates an API token with permissions to read or write to a specific resource or type of resource.



Expand Down
5 changes: 2 additions & 3 deletions docs/resources/bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "influxdb_bucket Resource - terraform-provider-influxdb"
subcategory: ""
description: |-
Manages an InfluxDB bucket
Creates and manages a bucket.
---

# influxdb_bucket (Resource)

Manages an InfluxDB bucket
Creates and manages a bucket.



Expand All @@ -30,5 +30,4 @@ Manages an InfluxDB bucket

- `created_at` (String) Bucket creation date.
- `id` (String) A Bucket ID.
- `schema_type` (String) The Bucket schema type.
- `updated_at` (String) Last bucket update date.
4 changes: 2 additions & 2 deletions docs/resources/organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "influxdb_organization Resource - terraform-provider-influxdb"
subcategory: ""
description: |-
Manages an InfluxDB Organization
Creates and manages new organization.
---

# influxdb_organization (Resource)

Manages an InfluxDB Organization
Creates and manages new organization.



Expand Down
2 changes: 2 additions & 0 deletions internal/provider/authorization_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func (d *AuthorizationDataSource) Metadata(ctx context.Context, req datasource.M
func (d *AuthorizationDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
// This description is used by the documentation generator and the language server.
Description: "Retrieves an authorization. Use this data source to retrieve information about an API token, including the token's permissions and the user that the token is scoped to.",

Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Required: true,
Expand Down
29 changes: 0 additions & 29 deletions internal/provider/authorization_data_source_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/provider/authorization_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (r *AuthorizationResource) Metadata(ctx context.Context, req resource.Metad
func (r *AuthorizationResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "Manages an InfluxDB Authorization",
Description: "Creates and manages an authorization and returns the authorization with the generated API token. Use this resource to create/manage an authorization, which generates an API token with permissions to read or write to a specific resource or type of resource.",

Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Expand Down
54 changes: 0 additions & 54 deletions internal/provider/authorization_resource_test.go

This file was deleted.

Loading

0 comments on commit a9eef01

Please sign in to comment.