Skip to content

Commit c786dbe

Browse files
committed
docs: add support for description in instance schema
1 parent 78d7430 commit c786dbe

File tree

4 files changed

+109
-72
lines changed

4 files changed

+109
-72
lines changed

internal/services/instance/image.go

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -108,59 +108,72 @@ func ResourceImage() *schema.Resource {
108108
Elem: &schema.Resource{
109109
Schema: map[string]*schema.Schema{
110110
"id": {
111-
Type: schema.TypeString,
112-
Computed: true,
111+
Type: schema.TypeString,
112+
Description: "UUID of the additional volume",
113+
Computed: true,
113114
},
114115
"name": {
115-
Type: schema.TypeString,
116-
Computed: true,
116+
Type: schema.TypeString,
117+
Description: "Name of the additional volume",
118+
Computed: true,
117119
},
118120
"export_uri": {
119-
Type: schema.TypeString,
120-
Computed: true,
121+
Type: schema.TypeString,
122+
Description: "URI of the additional volume",
123+
Computed: true,
121124
},
122125
"size": {
123-
Type: schema.TypeInt,
124-
Computed: true,
126+
Type: schema.TypeInt,
127+
Description: "Size of the additional volume",
128+
Computed: true,
125129
},
126130
"volume_type": {
127-
Type: schema.TypeString,
128-
Computed: true,
131+
Type: schema.TypeString,
132+
Description: "Type of the additional volume",
133+
Computed: true,
129134
},
130135
"creation_date": {
131-
Type: schema.TypeString,
132-
Computed: true,
136+
Type: schema.TypeString,
137+
Description: "Date and time of the creation of the additional volume (RFC3339)",
138+
Computed: true,
133139
},
134140
"modification_date": {
135-
Type: schema.TypeString,
136-
Computed: true,
141+
Type: schema.TypeString,
142+
Description: "Date and time of the modification of the additional volume (RFC3339)",
143+
Computed: true,
137144
},
138145
"organization": {
139-
Type: schema.TypeString,
140-
Computed: true,
146+
Type: schema.TypeString,
147+
Description: "Organization ID of the additional volume",
148+
Computed: true,
141149
},
142150
"project": {
143-
Type: schema.TypeString,
144-
Computed: true,
151+
Type: schema.TypeString,
152+
Description: "Project ID of the additional volume",
153+
Computed: true,
145154
},
146155
"tags": {
147-
Type: schema.TypeList,
148-
Computed: true,
156+
Type: schema.TypeList,
157+
Description: "List of tags attached to the additional volume",
158+
Computed: true,
149159
Elem: &schema.Schema{
150160
Type: schema.TypeString,
151161
},
152162
},
153163
"state": {
154-
Type: schema.TypeString,
155-
Computed: true,
164+
Type: schema.TypeString,
165+
Description: "The state of the additional volume",
166+
Computed: true,
156167
},
157168
"zone": {
158-
Type: schema.TypeString,
159-
Computed: true,
169+
Type: schema.TypeString,
170+
Description: "Zone ID of the additional volume",
171+
Computed: true,
160172
},
161173
"server": {
162-
Type: schema.TypeMap,
163-
Computed: true,
174+
Type: schema.TypeMap,
175+
Description: "Server",
176+
Computed: true,
164177
Elem: &schema.Schema{
165178
Type: schema.TypeString,
166179
},

internal/services/instance/security_group.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ func ResourceSecurityGroup() *schema.Resource {
7878
},
7979
"external_rules": {
8080
Type: schema.TypeBool,
81+
Description: "External rules for this security group",
8182
Optional: true,
8283
Default: false,
8384
ConflictsWith: []string{"inbound_rule", "outbound_rule"},

internal/services/instance/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ func ResourceServer() *schema.Resource {
220220
},
221221
"ip_ids": {
222222
Type: schema.TypeList,
223+
Description: "The IDs of the reserved IP for the server",
223224
Optional: true,
224225
ConflictsWith: []string{"ip_id"},
225226
Elem: &schema.Schema{

internal/services/instance/servers_data_source.go

Lines changed: 68 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -36,38 +36,45 @@ func DataSourceServers() *schema.Resource {
3636
Description: "Servers with these exact tags are listed.",
3737
},
3838
"servers": {
39-
Type: schema.TypeList,
40-
Computed: true,
39+
Type: schema.TypeList,
40+
Description: "Servers",
41+
Computed: true,
4142
Elem: &schema.Resource{
4243
Schema: map[string]*schema.Schema{
4344
"id": {
44-
Computed: true,
45-
Type: schema.TypeString,
45+
Computed: true,
46+
Description: "UUID of the server.",
47+
Type: schema.TypeString,
4648
},
4749
"public_ip": {
48-
Computed: true,
49-
Type: schema.TypeString,
50-
Deprecated: "Use public_ips instead",
50+
Computed: true,
51+
Description: "Public IP address.",
52+
Type: schema.TypeString,
53+
Deprecated: "Use public_ips instead",
5154
},
5255
"public_ips": {
53-
Type: schema.TypeList,
54-
Computed: true,
56+
Type: schema.TypeList,
57+
Description: "Public IPs associated with this server.",
58+
Computed: true,
5559
Elem: &schema.Resource{
5660
Schema: map[string]*schema.Schema{
5761
"id": {
58-
Type: schema.TypeString,
59-
Computed: true,
62+
Type: schema.TypeString,
63+
Description: "UUID of the public IP.",
64+
Computed: true,
6065
},
6166
"address": {
62-
Type: schema.TypeString,
63-
Computed: true,
67+
Type: schema.TypeString,
68+
Description: "Address of the server",
69+
Computed: true,
6470
},
6571
},
6672
},
6773
},
6874
"private_ip": {
69-
Computed: true,
70-
Type: schema.TypeString,
75+
Computed: true,
76+
Description: "Private IP address of the server.",
77+
Type: schema.TypeString,
7178
},
7279
"private_ips": {
7380
Type: schema.TypeList,
@@ -90,68 +97,83 @@ func DataSourceServers() *schema.Resource {
9097
},
9198
},
9299
"state": {
93-
Computed: true,
94-
Type: schema.TypeString,
100+
Computed: true,
101+
Description: "State of the server",
102+
Type: schema.TypeString,
95103
},
96104
"name": {
97-
Computed: true,
98-
Type: schema.TypeString,
105+
Computed: true,
106+
Description: "Name of the server",
107+
Type: schema.TypeString,
99108
},
100109
"boot_type": {
101-
Computed: true,
102-
Type: schema.TypeString,
110+
Computed: true,
111+
Description: "Boot type",
112+
Type: schema.TypeString,
103113
},
104114
"bootscript_id": {
105-
Computed: true,
106-
Type: schema.TypeString,
107-
Deprecated: "bootscript are not supported",
115+
Computed: true,
116+
Type: schema.TypeString,
117+
Description: "UUID of the bootscript",
118+
Deprecated: "bootscript are not supported",
108119
},
109120
"type": {
110-
Computed: true,
111-
Type: schema.TypeString,
121+
Computed: true,
122+
Description: "Type of the server",
123+
Type: schema.TypeString,
112124
},
113125
"tags": {
114-
Computed: true,
115-
Type: schema.TypeList,
126+
Computed: true,
127+
Description: "List of tags assigned to the server.",
128+
Type: schema.TypeList,
116129
Elem: &schema.Schema{
117130
Type: schema.TypeString,
118131
},
119132
},
120133
"security_group_id": {
121-
Computed: true,
122-
Type: schema.TypeString,
134+
Computed: true,
135+
Description: "Security group ID",
136+
Type: schema.TypeString,
123137
},
124138
"enable_ipv6": {
125-
Computed: true,
126-
Type: schema.TypeBool,
139+
Computed: true,
140+
Description: "Whether to enable IPv6 support",
141+
Type: schema.TypeBool,
127142
},
128143
"enable_dynamic_ip": {
129-
Computed: true,
130-
Type: schema.TypeBool,
144+
Computed: true,
145+
Description: "Whether to enable dynamic IP addresses on this server",
146+
Type: schema.TypeBool,
131147
},
132148
"image": {
133-
Computed: true,
134-
Type: schema.TypeString,
149+
Computed: true,
150+
Description: "Image ID of the server",
151+
Type: schema.TypeString,
135152
},
136153
"placement_group_id": {
137-
Computed: true,
138-
Type: schema.TypeString,
154+
Computed: true,
155+
Description: "Placement Group ID",
156+
Type: schema.TypeString,
139157
},
140158
"placement_group_policy_respected": {
141-
Computed: true,
142-
Type: schema.TypeBool,
159+
Computed: true,
160+
Description: "Whether the placement group policy respected or not",
161+
Type: schema.TypeBool,
143162
},
144163
"ipv6_address": {
145-
Computed: true,
146-
Type: schema.TypeString,
164+
Computed: true,
165+
Description: "IPv6 Address for this server",
166+
Type: schema.TypeString,
147167
},
148168
"ipv6_gateway": {
149-
Computed: true,
150-
Type: schema.TypeString,
169+
Computed: true,
170+
Description: "IPv6 gateway address",
171+
Type: schema.TypeString,
151172
},
152173
"ipv6_prefix_length": {
153-
Computed: true,
154-
Type: schema.TypeInt,
174+
Computed: true,
175+
Description: "IPv6 prefix length",
176+
Type: schema.TypeInt,
155177
},
156178
"zone": zonal.Schema(),
157179
"organization_id": account.OrganizationIDSchema(),

0 commit comments

Comments
 (0)