generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 41
/
custom_health_data_source.go
102 lines (97 loc) · 2.78 KB
/
custom_health_data_source.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package connector
import (
"github.com/harness/terraform-provider-harness/helpers"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func DatasourceConnectorCustomHealthSource() *schema.Resource {
resource := &schema.Resource{
Description: "Datasource for looking up a Custom Health source connector.",
ReadContext: resourceConnectorCustomHealthSourceRead,
Schema: map[string]*schema.Schema{
"url": {
Description: "URL of the Custom Health source server.",
Type: schema.TypeString,
Computed: true,
},
"method": {
Description: "HTTP Verb Method for the API Call",
Type: schema.TypeString,
Computed: true,
},
"validation_body": {
Description: "Body to be sent with the API Call",
Type: schema.TypeString,
Computed: true,
},
"validation_path": {
Description: "Path to be added to the base URL for the API Call",
Type: schema.TypeString,
Computed: true,
},
"delegate_selectors": {
Description: "Tags to filter delegates for connection.",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"headers": {
Description: "Headers.",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"key": {
Description: "Key.",
Type: schema.TypeString,
Computed: true,
},
"encrypted_value_ref": {
Description: "Reference to the Harness secret containing the encrypted value." + secret_ref_text,
Type: schema.TypeString,
Computed: true,
},
"value": {
Description: "Value.",
Type: schema.TypeString,
Computed: true,
},
"value_encrypted": {
Description: "Encrypted value.",
Type: schema.TypeBool,
Computed: true,
},
}},
},
"params": {
Description: "Parameters.",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"key": {
Description: "Key.",
Type: schema.TypeString,
Computed: true,
},
"encrypted_value_ref": {
Description: "Reference to the Harness secret containing the encrypted value." + secret_ref_text,
Type: schema.TypeString,
Computed: true,
},
"value": {
Description: "Value.",
Type: schema.TypeString,
Computed: true,
},
"value_encrypted": {
Description: "Encrypted value.",
Type: schema.TypeBool,
Computed: true,
},
}},
},
},
}
helpers.SetMultiLevelDatasourceSchemaIdentifierRequired(resource.Schema)
return resource
}