Skip to content

Commit a0ef4ad

Browse files
committed
feat: add description of webhosting
1 parent 0caa7e6 commit a0ef4ad

File tree

2 files changed

+145
-76
lines changed

2 files changed

+145
-76
lines changed

internal/services/webhosting/offer_data_source.go

Lines changed: 88 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -38,50 +38,61 @@ func DataSourceOffer() *schema.Resource {
3838
ConflictsWith: []string{"name", "control_panel"},
3939
},
4040
"billing_operation_path": {
41-
Computed: true,
42-
Type: schema.TypeString,
41+
Computed: true,
42+
Description: "Billing operation path",
43+
Type: schema.TypeString,
4344
},
4445
"product": {
45-
Type: schema.TypeList,
46-
Computed: true,
47-
Deprecated: "The product field is deprecated. Please use the offer field instead.",
46+
Type: schema.TypeList,
47+
Computed: true,
48+
Description: "Product list",
49+
Deprecated: "The product field is deprecated. Please use the offer field instead.",
4850
Elem: &schema.Resource{
4951
Schema: map[string]*schema.Schema{
5052
"name": {
51-
Type: schema.TypeString,
52-
Computed: true,
53+
Type: schema.TypeString,
54+
Computed: true,
55+
Description: "Name of the product",
5356
},
5457
"option": {
55-
Type: schema.TypeBool,
56-
Computed: true,
58+
Type: schema.TypeBool,
59+
Computed: true,
60+
Description: "Whether or not the product is in the offer",
5761
},
5862
"email_accounts_quota": {
59-
Type: schema.TypeInt,
60-
Computed: true,
63+
Type: schema.TypeInt,
64+
Description: "Limit number of email accounts",
65+
Computed: true,
6166
},
6267
"email_storage_quota": {
63-
Type: schema.TypeInt,
64-
Computed: true,
68+
Type: schema.TypeInt,
69+
Description: "Limit quantity of email storage in gigabytes",
70+
Computed: true,
6571
},
6672
"databases_quota": {
67-
Type: schema.TypeInt,
68-
Computed: true,
73+
Type: schema.TypeInt,
74+
Description: "Limit number of databases",
75+
Computed: true,
6976
},
7077
"hosting_storage_quota": {
71-
Type: schema.TypeInt,
72-
Computed: true,
78+
Type: schema.TypeInt,
79+
Description: "Limit quantity of hosting storage in gigabytes",
80+
Computed: true,
7381
},
7482
"support_included": {
75-
Type: schema.TypeBool,
76-
Computed: true,
83+
Type: schema.TypeBool,
84+
Description: "Whether or not support is included",
85+
Computed: true,
7786
},
7887
"v_cpu": {
79-
Type: schema.TypeInt,
80-
Computed: true,
88+
Type: schema.TypeInt,
89+
Description: "Limit number of virtual CPU",
90+
Computed: true,
8191
},
8292
"ram": {
83-
Type: schema.TypeInt,
84-
Computed: true,
93+
Type: schema.TypeInt,
94+
Description: "Limit quantity of memory in gigabytes",
95+
Computed: true,
8596
},
8697
},
8798
},
@@ -93,73 +104,90 @@ func DataSourceOffer() *schema.Resource {
93104
Elem: &schema.Resource{
94105
Schema: map[string]*schema.Schema{
95106
"id": {
96-
Type: schema.TypeString,
97-
Computed: true,
107+
Type: schema.TypeString,
108+
Description: "ID of the offer",
109+
Computed: true,
98110
},
99111
"name": {
100-
Type: schema.TypeString,
101-
Computed: true,
112+
Type: schema.TypeString,
113+
Description: "Name of the offer",
114+
Computed: true,
102115
},
103116
"billing_operation_path": {
104-
Type: schema.TypeString,
105-
Computed: true,
117+
Type: schema.TypeString,
118+
Description: "Billing operation path",
119+
Computed: true,
106120
},
107121
"available": {
108-
Type: schema.TypeBool,
109-
Computed: true,
122+
Type: schema.TypeBool,
123+
Description: "Whether or not the offer is available",
124+
Computed: true,
110125
},
111126
"control_panel_name": {
112-
Type: schema.TypeString,
113-
Computed: true,
127+
Type: schema.TypeString,
128+
Description: "Name of the control panel.",
129+
Computed: true,
114130
},
115131
"end_of_life": {
116-
Type: schema.TypeBool,
117-
Computed: true,
132+
Type: schema.TypeBool,
133+
Description: "Whether this offer is in end of life",
134+
Computed: true,
118135
},
119136
"quota_warning": {
120-
Type: schema.TypeString,
121-
Computed: true,
137+
Type: schema.TypeString,
138+
Description: "Quota warning for this offer",
139+
Computed: true,
122140
},
123141
"price": {
124-
Type: schema.TypeString,
125-
Computed: true,
142+
Type: schema.TypeString,
143+
Description: "Price of the offer.",
144+
Computed: true,
126145
},
127146
"options": {
128-
Type: schema.TypeList,
129-
Computed: true,
147+
Type: schema.TypeList,
148+
Description: "List of options available for a particular offer",
149+
Computed: true,
130150
Elem: &schema.Resource{
131151
Schema: map[string]*schema.Schema{
132152
"id": {
133-
Type: schema.TypeString,
134-
Computed: true,
153+
Type: schema.TypeString,
154+
Computed: true,
155+
Description: "ID of the option",
135156
},
136157
"name": {
137-
Type: schema.TypeString,
138-
Computed: true,
158+
Type: schema.TypeString,
159+
Computed: true,
160+
Description: "Name of the option",
139161
},
140162
"billing_operation_path": {
141-
Type: schema.TypeString,
142-
Computed: true,
163+
Type: schema.TypeString,
164+
Computed: true,
165+
Description: "Billing operation path",
143166
},
144167
"min_value": {
145-
Type: schema.TypeInt,
146-
Computed: true,
168+
Type: schema.TypeInt,
169+
Computed: true,
170+
Description: "Minimum value for this option",
147171
},
148172
"current_value": {
149-
Type: schema.TypeInt,
150-
Computed: true,
173+
Type: schema.TypeInt,
174+
Computed: true,
175+
Description: "Current value",
151176
},
152177
"max_value": {
153-
Type: schema.TypeInt,
154-
Computed: true,
178+
Type: schema.TypeInt,
179+
Computed: true,
180+
Description: "The maximum allowed value of this value.",
155181
},
156182
"quota_warning": {
157-
Type: schema.TypeString,
158-
Computed: true,
183+
Type: schema.TypeString,
184+
Computed: true,
185+
Description: "Quota warning",
159186
},
160187
"price": {
161-
Type: schema.TypeString,
162-
Computed: true,
188+
Type: schema.TypeString,
189+
Computed: true,
190+
Description: "Price of the options",
163191
},
164192
},
165193
},
@@ -168,8 +196,9 @@ func DataSourceOffer() *schema.Resource {
168196
},
169197
},
170198
"price": {
171-
Type: schema.TypeString,
172-
Computed: true,
199+
Type: schema.TypeString,
200+
Description: "Price of the offer.",
201+
Computed: true,
173202
},
174203
"region": regional.Schema(),
175204
},

internal/services/webhosting/webhosting.go

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ func ResourceWebhosting() *schema.Resource {
102102
Elem: &schema.Resource{
103103
Schema: map[string]*schema.Schema{
104104
"id": {
105-
Type: schema.TypeString,
106-
Computed: true,
105+
Type: schema.TypeString,
106+
Computed: true,
107+
Description: "ID of the active option",
107108
},
108109
"name": {
109-
Type: schema.TypeString,
110-
Computed: true,
110+
Type: schema.TypeString,
111+
Computed: true,
112+
Description: "Name of the option",
111113
},
112114
},
113115
},
@@ -124,12 +126,14 @@ func ResourceWebhosting() *schema.Resource {
124126
Elem: &schema.Resource{
125127
Schema: map[string]*schema.Schema{
126128
"dashboard": {
127-
Type: schema.TypeString,
128-
Computed: true,
129+
Type: schema.TypeString,
130+
Computed: true,
131+
Description: "URL to connect to dashboard interface",
129132
},
130133
"webmail": {
131-
Type: schema.TypeString,
132-
Computed: true,
134+
Type: schema.TypeString,
135+
Computed: true,
136+
Description: "URL to connect to Webmail interface",
133137
},
134138
},
135139
},
@@ -145,12 +149,36 @@ func ResourceWebhosting() *schema.Resource {
145149
Description: "List of DNS records associated with the webhosting.",
146150
Elem: &schema.Resource{
147151
Schema: map[string]*schema.Schema{
148-
"name": {Type: schema.TypeString, Computed: true},
149-
"type": {Type: schema.TypeString, Computed: true},
150-
"ttl": {Type: schema.TypeInt, Computed: true},
151-
"value": {Type: schema.TypeString, Computed: true},
152-
"priority": {Type: schema.TypeInt, Computed: true},
153-
"status": {Type: schema.TypeString, Computed: true},
152+
"name": {
153+
Type: schema.TypeString,
154+
Computed: true,
155+
Description: "Name of the DNS record",
156+
},
157+
"type": {
158+
Type: schema.TypeString,
159+
Computed: true,
160+
Description: "Type of the DNS record",
161+
},
162+
"ttl": {
163+
Type: schema.TypeInt,
164+
Computed: true,
165+
Description: "Time to live in seconds of the record",
166+
},
167+
"value": {
168+
Type: schema.TypeString,
169+
Computed: true,
170+
Description: "Value of the DNS record",
171+
},
172+
"priority": {
173+
Type: schema.TypeInt,
174+
Computed: true,
175+
Description: "Priority of DNS records associated with the webhosting.",
176+
},
177+
"status": {
178+
Type: schema.TypeString,
179+
Computed: true,
180+
Description: "Status of the hosting record",
181+
},
154182
},
155183
},
156184
},
@@ -160,9 +188,21 @@ func ResourceWebhosting() *schema.Resource {
160188
Description: "List of nameservers associated with the webhosting.",
161189
Elem: &schema.Resource{
162190
Schema: map[string]*schema.Schema{
163-
"hostname": {Type: schema.TypeString, Computed: true},
164-
"status": {Type: schema.TypeString, Computed: true},
165-
"is_default": {Type: schema.TypeBool, Computed: true},
191+
"hostname": {
192+
Description: "Hostname of the server",
193+
Type: schema.TypeString,
194+
Computed: true,
195+
},
196+
"status": {
197+
Description: "Status of the nameserver",
198+
Type: schema.TypeString,
199+
Computed: true,
200+
},
201+
"is_default": {
202+
Description: "Whether or not the webhosting is the default one",
203+
Type: schema.TypeBool,
204+
Computed: true,
205+
},
166206
},
167207
},
168208
},

0 commit comments

Comments
 (0)