Skip to content

Commit c1b1acc

Browse files
committed
add sample_snapshot_template
1 parent 88dcd7e commit c1b1acc

File tree

5 files changed

+99
-16
lines changed

5 files changed

+99
-16
lines changed

tencentcloud/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ Media Processing Service(MPS)
950950
tencentcloud_mps_watermark_template
951951
tencentcloud_mps_image_sprite_template
952952
tencentcloud_mps_snapshot_by_timeoffset_template
953+
tencentcloud_mps_sample_snapshot_template
953954
954955
Cloud HDFS(CHDFS)
955956
Data Source
@@ -1709,6 +1710,7 @@ func Provider() terraform.ResourceProvider {
17091710
"tencentcloud_mps_watermark_template": resourceTencentCloudMpsWatermarkTemplate(),
17101711
"tencentcloud_mps_image_sprite_template": resourceTencentCloudMpsImageSpriteTemplate(),
17111712
"tencentcloud_mps_snapshot_by_timeoffset_template": resourceTencentCloudMpsSnapshotByTimeoffsetTemplate(),
1713+
"tencentcloud_mps_sample_snapshot_template": resourceTencentCloudMpsSampleSnapshotTemplate(),
17121714
"tencentcloud_cbs_disk_backup": resourceTencentCloudCbsDiskBackup(),
17131715
"tencentcloud_cbs_snapshot_share_permission": resourceTencentCloudCbsSnapshotSharePermission(),
17141716
"tencentcloud_cbs_disk_backup_rollback_operation": resourceTencentCloudCbsDiskBackupRollbackOperation(),

tencentcloud/resource_tc_mps_sample_snapshot_template.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Example Usage
55
66
```hcl
77
resource "tencentcloud_mps_sample_snapshot_template" "sample_snapshot_template" {
8-
sample_type = <nil>
9-
sample_interval = <nil>
10-
name = <nil>
11-
width = 0
12-
height = 0
8+
fill_type = "stretch"
9+
format = "jpg"
10+
height = 128
11+
name = "terraform-test-for"
1312
resolution_adaptive = "open"
14-
format = "jpg"
15-
comment = <nil>
16-
fill_type = "black"
13+
sample_interval = 10
14+
sample_type = "Percent"
15+
width = 140
1716
}
1817
```
1918

tencentcloud/resource_tc_mps_sample_snapshot_template_test.go

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ func TestAccTencentCloudMpsSampleSnapshotTemplateResource_basic(t *testing.T) {
1818
Config: testAccMpsSampleSnapshotTemplate,
1919
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_mps_sample_snapshot_template.sample_snapshot_template", "id")),
2020
},
21+
{
22+
Config: testAccMpsSampleSnapshotTemplateUpdate,
23+
Check: resource.ComposeTestCheckFunc(
24+
resource.TestCheckResourceAttrSet("tencentcloud_mps_sample_snapshot_template.sample_snapshot_template", "id"),
25+
resource.TestCheckResourceAttr("tencentcloud_mps_sample_snapshot_template.sample_snapshot_template", "name", "terraform-for-test"),
26+
),
27+
},
2128
{
2229
ResourceName: "tencentcloud_mps_sample_snapshot_template.sample_snapshot_template",
2330
ImportState: true,
@@ -30,15 +37,29 @@ func TestAccTencentCloudMpsSampleSnapshotTemplateResource_basic(t *testing.T) {
3037
const testAccMpsSampleSnapshotTemplate = `
3138
3239
resource "tencentcloud_mps_sample_snapshot_template" "sample_snapshot_template" {
33-
sample_type = <nil>
34-
sample_interval = <nil>
35-
name = <nil>
36-
width = 0
37-
height = 0
40+
fill_type = "stretch"
41+
format = "jpg"
42+
height = 128
43+
name = "terraform-test"
44+
resolution_adaptive = "open"
45+
sample_interval = 10
46+
sample_type = "Percent"
47+
width = 140
48+
}
49+
50+
`
51+
52+
const testAccMpsSampleSnapshotTemplateUpdate = `
53+
54+
resource "tencentcloud_mps_sample_snapshot_template" "sample_snapshot_template" {
55+
fill_type = "stretch"
56+
format = "jpg"
57+
height = 128
58+
name = "terraform-for-test"
3859
resolution_adaptive = "open"
39-
format = "jpg"
40-
comment = <nil>
41-
fill_type = "black"
60+
sample_interval = 10
61+
sample_type = "Percent"
62+
width = 140
4263
}
4364
4465
`
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
subcategory: "Media Processing Service(MPS)"
3+
layout: "tencentcloud"
4+
page_title: "TencentCloud: tencentcloud_mps_sample_snapshot_template"
5+
sidebar_current: "docs-tencentcloud-resource-mps_sample_snapshot_template"
6+
description: |-
7+
Provides a resource to create a mps sample_snapshot_template
8+
---
9+
10+
# tencentcloud_mps_sample_snapshot_template
11+
12+
Provides a resource to create a mps sample_snapshot_template
13+
14+
## Example Usage
15+
16+
```hcl
17+
resource "tencentcloud_mps_sample_snapshot_template" "sample_snapshot_template" {
18+
fill_type = "stretch"
19+
format = "jpg"
20+
height = 128
21+
name = "terraform-test-for"
22+
resolution_adaptive = "open"
23+
sample_interval = 10
24+
sample_type = "Percent"
25+
width = 140
26+
}
27+
```
28+
29+
## Argument Reference
30+
31+
The following arguments are supported:
32+
33+
* `sample_interval` - (Required, Int) Sampling interval.When SampleType is Percent, specify the percentage of the sampling interval.When SampleType is Time, specify the sampling interval time in seconds.
34+
* `sample_type` - (Required, String) Sampling snapshot type, optional value:Percent/Time.
35+
* `comment` - (Optional, String) Template description information, length limit: 256 characters.
36+
* `fill_type` - (Optional, String) Filling type, when the aspect ratio of the video stream configuration is inconsistent with the aspect ratio of the original video, the processing method for transcoding is filling. Optional filling type:stretch: Stretching, stretching each frame to fill the entire screen, which may cause the transcoded video to be squashed or stretched.black: Leave black, keep the video aspect ratio unchanged, and fill the rest of the edge with black.white: Leave blank, keep the aspect ratio of the video, and fill the rest of the edge with white.gauss: Gaussian blur, keep the aspect ratio of the video unchanged, and use Gaussian blur for the rest of the edge.Default value: black.
37+
* `format` - (Optional, String) Image format, the value can be jpg, png, webp. Default is jpg.
38+
* `height` - (Optional, Int) The maximum value of the snapshot height (or short side), value range: 0 and [128, 4096], unit: px.When Width and Height are both 0, the resolution is the same.When Width is 0 and Height is not 0, Width is scaled proportionally.When Width is not 0 and Height is 0, Height is scaled proportionally.When both Width and Height are not 0, the resolution is specified by the user.Default value: 0.
39+
* `name` - (Optional, String) Sample snapshot template name, length limit: 64 characters.
40+
* `resolution_adaptive` - (Optional, String) Adaptive resolution, optional value:open: At this time, Width represents the long side of the video, Height represents the short side of the video.close: At this point, Width represents the width of the video, and Height represents the height of the video.Default value: open.
41+
* `width` - (Optional, Int) The maximum value of the snapshot width (or long side), value range: 0 and [128, 4096], unit: px.When Width and Height are both 0, the resolution is the same.When Width is 0 and Height is not 0, Width is scaled proportionally.When Width is not 0 and Height is 0, Height is scaled proportionally.When both Width and Height are not 0, the resolution is specified by the user.Default value: 0.
42+
43+
## Attributes Reference
44+
45+
In addition to all arguments above, the following attributes are exported:
46+
47+
* `id` - ID of the resource.
48+
49+
50+
51+
## Import
52+
53+
mps sample_snapshot_template can be imported using the id, e.g.
54+
55+
```
56+
terraform import tencentcloud_mps_sample_snapshot_template.sample_snapshot_template sample_snapshot_template_id
57+
```
58+

website/tencentcloud.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,9 @@
14311431
<li>
14321432
<a href="/docs/providers/tencentcloud/r/mps_image_sprite_template.html">tencentcloud_mps_image_sprite_template</a>
14331433
</li>
1434+
<li>
1435+
<a href="/docs/providers/tencentcloud/r/mps_sample_snapshot_template.html">tencentcloud_mps_sample_snapshot_template</a>
1436+
</li>
14341437
<li>
14351438
<a href="/docs/providers/tencentcloud/r/mps_snapshot_by_timeoffset_template.html">tencentcloud_mps_snapshot_by_timeoffset_template</a>
14361439
</li>

0 commit comments

Comments
 (0)