Skip to content

Commit 2b17803

Browse files
committed
[new datasources and resources for vod]
1. data_source_tc_vod_adaptive_dynamic_streaming_templates 2. data_source_tc_vod_image_sprite_templates 3. data_source_tc_vod_procedure_templates 4. data_source_tc_vod_snapshot_by_time_offset_templates 5. data_source_tc_vod_super_player_configs 6. resource_tc_vod_adaptive_dynamic_streaming_template 7. resource_tc_vod_image_sprite_template 8. resource_tc_vod_procedure_template 9. resource_tc_vod_snapshot_by_time_offset_template 10. resource_tc_vod_super_player_config
1 parent dbbcad0 commit 2b17803

File tree

37 files changed

+19744
-248
lines changed

37 files changed

+19744
-248
lines changed

examples/tencentcloud-vod/main.tf

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
provider "tencentcloud" {
2+
region = "ap-guangzhou"
3+
}
4+
5+
resource "tencentcloud_vod_adaptive_dynamic_streaming_template" "foo" {
6+
format = "HLS"
7+
name = "tf-adaptive"
8+
drm_type = "SimpleAES"
9+
disable_higher_video_bitrate = 0
10+
disable_higher_video_resolution = 0
11+
comment = "test"
12+
13+
stream_info {
14+
video {
15+
codec = "libx265"
16+
fps = 4
17+
bitrate = 129
18+
resolution_adaptive = "close"
19+
width = 128
20+
height = 128
21+
fill_type = "stretch"
22+
}
23+
audio {
24+
codec = "libmp3lame"
25+
bitrate = 129
26+
sample_rate = 44100
27+
audio_channel = "dual"
28+
}
29+
remove_audio = 0
30+
}
31+
stream_info {
32+
video {
33+
codec = "libx264"
34+
fps = 4
35+
bitrate = 256
36+
}
37+
audio {
38+
codec = "libfdk_aac"
39+
bitrate = 256
40+
sample_rate = 44100
41+
}
42+
remove_audio = 1
43+
}
44+
}
45+
46+
resource "tencentcloud_vod_image_sprite_template" "foo" {
47+
sample_type = "Percent"
48+
sample_interval = 10
49+
row_count = 3
50+
column_count = 3
51+
name = "tf-sprite"
52+
comment = "test"
53+
fill_type = "stretch"
54+
width = 128
55+
height = 128
56+
resolution_adaptive = "close"
57+
}
58+
59+
resource "tencentcloud_vod_snapshot_by_time_offset_template" "foo" {
60+
name = "tf-snapshot"
61+
width = 130
62+
height = 128
63+
resolution_adaptive = "close"
64+
format = "png"
65+
comment = "test"
66+
fill_type = "white"
67+
}
68+
69+
resource "tencentcloud_vod_super_player_config" "foo" {
70+
name = "tf-super-player"
71+
drm_switch = "ON"
72+
drm_streaming_info {
73+
simple_aes_definition = tencentcloud_vod_adaptive_dynamic_streaming_template.foo.id
74+
}
75+
image_sprite_definition = tencentcloud_vod_image_sprite_template.foo.id
76+
resolution_names {
77+
min_edge_length = 889
78+
name = "test1"
79+
}
80+
resolution_names {
81+
min_edge_length = 890
82+
name = "test2"
83+
}
84+
domain = "Default"
85+
scheme = "Default"
86+
comment = "test"
87+
}
88+
89+
resource "tencentcloud_vod_procedure_template" "foo" {
90+
name = "tf-procedure"
91+
comment = "test"
92+
media_process_task {
93+
adaptive_dynamic_streaming_task_list {
94+
definition = tencentcloud_vod_adaptive_dynamic_streaming_template.foo.id
95+
}
96+
snapshot_by_time_offset_task_list {
97+
definition = tencentcloud_vod_snapshot_by_time_offset_template.foo.id
98+
ext_time_offset_list = [
99+
"3.5s"
100+
]
101+
}
102+
image_sprite_task_list {
103+
definition = tencentcloud_vod_image_sprite_template.foo.id
104+
}
105+
}
106+
}
107+
108+
data "tencentcloud_vod_adaptive_dynamic_streaming_templates" "foo" {
109+
type = "Custom"
110+
definition = tencentcloud_vod_adaptive_dynamic_streaming_template.foo.id
111+
}
112+
113+
data "tencentcloud_vod_image_sprite_templates" "foo" {
114+
type = "Custom"
115+
definition = tencentcloud_vod_image_sprite_template.foo.id
116+
}
117+
118+
data "tencentcloud_vod_snapshot_by_time_offset_templates" "foo" {
119+
type = "Custom"
120+
definition = tencentcloud_vod_snapshot_by_time_offset_template.foo.id
121+
}
122+
123+
data "tencentcloud_vod_super_player_configs" "foo" {
124+
type = "Custom"
125+
name = tencentcloud_vod_super_player_config.foo.id
126+
}
127+
128+
data "tencentcloud_vod_procedure_templates" "foo" {
129+
type = "Custom"
130+
name = tencentcloud_vod_procedure_template.foo.id
131+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "availability_zone" {
2+
default = "ap-guangzhou-4"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
terraform {
2+
required_version = ">= 0.12"
3+
}

go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,16 +663,13 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks
663663
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
664664
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
665665
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
666-
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
667666
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
668667
gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
669668
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
670-
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
671669
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
672670
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
673671
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
674672
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
675-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
676673
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
677674
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
678675
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

tencentcloud/connectivity/client.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
tag "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag/v20180813"
3636
tcaplusdb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcaplusdb/v20190823"
3737
tke "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525"
38+
vod "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod/v20180717"
3839
vpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312"
3940
ssl "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss/v20180426"
4041
)
@@ -74,6 +75,7 @@ type TencentCloudClient struct {
7475
ckafkaConn *ckafka.Client
7576
auditConn *audit.Client
7677
cynosConn *cynosdb.Client
78+
vodConn *vod.Client
7779
}
7880

7981
// NewClientProfile returns a new ClientProfile
@@ -473,3 +475,16 @@ func (me *TencentCloudClient) UseCynosdbClient() *cynosdb.Client {
473475

474476
return me.cynosConn
475477
}
478+
479+
// UseVodClient returns vod client for service
480+
func (me *TencentCloudClient) UseVodClient() *vod.Client {
481+
if me.vodConn != nil {
482+
return me.vodConn
483+
}
484+
485+
cpf := me.NewClientProfile(300)
486+
me.vodConn, _ = vod.NewClient(me.Credential, me.Region, cpf)
487+
me.vodConn.WithHttpTransport(&LogRoundTripper{})
488+
489+
return me.vodConn
490+
}

0 commit comments

Comments
 (0)