Skip to content

Commit

Permalink
add doc generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Schäfer committed May 16, 2022
1 parent 0b6be3d commit f960ef2
Show file tree
Hide file tree
Showing 82 changed files with 1,736 additions and 792 deletions.
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,21 @@ tools/golangci-lint:
tools/terrafmt:
cd tools && go build -o . github.com/katbyte/terrafmt

.PHONY: tools/tfplugindocs
tools/tfplugindocs:
cd tools && go build -o . github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs

.PHONY: docs-generate
docs-generate: tools/tfplugindocs
@tools/tfplugindocs

.PHONY: docs-lint
docs-lint: misspell terrafmt
@echo "==> Checking docs against linters..."
@docker run -v $(PWD):/markdown 06kellyjac/markdownlint-cli docs/ || (echo; \
echo "Unexpected issues found in docs Markdown files."; \
echo "To apply any automatic fixes, run 'make docs-lint-fix' and commit the changes."; \
exit 1)

.PHONY: docs-lint-fix
docs-lint-fix: tools/misspell tools/terrafmt
@echo "==> Applying automatic docs linter fixes..."
@tools/misspell -w -source=text docs/
@docker run -v $(PWD):/markdown 06kellyjac/markdownlint-cli --fix docs/
@tools/terrafmt fmt ./docs --pattern '*.md'

.PHONY: go-lint
Expand Down
2 changes: 1 addition & 1 deletion anxcloud/data_source_core_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func dataSourceCoreLocation() *schema.Resource {
return &schema.Resource{
Description: "Retrieves Location identified by it's `code` as selectable in the Engine.",
Description: "Retrieves a location identified by it's `code` as selectable in the Engine. Use this data source to specify the location identifier on other resources and data sources available in this provider.",
ReadContext: dataSourceCoreLocationRead,
Schema: schemaLocation(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_core_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

func dataSourceCoreLocations() *schema.Resource {
return &schema.Resource{
Description: "Provides available locations.",
ReadContext: dataSourceCoreLocationsRead,
Schema: schemaDataSourceLocations(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_cpu_performance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

func dataSourceCPUPerformanceTypes() *schema.Resource {
return &schema.Resource{
Description: "Provides available cpu performance types. This information can be used to provision virtual servers using the `anxcloud_virtual_server` resource.",
ReadContext: dataSourceCPUPerformanceTypesRead,
Schema: schemaCPUPerformanceType(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_disk_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

func dataSourceDiskTypes() *schema.Resource {
return &schema.Resource{
Description: "Provides available disk types for a specified location. This information can be used to provision virtual servers using the `anxcloud_virtual_server` resource.",
ReadContext: dataSourceDiskTypesRead,
Schema: schemaDiskTypes(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_dns_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

func dataSourceDNSRecords() *schema.Resource {
return &schema.Resource{
Description: "Provides DNS records for a specified zone.",
ReadContext: dataSourceDNSRecordsRead,
Schema: schemaDNSRecords(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_dns_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

func datasourceDNSZones() *schema.Resource {
return &schema.Resource{
Description: "Provides available DNS zones.",
ReadContext: dataSourceDNSZonesRead,
Schema: schemaDNSZones(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

func dataSourceIPAddresses() *schema.Resource {
return &schema.Resource{
Description: "Provides available IP addresses.",
ReadContext: dataSourceIPAddressesRead,
Schema: schemaIPAddresses(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_nic_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

func dataSourceNICTypes() *schema.Resource {
return &schema.Resource{
Description: "Provides available network interface card types. This information can be used to provision virtual servers using the `anxcloud_virtual_server` resource.",
ReadContext: dataSourceNICTypesRead,
Schema: schemaNICTypes(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

func dataSourceTags() *schema.Resource {
return &schema.Resource{
Description: "Provides available service tags.",
ReadContext: dataSourceTagsRead,
Schema: schemaTags(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

func dataSourceTemplate() *schema.Resource {
return &schema.Resource{
Description: "Provides available templates for specified location. This information can be used to provision virtual servers using the `anxcloud_virtual_server` resource.",
ReadContext: dataSourceTemplateRead,
Schema: schemaTemplate(),
}
Expand Down
1 change: 1 addition & 0 deletions anxcloud/data_source_vlans.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

func dataSourceVLANs() *schema.Resource {
return &schema.Resource{
Description: "Provides available VLANs.",
ReadContext: dataSourceVLANsRead,
Schema: schemaVLANs(),
}
Expand Down
6 changes: 4 additions & 2 deletions anxcloud/data_source_vsphere_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import (

func dataSourceVSphereLocations() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceVSphereLocationsRead,
Schema: schemaDataSourceVSPhereLocations(),
Description: "Provides available vSphere locations.",
ReadContext: dataSourceVSphereLocationsRead,
Schema: schemaDataSourceVSPhereLocations(),
DeprecationMessage: "Use `anxcloud_core_locations` data-source instead!",
}
}

Expand Down
1 change: 1 addition & 0 deletions anxcloud/resource_ip_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (

func resourceIPAddress() *schema.Resource {
return &schema.Resource{
Description: "This resource allows you to create and configure IP addresses.",
CreateContext: resourceIPAddressCreate,
ReadContext: resourceIPAddressRead,
UpdateContext: resourceIPAddressUpdate,
Expand Down
1 change: 1 addition & 0 deletions anxcloud/resource_network_prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (

func resourceNetworkPrefix() *schema.Resource {
return &schema.Resource{
Description: "This resource allows you to create and configure network prefix.",
CreateContext: resourceNetworkPrefixCreate,
ReadContext: resourceNetworkPrefixRead,
UpdateContext: resourceNetworkPrefixUpdate,
Expand Down
1 change: 1 addition & 0 deletions anxcloud/resource_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

func resourceTag() *schema.Resource {
return &schema.Resource{
Description: "The tag resource allows you to create and configure a tag.",
CreateContext: resourceTagCreate,
ReadContext: resourceTagRead,
DeleteContext: resourceTagDelete,
Expand Down
7 changes: 7 additions & 0 deletions anxcloud/resource_virtual_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ const (

func resourceVirtualServer() *schema.Resource {
return &schema.Resource{
Description: `
The virtual_server resource allows you to configure and run virtual machines.
### Known limitations
- removal of disks not supported
- removal of networks not supported
`,
CreateContext: resourceVirtualServerCreate,
ReadContext: resourceVirtualServerRead,
UpdateContext: resourceVirtualServerUpdate,
Expand Down
1 change: 1 addition & 0 deletions anxcloud/resource_vlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (

func resourceVLAN() *schema.Resource {
return &schema.Resource{
Description: "The VLAN resource allows you to create and configure VLAN.",
CreateContext: resourceVLANCreate,
ReadContext: resourceVLANRead,
UpdateContext: resourceVLANUpdate,
Expand Down
8 changes: 4 additions & 4 deletions anxcloud/schema_cpu_performance_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ func schemaCPUPerformanceType() map[string]*schema.Schema {
"id": {
Type: schema.TypeString,
Computed: true,
Description: "Id of the CPU performance type",
Description: "CPU performance type identifier.",
},
"prioritization": {
Type: schema.TypeString,
Computed: true,
Description: "Prio of the CPU performance type",
Description: "CPU performance type prioritization.",
},
"limit": {
Type: schema.TypeFloat,
Computed: true,
Description: "The limit of the CPU performance type",
Description: "CPU performance type limit.",
},
"unit": {
Type: schema.TypeString,
Computed: true,
Description: "The unit for the limit of the CPU performance type",
Description: "CPU performance type limit unit.",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions anxcloud/schema_disk_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func schemaDiskTypes() map[string]*schema.Schema {
"id": {
Type: schema.TypeString,
Computed: true,
Description: "Identifier of the disk type.",
Description: identifierDescription,
},
"storage_type": {
Type: schema.TypeString,
Expand All @@ -35,12 +35,12 @@ func schemaDiskTypes() map[string]*schema.Schema {
"iops": {
Type: schema.TypeInt,
Computed: true,
Description: "Disk input/output operations per second.",
Description: "Input/output operations per second.",
},
"latency": {
Type: schema.TypeInt,
Computed: true,
Description: "Disk latency.",
Description: "Latency.",
},
},
},
Expand Down
18 changes: 9 additions & 9 deletions anxcloud/schema_dns_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@ func schemaDNSRecord() map[string]*schema.Schema {
"identifier": {
Type: schema.TypeString,
Computed: true,
Description: "The record's identifier",
Description: "DNS Record identifier. Changes on revision change and therefore shouldn't be used as reference.",
},
"type": {
Type: schema.TypeString,
Required: true,
Description: "The DNS record type",
Description: "DNS record type.",
},
"rdata": {
Type: schema.TypeString,
Required: true,
Description: "The DNS record data",
Description: "DNS record data.",
},
"name": {
Type: schema.TypeString,
Required: true,
Description: "The name of the DNS record",
Description: "DNS record name.",
},
"zone_name": {
Type: schema.TypeString,
Required: true,
Description: "The name of the DNS records zone",
Description: "Zone of DNS record.",
},
"region": {
Type: schema.TypeString,
Computed: true,
Description: "The region for geodns aware records",
Description: "DNS record region (for GeoDNS aware records).",
},
"ttl": {
Type: schema.TypeInt,
Optional: true,
Description: "The region specific TTL. If nil the zone TTL will be used",
Description: "Region specific TTL. If not set the zone TTL will be used.",
},
"immutable": {
Type: schema.TypeBool,
Computed: true,
Description: "Specifies wheather or not a record is immutable",
Description: "Specifies whether or not a record is immutable.",
},
}
}
Expand All @@ -52,7 +52,7 @@ func schemaDNSRecords() map[string]*schema.Schema {
"zone_name": {
Type: schema.TypeString,
Required: true,
Description: "The parent zone",
Description: "Parent zone",
},
"records": {
Type: schema.TypeList,
Expand Down
Loading

0 comments on commit f960ef2

Please sign in to comment.