Skip to content

Commit f37f089

Browse files
committed
[review fix]
1. review fix 2. changelog
1 parent 2b17803 commit f37f089

27 files changed

+406
-439
lines changed

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
## 1.44.1 (Unreleased)
1+
## 1.45.0 (Unreleased)
2+
3+
FEATURES:
4+
5+
* **New Resource**: `tencentcloud_vod_adaptive_dynamic_streaming_template`
6+
* **New Resource**: `tencentcloud_vod_procedure_template`.
7+
* **New Resource**: `tencentcloud_vod_snapshot_by_time_offset_template`.
8+
* **New Resource**: `tencentcloud_vod_image_sprite_template`.
9+
* **New Resource**: `tencentcloud_vod_super_player_config`.
10+
* **New Data Source**: `tencentcloud_vod_adaptive_dynamic_streaming_templates`
11+
* **New Data Source**: `tencentcloud_vod_image_sprite_templates`.
12+
* **New Data Source**: `tencentcloud_vod_procedure_templates`.
13+
* **New Data Source**: `tencentcloud_vod_snapshot_by_time_offset_templates`.
14+
* **New Data Source**: `tencentcloud_vod_super_player_configs`.
15+
216
## 1.44.0 (September 25, 2020)
317

418
FEATURES:

examples/tencentcloud-vod/main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ resource "tencentcloud_vod_adaptive_dynamic_streaming_template" "foo" {
66
format = "HLS"
77
name = "tf-adaptive"
88
drm_type = "SimpleAES"
9-
disable_higher_video_bitrate = 0
10-
disable_higher_video_resolution = 0
9+
disable_higher_video_bitrate = false
10+
disable_higher_video_resolution = false
1111
comment = "test"
1212

1313
stream_info {
1414
video {
1515
codec = "libx265"
1616
fps = 4
1717
bitrate = 129
18-
resolution_adaptive = "close"
18+
resolution_adaptive = false
1919
width = 128
2020
height = 128
2121
fill_type = "stretch"
@@ -26,7 +26,7 @@ resource "tencentcloud_vod_adaptive_dynamic_streaming_template" "foo" {
2626
sample_rate = 44100
2727
audio_channel = "dual"
2828
}
29-
remove_audio = 0
29+
remove_audio = false
3030
}
3131
stream_info {
3232
video {
@@ -53,22 +53,22 @@ resource "tencentcloud_vod_image_sprite_template" "foo" {
5353
fill_type = "stretch"
5454
width = 128
5555
height = 128
56-
resolution_adaptive = "close"
56+
resolution_adaptive = false
5757
}
5858

5959
resource "tencentcloud_vod_snapshot_by_time_offset_template" "foo" {
6060
name = "tf-snapshot"
6161
width = 130
6262
height = 128
63-
resolution_adaptive = "close"
63+
resolution_adaptive = false
6464
format = "png"
6565
comment = "test"
6666
fill_type = "white"
6767
}
6868

6969
resource "tencentcloud_vod_super_player_config" "foo" {
7070
name = "tf-super-player"
71-
drm_switch = "ON"
71+
drm_switch = true
7272
drm_streaming_info {
7373
simple_aes_definition = tencentcloud_vod_adaptive_dynamic_streaming_template.foo.id
7474
}

tencentcloud/data_source_tc_vod_adaptive_dynamic_streaming_templates.go

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Use this data source to query detailed information of Vod adaptive dynamic streaming templates.
2+
Use this data source to query detailed information of VOD adaptive dynamic streaming templates.
33
44
Example Usage
55
@@ -8,8 +8,8 @@ resource "tencentcloud_vod_adaptive_dynamic_streaming_template" "foo" {
88
format = "HLS"
99
name = "tf-adaptive"
1010
drm_type = "SimpleAES"
11-
disable_higher_video_bitrate = 0
12-
disable_higher_video_resolution = 0
11+
disable_higher_video_bitrate = false
12+
disable_higher_video_resolution = false
1313
comment = "test"
1414
1515
stream_info {
@@ -23,7 +23,7 @@ resource "tencentcloud_vod_adaptive_dynamic_streaming_template" "foo" {
2323
bitrate = 128
2424
sample_rate = 32000
2525
}
26-
remove_audio = 1
26+
remove_audio = true
2727
}
2828
stream_info {
2929
video {
@@ -36,7 +36,7 @@ resource "tencentcloud_vod_adaptive_dynamic_streaming_template" "foo" {
3636
bitrate = 256
3737
sample_rate = 44100
3838
}
39-
remove_audio = 1
39+
remove_audio = true
4040
}
4141
}
4242
@@ -115,14 +115,14 @@ func dataSourceTencentCloudVodAdaptiveDynamicStreamingTemplates() *schema.Resour
115115
Description: "DRM scheme type.",
116116
},
117117
"disable_higher_video_bitrate": {
118-
Type: schema.TypeInt,
118+
Type: schema.TypeBool,
119119
Computed: true,
120-
Description: "Whether to prohibit transcoding video from low bitrate to high bitrate. `0`: no, `1`: yes.",
120+
Description: "Whether to prohibit transcoding video from low bitrate to high bitrate. `false`: no, `true`: yes.",
121121
},
122122
"disable_higher_video_resolution": {
123-
Type: schema.TypeInt,
123+
Type: schema.TypeBool,
124124
Computed: true,
125-
Description: "Whether to prohibit transcoding from low resolution to high resolution. `0`: no, `1`: yes.",
125+
Description: "Whether to prohibit transcoding from low resolution to high resolution. `false`: no, `true`: yes.",
126126
},
127127
"comment": {
128128
Type: schema.TypeString,
@@ -157,9 +157,9 @@ func dataSourceTencentCloudVodAdaptiveDynamicStreamingTemplates() *schema.Resour
157157
Description: "Bitrate of video stream in Kbps. Value range: `0` and `[128, 35000]`. If the value is `0`, the bitrate of the video will be the same as that of the source video.",
158158
},
159159
"resolution_adaptive": {
160-
Type: schema.TypeString,
160+
Type: schema.TypeBool,
161161
Computed: true,
162-
Description: "Resolution adaption. Valid values: `open`: enabled. In this case, `width` represents the long side of a video, while `height` the short side; `close`: disabled. In this case, `width` represents the width of a video, while `height` the height. Note: this field may return null, indicating that no valid values can be obtained.",
162+
Description: "Resolution adaption. Valid values: `true`: enabled. In this case, `width` represents the long side of a video, while `height` the short side; `false`: disabled. In this case, `width` represents the width of a video, while `height` the height. Note: this field may return null, indicating that no valid values can be obtained.",
163163
},
164164
"width": {
165165
Type: schema.TypeInt,
@@ -209,9 +209,9 @@ func dataSourceTencentCloudVodAdaptiveDynamicStreamingTemplates() *schema.Resour
209209
},
210210
},
211211
"remove_audio": {
212-
Type: schema.TypeInt,
212+
Type: schema.TypeBool,
213213
Computed: true,
214-
Description: "Whether to remove audio stream. `0`: no, `1`: yes.",
214+
Description: "Whether to remove audio stream. `false`: no, `true`: yes.",
215215
},
216216
},
217217
},
@@ -262,14 +262,15 @@ func dataSourceTencentCloudVodAdaptiveDynamicStreamingTemplatesRead(d *schema.Re
262262
ids := make([]string, 0, len(templates))
263263
for _, item := range templates {
264264
templatesList = append(templatesList, func() map[string]interface{} {
265+
definitionStr := strconv.FormatUint(*item.Definition, 10)
265266
mapping := map[string]interface{}{
266-
"definition": strconv.FormatUint(*item.Definition, 10),
267+
"definition": definitionStr,
267268
"type": item.Type,
268269
"format": item.Format,
269270
"name": item.Name,
270271
"drm_type": item.DrmType,
271-
"disable_higher_video_bitrate": item.DisableHigherVideoBitrate,
272-
"disable_higher_video_resolution": item.DisableHigherVideoResolution,
272+
"disable_higher_video_bitrate": *item.DisableHigherVideoBitrate == 1,
273+
"disable_higher_video_resolution": *item.DisableHigherVideoResolution == 1,
273274
"comment": item.Comment,
274275
"create_time": item.CreateTime,
275276
"update_time": item.UpdateTime,
@@ -282,7 +283,7 @@ func dataSourceTencentCloudVodAdaptiveDynamicStreamingTemplatesRead(d *schema.Re
282283
"codec": v.Video.Codec,
283284
"fps": v.Video.Fps,
284285
"bitrate": v.Video.Bitrate,
285-
"resolution_adaptive": v.Video.ResolutionAdaptive,
286+
"resolution_adaptive": *v.Video.ResolutionAdaptive == "open",
286287
"width": v.Video.Width,
287288
"height": v.Video.Height,
288289
"fill_type": v.Video.FillType,
@@ -296,11 +297,11 @@ func dataSourceTencentCloudVodAdaptiveDynamicStreamingTemplatesRead(d *schema.Re
296297
"audio_channel": VOD_AUDIO_CHANNEL_TYPE_TO_STRING[*v.Audio.AudioChannel],
297298
},
298299
},
299-
"remove_audio": v.RemoveAudio,
300+
"remove_audio": *v.RemoveAudio == 1,
300301
})
301302
}
302303
mapping["stream_info"] = streamInfos
303-
ids = append(ids, strconv.FormatUint(*item.Definition, 10))
304+
ids = append(ids, definitionStr)
304305
return mapping
305306
}())
306307
}

tencentcloud/data_source_tc_vod_adaptive_dynamic_streaming_templates_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ func TestAccDataSourceTencentCloudVodAdaptiveDynamicStreamingTemplates(t *testin
2020
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.format", "HLS"),
2121
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.name", "tf-adaptive"),
2222
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.drm_type", "SimpleAES"),
23-
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.disable_higher_video_bitrate", "0"),
24-
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.disable_higher_video_resolution", "0"),
23+
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.disable_higher_video_bitrate", "false"),
24+
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.disable_higher_video_resolution", "false"),
2525
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.comment", "test"),
2626
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.#", "2"),
2727
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.0.video.#", "1"),
@@ -32,7 +32,7 @@ func TestAccDataSourceTencentCloudVodAdaptiveDynamicStreamingTemplates(t *testin
3232
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.0.audio.0.codec", "libfdk_aac"),
3333
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.0.audio.0.bitrate", "128"),
3434
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.0.audio.0.sample_rate", "32000"),
35-
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.0.remove_audio", "1"),
35+
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.0.remove_audio", "true"),
3636
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.1.video.#", "1"),
3737
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.1.video.0.codec", "libx264"),
3838
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.1.video.0.fps", "4"),
@@ -41,7 +41,7 @@ func TestAccDataSourceTencentCloudVodAdaptiveDynamicStreamingTemplates(t *testin
4141
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.1.audio.0.codec", "libfdk_aac"),
4242
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.1.audio.0.bitrate", "256"),
4343
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.1.audio.0.sample_rate", "44100"),
44-
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.1.remove_audio", "1"),
44+
resource.TestCheckResourceAttr("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.stream_info.1.remove_audio", "true"),
4545
resource.TestCheckResourceAttrSet("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.create_time"),
4646
resource.TestCheckResourceAttrSet("data.tencentcloud_vod_adaptive_dynamic_streaming_templates.foo", "template_list.0.update_time"),
4747
),

tencentcloud/data_source_tc_vod_image_sprite_templates.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Use this data source to query detailed information of Vod image sprite templates.
2+
Use this data source to query detailed information of VOD image sprite templates.
33
44
Example Usage
55
@@ -14,7 +14,7 @@ resource "tencentcloud_vod_image_sprite_template" "foo" {
1414
fill_type = "stretch"
1515
width = 128
1616
height = 128
17-
resolution_adaptive = "close"
17+
resolution_adaptive = false
1818
}
1919
2020
data "tencentcloud_vod_image_sprite_templates" "foo" {
@@ -121,9 +121,9 @@ func dataSourceTencentCloudVodImageSpriteTemplates() *schema.Resource {
121121
Description: "Maximum value of the `height` (or short side) of a screenshot in px. Value range: 0 and [128, 4,096]. If both `width` and `height` are `0`, the resolution will be the same as that of the source video; If `width` is `0`, but `height` is not `0`, `width` will be proportionally scaled; If `width` is not `0`, but `height` is `0`, `height` will be proportionally scaled; If both `width` and `height` are not `0`, the custom resolution will be used.",
122122
},
123123
"resolution_adaptive": {
124-
Type: schema.TypeString,
124+
Type: schema.TypeBool,
125125
Computed: true,
126-
Description: "Resolution adaption. Valid values: `open`: enabled. In this case, `width` represents the long side of a video, while `height` the short side; `close`: disabled. In this case, `width` represents the width of a video, while `height` the height.",
126+
Description: "Resolution adaption. Valid values: `true`: enabled. In this case, `width` represents the long side of a video, while `height` the short side; `false`: disabled. In this case, `width` represents the width of a video, while `height` the height.",
127127
},
128128
"create_time": {
129129
Type: schema.TypeString,
@@ -170,8 +170,9 @@ func dataSourceTencentCloudVodImageSpriteTemplatesRead(d *schema.ResourceData, m
170170
templatesList := make([]map[string]interface{}, 0, len(templates))
171171
ids := make([]string, 0, len(templates))
172172
for _, item := range templates {
173+
definitionStr := strconv.FormatUint(*item.Definition, 10)
173174
templatesList = append(templatesList, map[string]interface{}{
174-
"definition": strconv.FormatUint(*item.Definition, 10),
175+
"definition": definitionStr,
175176
"type": item.Type,
176177
"sample_type": item.SampleType,
177178
"sample_interval": item.SampleInterval,
@@ -182,11 +183,11 @@ func dataSourceTencentCloudVodImageSpriteTemplatesRead(d *schema.ResourceData, m
182183
"fill_type": item.FillType,
183184
"width": item.Width,
184185
"height": item.Height,
185-
"resolution_adaptive": item.ResolutionAdaptive,
186+
"resolution_adaptive": *item.ResolutionAdaptive == "open",
186187
"create_time": item.CreateTime,
187188
"update_time": item.UpdateTime,
188189
})
189-
ids = append(ids, strconv.FormatUint(*item.Definition, 10))
190+
ids = append(ids, definitionStr)
190191
}
191192

192193
d.SetId(helper.DataResourceIdsHash(ids))

tencentcloud/data_source_tc_vod_image_sprite_templates_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestAccDataSourceTencentCloudVodImageSpriteTemplates(t *testing.T) {
2626
resource.TestCheckResourceAttr("data.tencentcloud_vod_image_sprite_templates.foo", "template_list.0.fill_type", "stretch"),
2727
resource.TestCheckResourceAttr("data.tencentcloud_vod_image_sprite_templates.foo", "template_list.0.width", "128"),
2828
resource.TestCheckResourceAttr("data.tencentcloud_vod_image_sprite_templates.foo", "template_list.0.height", "128"),
29-
resource.TestCheckResourceAttr("data.tencentcloud_vod_image_sprite_templates.foo", "template_list.0.resolution_adaptive", "close"),
29+
resource.TestCheckResourceAttr("data.tencentcloud_vod_image_sprite_templates.foo", "template_list.0.resolution_adaptive", "false"),
3030
resource.TestCheckResourceAttrSet("data.tencentcloud_vod_image_sprite_templates.foo", "template_list.0.create_time"),
3131
resource.TestCheckResourceAttrSet("data.tencentcloud_vod_image_sprite_templates.foo", "template_list.0.update_time"),
3232
),

tencentcloud/data_source_tc_vod_procedure_templates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Use this data source to query detailed information of Vod procedure templates.
2+
Use this data source to query detailed information of VOD procedure templates.
33
44
Example Usage
55

tencentcloud/data_source_tc_vod_snapshot_by_time_offset_templates.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Use this data source to query detailed information of Vod snapshot by time offset templates.
2+
Use this data source to query detailed information of VOD snapshot by time offset templates.
33
44
Example Usage
55
@@ -8,7 +8,7 @@ resource "tencentcloud_vod_snapshot_by_time_offset_template" "foo" {
88
name = "tf-snapshot"
99
width = 128
1010
height = 128
11-
resolution_adaptive = "close"
11+
resolution_adaptive = false
1212
format = "png"
1313
comment = "test"
1414
fill_type = "white"
@@ -88,9 +88,9 @@ func dataSourceTencentCloudVodSnapshotByTimeOffsetTemplates() *schema.Resource {
8888
Description: "Maximum value of the `height` (or short side) of a screenshot in px. Value range: 0 and [128, 4,096]. If both `width` and `height` are `0`, the resolution will be the same as that of the source video; If `width` is `0`, but `height` is not `0`, `width` will be proportionally scaled; If `width` is not `0`, but `height` is `0`, `height` will be proportionally scaled; If both `width` and `height` are not `0`, the custom resolution will be used.",
8989
},
9090
"resolution_adaptive": {
91-
Type: schema.TypeString,
91+
Type: schema.TypeBool,
9292
Computed: true,
93-
Description: "Resolution adaption. Valid values: `open`: enabled. In this case, `width` represents the long side of a video, while `height` the short side; `close`: disabled. In this case, `width` represents the width of a video, while `height` the height.",
93+
Description: "Resolution adaption. Valid values: `true`: enabled. In this case, `width` represents the long side of a video, while `height` the short side; `false`: disabled. In this case, `width` represents the width of a video, while `height` the height.",
9494
},
9595
"format": {
9696
Type: schema.TypeString,
@@ -152,20 +152,21 @@ func dataSourceTencentCloudVodSnapshotByTimeOffsetTemplatesRead(d *schema.Resour
152152
templatesList := make([]map[string]interface{}, 0, len(templates))
153153
ids := make([]string, 0, len(templates))
154154
for _, item := range templates {
155+
definitionStr := strconv.FormatUint(*item.Definition, 10)
155156
templatesList = append(templatesList, map[string]interface{}{
156-
"definition": strconv.FormatUint(*item.Definition, 10),
157+
"definition": definitionStr,
157158
"type": item.Type,
158159
"name": item.Name,
159160
"width": item.Width,
160161
"height": item.Height,
161-
"resolution_adaptive": item.ResolutionAdaptive,
162+
"resolution_adaptive": *item.ResolutionAdaptive == "open",
162163
"format": item.Format,
163164
"comment": item.Comment,
164165
"fill_type": item.FillType,
165166
"create_time": item.CreateTime,
166167
"update_time": item.UpdateTime,
167168
})
168-
ids = append(ids, strconv.FormatUint(*item.Definition, 10))
169+
ids = append(ids, definitionStr)
169170
}
170171

171172
d.SetId(helper.DataResourceIdsHash(ids))

0 commit comments

Comments
 (0)