Skip to content

Commit 28e856e

Browse files
authored
Plugin documentation (#13)
Signed-off-by: Viorel Dodin <vdodin@cisco.com>
1 parent d0a8250 commit 28e856e

File tree

15 files changed

+101
-213
lines changed

15 files changed

+101
-213
lines changed

docs/data-sources/example.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/data-sources/type.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "observability_type Data Source - observability"
4+
subcategory: ""
5+
description: |-
6+
Type data source
7+
---
8+
9+
# observability_type (Data Source)
10+
11+
Type data source
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `type_name` (String) Specifies the fully qualified type name used to get the type
21+
22+
### Optional
23+
24+
- `data` (Dynamic) JSON schema of the returned type
25+
26+
### Read-Only
27+
28+
- `id` (String) Used to provide compatibility for testing framework

docs/functions/example.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/index.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "scaffolding Provider"
3+
page_title: "observability Provider"
44
subcategory: ""
55
description: |-
66
77
---
88

9-
# scaffolding Provider
9+
# observability Provider
1010

1111

1212

13-
## Example Usage
1413

15-
```terraform
16-
provider "scaffolding" {
17-
# example configuration here
18-
}
19-
```
2014

2115
<!-- schema generated by tfplugindocs -->
2216
## Schema
2317

18+
### Required
19+
20+
- `auth_method` (String) Authentication type selected for observability API requests. Possible values(oauth, headless, service-principal)
21+
- `tenant` (String) Tenant ID used to make requests to API
22+
2423
### Optional
2524

26-
- `endpoint` (String) Example provider attribute
25+
- `password` (String, Sensitive) Password to authenticate using headless
26+
- `secrets_file` (String) Path to secrets file to authenticate using service-principal
27+
- `url` (String) URL used when authentication eg. <https://mytenant.com>
28+
- `username` (String) Username to authenticate using headless

docs/resources/example.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/resources/object.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "observability_object Resource - observability"
4+
subcategory: ""
5+
description: |-
6+
Object resource
7+
---
8+
9+
# observability_object (Resource)
10+
11+
Object resource
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `layer_id` (String) Specifies the layer ID where the object resides
21+
- `layer_type` (String) Specifies the layer type where the object resides
22+
- `type_name` (String) Specifies the fully qualified type name used to get the type
23+
24+
### Optional
25+
26+
- `data` (String) JSON schema of the returned object
27+
- `import_id` (String) ID used when doing import operation on an object
28+
- `object_id` (String) Spepcified the object ID for the particular object to get
29+
30+
### Read-Only
31+
32+
- `id` (String) Used to provide compatibility for testing framework

examples/data-sources/cop_example/data-source.tf

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,7 @@
44
#
55
# SPDX-License-Identifier: MPL-2.0
66

7-
terraform {
8-
required_providers {
9-
observability = {
10-
source = "testTerraform.com/appd/observability"
11-
}
12-
}
13-
}
14-
15-
provider "observability" {
16-
tenant="0eb4e853-34fb-4f77-b3fc-b9cd3b462366"
17-
auth_method="service-principal"
18-
url="https://aiops-dev.saas.appd-test.com"
19-
secrets_file="/home/vdodin/aiops_secret.json"
20-
}
21-
227

238
data "observability_type" "ns" {
249
type_name = "fmm:namespace"
25-
}
26-
27-
output "myType" {
28-
value = data.observability_type.ns
29-
}
10+
}

examples/provider/provider_oauth.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
terraform {
88
required_providers {
99
observability = {
10-
source = "testTerraform.com/appd/observability"
10+
source = "registry.terraform.io/cisco-open/observability"
1111
}
1212
}
1313
}
1414

1515
provider "observability" {
16-
tenant="47a01df9-54a0-472b-96b8-7c8f64eb7cbf"
17-
auth_method="oauth"
18-
url="https://alameda-c0-test-02.saas.appd-test.com"
16+
tenant = "47a01df9-54a0-472b-96b8-7c8f64eb7cbf"
17+
auth_method = "oauth"
18+
url = "https://alameda-c0-test-02.saas.appd-test.com"
1919
}
2020

examples/provider/provider_service_principal.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
terraform {
88
required_providers {
99
observability = {
10-
source = "testTerraform.com/appd/observability"
10+
source = "registry.terraform.io/cisco-open/observability"
1111
}
1212
}
1313
}
1414

1515
provider "observability" {
16-
tenant="47a01df9-54a0-472b-96b8-7c8f64eb7cbf"
17-
auth_method="service-principal"
18-
url="https://alameda-c0-test-02.saas.appd-test.com"
19-
secrets_file="/home/vdodin/secrets.json"
16+
tenant = "47a01df9-54a0-472b-96b8-7c8f64eb7cbf"
17+
auth_method = "service-principal"
18+
url = "https://alameda-c0-test-02.saas.appd-test.com"
19+
secrets_file = "/home/yourUser/secrets.json"
2020
}
2121

examples/resources/cop_example/resource.tf

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,23 @@
44
#
55
# SPDX-License-Identifier: MPL-2.0
66

7-
terraform {
8-
required_providers {
9-
observability = {
10-
source = "testTerraform.com/appd/observability"
11-
}
12-
}
13-
}
14-
15-
provider "observability" {
16-
tenant="0eb4e853-34fb-4f77-b3fc-b9cd3b462366"
17-
auth_method="service-principal"
18-
url="https://aiops-dev.saas.appd-test.com"
19-
secrets_file="/home/vdodin/aiops_secret.json"
20-
}
21-
22-
237
resource "observability_object" "conn" {
24-
type_name = "anzen:cloudConnection"
25-
object_id = "just-terraform-testing"
8+
type_name = "anzen:cloudConnection"
9+
object_id = "just-terraform-testing"
2610
layer_type = "TENANT"
27-
layer_id = "0eb4e853-34fb-4f77-b3fc-b9cd3b462366"
28-
import_id = "anzen:cloudConnection|just-terraform-testing|TENANT|0eb4e853-34fb-4f77-b3fc-b9cd3b462366"
11+
layer_id = "0eb4e853-34fb-4f77-b3fc-b9cd3b462366"
12+
import_id = "anzen:cloudConnection|just-terraform-testing|TENANT|0eb4e853-34fb-4f77-b3fc-b9cd3b462366"
2913
data = jsonencode(
3014
{
31-
"cloudType": "AWS",
32-
"connectionName": "just-terraform-testing",
33-
"region": "us-east-2",
34-
"accessKey": "**********",
35-
"secretAccessKey": "**********",
36-
"s3AccessLogBucket": "s3://s3-sanity-logging/",
37-
"athenaOutputBucket": "s3://s3-sanity-athena-logs/",
38-
"createTimestamp": "",
39-
"accountId": "81892134343434"
15+
"cloudType" : "AWS",
16+
"connectionName" : "just-terraform-testing",
17+
"region" : "us-east-2",
18+
"accessKey" : "**********",
19+
"secretAccessKey" : "**********",
20+
"s3AccessLogBucket" : "s3://s3-sanity-logging/",
21+
"athenaOutputBucket" : "s3://s3-sanity-athena-logs/",
22+
"createTimestamp" : "",
23+
"accountId" : "81892134343434"
4024
}
4125
)
4226
}

internal/provider/example_function.go

Lines changed: 0 additions & 50 deletions
This file was deleted.

internal/provider/object_resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func (r *ObjectResource) Metadata(_ context.Context, req resource.MetadataReques
4747
resp.TypeName = req.ProviderTypeName + "_object"
4848
}
4949

50+
// Schema defines the schema for the resource.
5051
func (r *ObjectResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
5152
resp.Schema = schema.Schema{
5253
// This description is used by the documentation generator and the language server.

internal/provider/provider.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func (p *COPProvider) Metadata(_ context.Context, _ provider.MetadataRequest, re
4545
resp.Version = p.version
4646
}
4747

48+
// Schema defines the provider-level schema for configuration data.
4849
func (p *COPProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {
4950
resp.Schema = schema.Schema{
5051
Attributes: map[string]schema.Attribute{
@@ -66,7 +67,7 @@ func (p *COPProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp *
6667
Sensitive: true,
6768
},
6869
"url": schema.StringAttribute{
69-
MarkdownDescription: "URL used when authentication eg. https://mytenant.com",
70+
MarkdownDescription: "URL used when authentication eg. <https://mytenant.com>",
7071
Optional: true,
7172
},
7273
"secrets_file": schema.StringAttribute{
@@ -276,9 +277,7 @@ func (p *COPProvider) DataSources(_ context.Context) []func() datasource.DataSou
276277
}
277278

278279
func (p *COPProvider) Functions(_ context.Context) []func() function.Function {
279-
return []func() function.Function{
280-
NewExampleFunction,
281-
}
280+
return []func() function.Function{}
282281
}
283282

284283
func New(version string) func() provider.Provider {

0 commit comments

Comments
 (0)