Skip to content

Commit 3ac12ab

Browse files
authored
Feat/make doc fix (#2425)
* solve the problem that Deprecated of security_group_ids cannot be generated * make doc adds processing of the same sub object
1 parent 6037a88 commit 3ac12ab

File tree

97 files changed

+1444
-582
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1444
-582
lines changed

gendoc/main.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func genDoc(product, dtype, fpath, name string, resource *schema.Resource) {
214214
}
215215
if v.Required {
216216
opt := "Required"
217-
sub := getSubStruct(0, k, v)
217+
sub := getSubStruct(0, "", k, v)
218218
subStruct = append(subStruct, sub...)
219219
// get type
220220
res := parseSubtract(v, sub)
@@ -234,7 +234,7 @@ func genDoc(product, dtype, fpath, name string, resource *schema.Resource) {
234234
requiredArgs = append(requiredArgs, fmt.Sprintf("* `%s` - (%s) %s", k, opt, v.Description))
235235
} else if v.Optional {
236236
opt := "Optional"
237-
sub := getSubStruct(0, k, v)
237+
sub := getSubStruct(0, "", k, v)
238238
subStruct = append(subStruct, sub...)
239239
// get type
240240
res := parseSubtract(v, sub)
@@ -346,7 +346,7 @@ func getAttributes(step int, k string, v *schema.Schema) []string {
346346
}
347347

348348
// getSubStruct get sub structure from go file
349-
func getSubStruct(step int, k string, v *schema.Schema) []string {
349+
func getSubStruct(step int, parentK, k string, v *schema.Schema) []string {
350350
var subStructs []string
351351

352352
if v.Description == "" {
@@ -358,7 +358,11 @@ func getSubStruct(step int, k string, v *schema.Schema) []string {
358358
var subStruct []string
359359
if v.Type == schema.TypeMap || v.Type == schema.TypeList || v.Type == schema.TypeSet {
360360
if _, ok := v.Elem.(*schema.Resource); ok {
361-
subStruct = append(subStruct, fmt.Sprintf("\nThe `%s` object supports the following:\n", k))
361+
if step == 0 {
362+
subStruct = append(subStruct, fmt.Sprintf("\nThe `%s` object supports the following:\n", k))
363+
} else {
364+
subStruct = append(subStruct, fmt.Sprintf("\nThe `%s` object of `%s` supports the following:\n", k, parentK))
365+
}
362366
var (
363367
requiredArgs []string
364368
optionalArgs []string
@@ -371,6 +375,10 @@ func getSubStruct(step int, k string, v *schema.Schema) []string {
371375
if vv.ForceNew {
372376
opt += ", ForceNew"
373377
}
378+
if vv.Deprecated != "" {
379+
opt += ", **Deprecated**"
380+
vv.Description = fmt.Sprintf("%s %s", vv.Deprecated, vv.Description)
381+
}
374382
requiredArgs = append(requiredArgs, fmt.Sprintf("* `%s` - (%s) %s", kk, opt, vv.Description))
375383
} else if vv.Optional {
376384
opt := "Optional"
@@ -379,6 +387,10 @@ func getSubStruct(step int, k string, v *schema.Schema) []string {
379387
if vv.ForceNew {
380388
opt += ", ForceNew"
381389
}
390+
if vv.Deprecated != "" {
391+
opt += ", **Deprecated**"
392+
vv.Description = fmt.Sprintf("%s %s", vv.Deprecated, vv.Description)
393+
}
382394
optionalArgs = append(optionalArgs, fmt.Sprintf("* `%s` - (%s) %s", kk, opt, vv.Description))
383395
}
384396
}
@@ -389,7 +401,7 @@ func getSubStruct(step int, k string, v *schema.Schema) []string {
389401
subStructs = append(subStructs, strings.Join(subStruct, "\n"))
390402

391403
for kk, vv := range v.Elem.(*schema.Resource).Schema {
392-
subStructs = append(subStructs, getSubStruct(step+1, kk, vv)...)
404+
subStructs = append(subStructs, getSubStruct(step+1, k, kk, vv)...)
393405
}
394406
}
395407
}

tencentcloud/resource_tc_kubernetes_node_pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func composedKubernetesAsScalingConfigPara() map[string]*schema.Schema {
193193
Elem: &schema.Schema{Type: schema.TypeString},
194194
ConflictsWith: []string{"auto_scaling_config.0.orderly_security_group_ids"},
195195
Deprecated: "The order of elements in this field cannot be guaranteed. Use `orderly_security_group_ids` instead.",
196-
Description: "(**Deprecated**) The order of elements in this field cannot be guaranteed. Use `orderly_security_group_ids` instead. Security groups to which a CVM instance belongs.",
196+
Description: "Security groups to which a CVM instance belongs.",
197197
},
198198
"orderly_security_group_ids": {
199199
Type: schema.TypeList,

website/docs/d/mps_media_meta_data.html.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The following arguments are supported:
4040
* `input_info` - (Required, List) Input information of file for metadata getting.
4141
* `result_output_file` - (Optional, String) Used to save results.
4242

43-
The `cos_input_info` object supports the following:
43+
The `cos_input_info` object of `input_info` supports the following:
4444

4545
* `bucket` - (Required, String) The COS bucket of the object to process, such as `TopRankVideo-125xxx88`.
4646
* `object` - (Required, String) The path of the object to process, such as `/movie/201907/WildAnimal.mov`.
@@ -53,15 +53,15 @@ The `input_info` object supports the following:
5353
* `s3_input_info` - (Optional, List) The information of the AWS S3 object processed. This parameter is required if `Type` is `AWS-S3`.Note: This field may return null, indicating that no valid value can be obtained.
5454
* `url_input_info` - (Optional, List) The URL of the object to process. This parameter is valid and required when `Type` is `URL`.Note: This field may return null, indicating that no valid value can be obtained.
5555

56-
The `s3_input_info` object supports the following:
56+
The `s3_input_info` object of `input_info` supports the following:
5757

5858
* `s3_bucket` - (Required, String) The AWS S3 bucket.
5959
* `s3_object` - (Required, String) The path of the AWS S3 object.
6060
* `s3_region` - (Required, String) The region of the AWS S3 bucket.
6161
* `s3_secret_id` - (Optional, String) The key ID required to access the AWS S3 object.
6262
* `s3_secret_key` - (Optional, String) The key required to access the AWS S3 object.
6363

64-
The `url_input_info` object supports the following:
64+
The `url_input_info` object of `input_info` supports the following:
6565

6666
* `url` - (Required, String) URL of a video.
6767

website/docs/r/antiddos_ddos_speed_limit_config.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ The `ddos_speed_limit_config` object supports the following:
4747
* `dst_port_scopes` - (Optional, List) This field has been deprecated. Please fill in the new field DstPortList.
4848
* `protocol_list` - (Optional, String) IP protocol numbers, values [ALL (all protocols) TCP (tcp protocol) UDP (udp protocol) SMP (smp protocol) 1; 2-100 (custom protocol number range, up to 8)] Note: When customizing the protocol number range, only the protocol number can be filled in, multiple ranges; Separation; When filling in ALL, no other agreements or agreements can be filled inNumber.
4949

50-
The `dst_port_scopes` object supports the following:
50+
The `dst_port_scopes` object of `ddos_speed_limit_config` supports the following:
5151

5252
* `begin_port` - (Required, Int) Starting port, ranging from 1 to 65535.
5353
* `end_port` - (Required, Int) end port, ranging from 1 to 65535.
5454

55-
The `speed_values` object supports the following:
55+
The `speed_values` object of `ddos_speed_limit_config` supports the following:
5656

5757
* `type` - (Required, Int) Speed limit value type, value [1 (packet rate pps) 2 (bandwidth bps)].
5858
* `value` - (Required, Int) value.

website/docs/r/api_gateway_upstream.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ The following arguments are supported:
151151
* `upstream_name` - (Optional, String) Backend channel name.
152152
* `upstream_type` - (Optional, String) Backend access type, value range: IP_PORT, K8S.
153153

154-
The `extra_labels` object supports the following:
154+
The `extra_labels` object of `k8s_service` supports the following:
155155

156156
* `key` - (Required, String) Key of Label.
157157
* `value` - (Required, String) Value of Label.

website/docs/r/as_scaling_group.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ The `forward_balancer_ids` object supports the following:
146146
* `target_attribute` - (Required, List) Attribute list of target rules.
147147
* `rule_id` - (Optional, String) ID of forwarding rules.
148148

149-
The `target_attribute` object supports the following:
149+
The `target_attribute` object of `forward_balancer_ids` supports the following:
150150

151151
* `port` - (Required, Int) Port number.
152152
* `weight` - (Required, Int) Weight.

website/docs/r/cdn_domain.html.markdown

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -220,22 +220,22 @@ The `cache_key` object supports the following:
220220
* `key_rules` - (Optional, List) Path-specific cache key configuration.
221221
* `query_string` - (Optional, List) Request parameter contained in CacheKey.
222222

223-
The `cache_rules` object supports the following:
223+
The `cache_rules` object of `status_code_cache` supports the following:
224224

225225
* `cache_time` - (Required, Int) Status code cache expiration time (in seconds).
226226
* `status_code` - (Required, String) Code of status cache. available values: `403`, `404`.
227227

228-
The `capping_rules` object supports the following:
228+
The `capping_rules` object of `downstream_capping` supports the following:
229229

230230
* `kbps_threshold` - (Required, Int) Capping rule kbps threshold.
231231
* `rule_paths` - (Required, List) List of capping rule path.
232232
* `rule_type` - (Required, String) Capping rule type.
233233

234-
The `client_certificate_config` object supports the following:
234+
The `client_certificate_config` object of `https_config` supports the following:
235235

236236
* `certificate_content` - (Required, String) Client Certificate PEM format, requires Base64 encoding.
237237

238-
The `compression_rules` object supports the following:
238+
The `compression_rules` object of `compression` supports the following:
239239

240240
* `algorithms` - (Required, List) List of algorithms, available: `gzip` and `brotli`.
241241
* `compress` - (Required, Bool) Must be set as true, enables compression.
@@ -260,29 +260,29 @@ The `error_page` object supports the following:
260260
* `switch` - (Required, String) Configuration switch, available values: `on`, `off` (default).
261261
* `page_rules` - (Optional, List) List of error page rule.
262262

263-
The `filter_rules` object supports the following:
263+
The `filter_rules` object of `ip_filter` supports the following:
264264

265265
* `filter_type` - (Required, String) Ip filter `blacklist`/`whitelist` type of filter rules.
266266
* `filters` - (Required, List) Ip filter rule list, supports IPs in X.X.X.X format, or /8, /16, /24 format IP ranges. Up to 50 allowlists or blocklists can be entered.
267267
* `rule_paths` - (Required, List) Content list for each `rule_type`: `*` for `all`, file ext like `jpg` for `file`, `/dir/like/` for `directory` and `/path/index.html` for `path`.
268268
* `rule_type` - (Required, String) Ip filter rule type of filter rules, available: `all`, `file`, `directory`, `path`.
269269

270-
The `force_redirect` object supports the following:
270+
The `force_redirect` object of `https_config` supports the following:
271271

272272
* `carry_headers` - (Optional, String) Whether to return the newly added header during force redirection. Values: `on`, `off`.
273273
* `redirect_status_code` - (Optional, Int) Forced redirect status code. Valid values are `301` and `302`. When `switch` setting `off`, this property does not need to be set or set to `302`. Default value is `302`.
274274
* `redirect_type` - (Optional, String) Forced redirect type. Valid values are `http` and `https`. `http` means a forced redirect from HTTPS to HTTP, `https` means a forced redirect from HTTP to HTTPS. When `switch` setting `off`, this property does not need to be set or set to `http`. Default value is `http`.
275275
* `switch` - (Optional, String) Forced redirect configuration switch. Valid values are `on` and `off`. Default value is `off`.
276276

277-
The `header_rules` object supports the following:
277+
The `header_rules` object of `request_header` supports the following:
278278

279279
* `header_mode` - (Required, String) Http header setting method. The following types are supported: `add`: add a head, if a head already exists, there will be a duplicate head, `del`: delete the head.
280280
* `header_name` - (Required, String) Http header name.
281281
* `header_value` - (Required, String) Http header value, optional when Mode is `del`, Required when Mode is `add`/`set`.
282282
* `rule_paths` - (Required, List) Matching content under the corresponding type of CacheType: `all`: fill *, `file`: fill in the suffix name, such as jpg, txt, `directory`: fill in the path, such as /xxx/test, `path`: fill in the absolute path, such as /xxx/test.html.
283283
* `rule_type` - (Required, String) Rule type. The following types are supported: `all`: all documents take effect, `file`: the specified file suffix takes effect, `directory`: the specified path takes effect, `path`: specify the absolute path to take effect.
284284

285-
The `header_rules` object supports the following:
285+
The `header_rules` object of `response_header` supports the following:
286286

287287
* `header_mode` - (Required, String) Response header mode.
288288
* `header_name` - (Required, String) response header name of rule.
@@ -322,7 +322,7 @@ The `ip_freq_limit` object supports the following:
322322
* `switch` - (Required, String) Configuration switch, available values: `on`, `off` (default).
323323
* `qps` - (Optional, Int) Sets the limited number of requests per second, 514 will be returned for requests that exceed the limit.
324324

325-
The `key_rules` object supports the following:
325+
The `key_rules` object of `cache_key` supports the following:
326326

327327
* `query_string` - (Required, List) Request parameter contained in CacheKey.
328328
* `rule_paths` - (Required, List) List of rule paths for each `key_rules`: `/` for `index`, file ext like `jpg` for `file`, `/dir/like/` for `directory` and `/path/index.html` for `path`.
@@ -331,7 +331,7 @@ The `key_rules` object supports the following:
331331
* `ignore_case` - (Optional, String) Whether caches are case insensitive.
332332
* `rule_tag` - (Optional, String) Specify rule tag, default value is `user`.
333333

334-
The `max_age_rules` object supports the following:
334+
The `max_age_rules` object of `max_age` supports the following:
335335

336336
* `max_age_contents` - (Required, List) List of rule paths for each `max_age_type`: `*` for `all`, file ext like `jpg` for `file`, `/dir/like/` for `directory` and `/path/index.html` for `path`.
337337
* `max_age_time` - (Required, Int) Max Age time in seconds, this can set to `0` that stands for no cache.
@@ -372,7 +372,7 @@ The `oss_private_access` object supports the following:
372372
* `region` - (Optional, String) Region.
373373
* `secret_key` - (Optional, String) Key.
374374

375-
The `page_rules` object supports the following:
375+
The `page_rules` object of `error_page` supports the following:
376376

377377
* `redirect_code` - (Required, Int) Redirect code of error page rules.
378378
* `redirect_url` - (Required, String) Redirect url of error page rules.
@@ -389,20 +389,20 @@ The `qn_private_access` object supports the following:
389389
* `access_key` - (Optional, String) Access ID.
390390
* `secret_key` - (Optional, String) Key.
391391

392-
The `query_string` object supports the following:
392+
The `query_string` object of `cache_key` supports the following:
393393

394394
* `action` - (Optional, String) Include/exclude query parameters. Values: `includeAll` (Default), `excludeAll`, `includeCustom`, `excludeCustom`.
395395
* `reorder` - (Optional, String) Whether to sort again, values `on`, `off` (Default).
396396
* `switch` - (Optional, String) Whether to use QueryString as part of CacheKey, values `on`, `off` (Default).
397397
* `value` - (Optional, String) Array of included/excluded query strings (separated by `;`).
398398

399-
The `query_string` object supports the following:
399+
The `query_string` object of `key_rules` supports the following:
400400

401401
* `action` - (Optional, String) Specify key rule QS action, values: `includeCustom`, `excludeCustom`.
402402
* `switch` - (Optional, String) Whether to use QueryString as part of CacheKey, values `on`, `off` (Default).
403403
* `value` - (Optional, String) Array of included/excluded query strings (separated by `;`).
404404

405-
The `referer_rules` object supports the following:
405+
The `referer_rules` object of `referer` supports the following:
406406

407407
* `allow_empty` - (Required, Bool) Whether to allow emptpy.
408408
* `referer_type` - (Required, String) Referer type.
@@ -440,14 +440,14 @@ The `rule_cache` object supports the following:
440440
* `rule_type` - (Optional, String) Rule type. The following types are supported: `all`: all documents take effect, `file`: the specified file suffix takes effect, `directory`: the specified path takes effect, `path`: specify the absolute path to take effect, `index`: home page.
441441
* `switch` - (Optional, String) Cache configuration switch. Valid values are `on` and `off`.
442442

443-
The `server_certificate_config` object supports the following:
443+
The `server_certificate_config` object of `https_config` supports the following:
444444

445445
* `certificate_content` - (Optional, String) Server certificate information. This is required when uploading an external certificate, which should contain the complete certificate chain.
446446
* `certificate_id` - (Optional, String) Server certificate ID.
447447
* `message` - (Optional, String) Certificate remarks.
448448
* `private_key` - (Optional, String) Server key information. This is required when uploading an external certificate.
449449

450-
The `statistic_item` object supports the following:
450+
The `statistic_item` object of `band_width_alert` supports the following:
451451

452452
* `switch` - (Required, String) Configuration switch, available values: `on`, `off` (default).
453453
* `alert_percentage` - (Optional, Int) Alert percentage.
@@ -464,7 +464,7 @@ The `status_code_cache` object supports the following:
464464
* `switch` - (Required, String) Configuration switch, available values: `on`, `off` (default).
465465
* `cache_rules` - (Optional, List) List of cache rule.
466466

467-
The `type_a` object supports the following:
467+
The `type_a` object of `authentication` supports the following:
468468

469469
* `expire_time` - (Required, Int) Signature expiration time in second. The maximum value is 630720000.
470470
* `file_extensions` - (Required, List) File extension list settings determining if authentication should be performed. NOTE: If it contains an asterisk (*), this indicates all files.
@@ -473,15 +473,15 @@ The `type_a` object supports the following:
473473
* `sign_param` - (Required, String) Signature parameter name. Only upper and lower-case letters, digits, and underscores (_) are allowed. It cannot start with a digit. Length limit: 1-100 characters.
474474
* `backup_secret_key` - (Optional, String) Used for calculate a signature. 6-32 characters. Only digits and letters are allowed.
475475

476-
The `type_b` object supports the following:
476+
The `type_b` object of `authentication` supports the following:
477477

478478
* `expire_time` - (Required, Int) Signature expiration time in second. The maximum value is 630720000.
479479
* `file_extensions` - (Required, List) File extension list settings determining if authentication should be performed. NOTE: If it contains an asterisk (*), this indicates all files.
480480
* `filter_type` - (Required, String) Available values: `whitelist` - all types apart from `file_extensions` are authenticated, `blacklist`: - only the types in the `file_extensions` are authenticated.
481481
* `secret_key` - (Required, String) The key for signature calculation. Only digits, upper and lower-case letters are allowed. Length limit: 6-32 characters.
482482
* `backup_secret_key` - (Optional, String) Used for calculate a signature. 6-32 characters. Only digits and letters are allowed.
483483

484-
The `type_c` object supports the following:
484+
The `type_c` object of `authentication` supports the following:
485485

486486
* `expire_time` - (Required, Int) Signature expiration time in second. The maximum value is 630720000.
487487
* `file_extensions` - (Required, List) File extension list settings determining if authentication should be performed. NOTE: If it contains an asterisk (*), this indicates all files.
@@ -490,7 +490,7 @@ The `type_c` object supports the following:
490490
* `backup_secret_key` - (Optional, String) Used for calculate a signature. 6-32 characters. Only digits and letters are allowed.
491491
* `time_format` - (Optional, String) Timestamp formation, available values: `dec`, `hex`.
492492

493-
The `type_d` object supports the following:
493+
The `type_d` object of `authentication` supports the following:
494494

495495
* `expire_time` - (Required, Int) Signature expiration time in second. The maximum value is 630720000.
496496
* `file_extensions` - (Required, List) File extension list settings determining if authentication should be performed. NOTE: If it contains an asterisk (*), this indicates all files.

website/docs/r/cdwpg_instance.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The `charge_properties` object supports the following:
7575
* `time_unit` - (Required, String) Time Unit,Generally h and mNote: This field may return null, indicating that a valid value cannot be obtained.
7676
* `charge_type` - (Optional, String) Charge type, vaild values: PREPAID, POSTPAID_BY_HOUR.
7777

78-
The `disk_spec` object supports the following:
78+
The `disk_spec` object of `resources` supports the following:
7979

8080
* `disk_count` - (Required, Int) disk count.
8181
* `disk_size` - (Required, Int) disk size.

website/docs/r/cfw_vpc_instance.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The following arguments are supported:
7878
* `ccn_id` - (Optional, String) Cloud networking id, suitable for cloud networking mode.
7979
* `fw_vpc_cidr` - (Optional, String) auto Automatically select the firewall network segment; 10.10.10.0/24 The firewall network segment entered by the user.
8080

81-
The `fw_deploy` object supports the following:
81+
The `fw_deploy` object of `vpc_fw_instances` supports the following:
8282

8383
* `deploy_region` - (Required, String) Firewall Deployment Region.
8484
* `width` - (Required, Int) Bandwidth, unit: Mbps.

0 commit comments

Comments
 (0)