Skip to content

Commit

Permalink
Improve generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Jul 20, 2024
1 parent d300ee8 commit f561eeb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
page_title: "netboxbgp Provider"
subcategory: ""
description: |-
This provider allows managing BGP resources in Netbox, when the Netbox BGP plugin https://github.com/netbox-community/netbox-bgp is installed.
The provider is intentionally using a similar structure to the e-breuninger/netbox https://registry.terraform.io/providers/e-breuninger/netbox/latest provider. If you're already using that provider, this provider should work smoothly alongside it.
---

# netboxbgp Provider

This provider allows managing BGP resources in Netbox, when the [Netbox BGP plugin](https://github.com/netbox-community/netbox-bgp) is installed.

The provider is intentionally using a similar structure to the [`e-breuninger/netbox`](https://registry.terraform.io/providers/e-breuninger/netbox/latest) provider. If you're already using that provider, this provider should work smoothly alongside it.

## Example Usage

```terraform
provider "netboxbgp" {
# example configuration here
server_url = "https://netbox.my-company.net"
api_token = var.netbox_api_token
}
```

Expand Down
3 changes: 0 additions & 3 deletions examples/data-sources/scaffolding_example/data-source.tf

This file was deleted.

3 changes: 2 additions & 1 deletion examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
provider "netboxbgp" {
# example configuration here
server_url = "https://netbox.my-company.net"
api_token = var.netbox_api_token
}
3 changes: 0 additions & 3 deletions examples/resources/scaffolding_example/resource.tf

This file was deleted.

7 changes: 7 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package provider
import (
"context"
"crypto/tls"
_ "embed"
"net/http"

"github.com/ffddorf/terraform-provider-netbox-bgp/client"
Expand All @@ -20,6 +21,11 @@ import (
// Ensure NetboxBGPProvider satisfies various provider interfaces.
var _ provider.Provider = &NetboxBGPProvider{}

var (
//go:embed provider.md
providerDocs string
)

// NetboxBGPProvider defines the provider implementation.
type NetboxBGPProvider struct {
// version is set to the provider version on release, "dev" when the
Expand Down Expand Up @@ -51,6 +57,7 @@ func (p *NetboxBGPProvider) Metadata(ctx context.Context, req provider.MetadataR

func (p *NetboxBGPProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: providerDocs,
Attributes: map[string]schema.Attribute{
"server_url": schema.StringAttribute{
MarkdownDescription: "Location of Netbox server including scheme (http or https) and optional port. Can be set via the `NETBOX_SERVER_URL` environment variable.",
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This provider allows managing BGP resources in Netbox, when the [Netbox BGP plugin](https://github.com/netbox-community/netbox-bgp) is installed.

The provider is intentionally using a similar structure to the [`e-breuninger/netbox`](https://registry.terraform.io/providers/e-breuninger/netbox/latest) provider. If you're already using that provider, this provider should work smoothly alongside it.

0 comments on commit f561eeb

Please sign in to comment.