From 10f8013c456e602839bbd1250a96c687f82ccc5e Mon Sep 17 00:00:00 2001 From: bruceybian Date: Tue, 30 Jan 2024 15:19:10 +0800 Subject: [PATCH 1/4] mps schedule resource add resource_id param --- go.mod | 2 +- go.sum | 4 + .../mps/data_source_tc_mps_schedules.go | 9 ++ .../services/mps/resource_tc_mps_schedule.go | 20 +++ .../tencentcloud/mps/v20190612/client.go | 26 +++- .../tencentcloud/mps/v20190612/errors.go | 3 + .../tencentcloud/mps/v20190612/models.go | 123 ++++++++++++++++-- vendor/modules.txt | 2 +- website/docs/d/mps_schedules.html.markdown | 1 + website/docs/r/mps_schedule.html.markdown | 1 + 10 files changed, 175 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 95fbb4e655..f6e54c926a 100644 --- a/go.mod +++ b/go.mod @@ -68,8 +68,8 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mariadb v1.0.672 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mongodb v1.0.651 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.844 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.777 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/organization v1.0.856 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.853 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/postgres v1.0.814 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.815 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/pts v1.0.762 diff --git a/go.sum b/go.sum index de7b0a7683..d667ca3da9 100644 --- a/go.sum +++ b/go.sum @@ -958,6 +958,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.847 h1:ITZm github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.847/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.856 h1:4PaaKxPjh0dmRzzz0CRZSZlbvzQIPcg4TE1Ibz0Cdlk= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.856/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.853 h1:TNYjF1jDLLNTirAkq7zRT9iF9xC2ZjgwpXsVSEBQvgQ= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.853/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 h1:nEZqsoqt1pEoaP9JjkHQy3/H00suCfzlHW1qOm2nYD8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624/go.mod h1:+TXSVyeKwt1IhZRqKPbTREteBcP+K07Q846/ilNzLWA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.762 h1:2egy69SP/wPsmnfozcQVZ6tUY6F6N/TpEe/7xtXrc/8= @@ -1006,6 +1008,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.844 h1:ZR7 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.844/go.mod h1:a7PfDWl0B3QV+g99asQHumDNScEEMl+7lkXP0KXt8Xg= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.777 h1:SoH/KkqkEUw8iDmQDZCw5Saf319Ceyt3v8Vqodo8DiY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.777/go.mod h1:sBmwqD3GkczHFiArdYpHPp9QriIbzNtO99DueYVyGwE= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.853 h1:abGpWsAtEuF2QIYKm2m9/hv9OqyHwWNLsd5+67z86BE= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.853/go.mod h1:xIprIT+IW+3Fj05GCWmgvxJOhICqFGoW4Ef77cDD2JQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/oceanus v1.0.831 h1:oyazF5wgAgoinGo/SDGfUReE3JFxqcpI6/pstWhK7yE= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/oceanus v1.0.831/go.mod h1:2WuTlTnKCnZoa6l0JxY9GNfo0UG6nU7AEsljF8rMMsM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/organization v1.0.770 h1:Ksu947uY/fafnlILemfMuyKqL/RxHh9dfVowWX8paeQ= diff --git a/tencentcloud/services/mps/data_source_tc_mps_schedules.go b/tencentcloud/services/mps/data_source_tc_mps_schedules.go index e437945f52..c9a653f6a9 100644 --- a/tencentcloud/services/mps/data_source_tc_mps_schedules.go +++ b/tencentcloud/services/mps/data_source_tc_mps_schedules.go @@ -2565,6 +2565,11 @@ func DataSourceTencentCloudMpsSchedules() *schema.Resource { Computed: true, Description: "The last updated time in [ISO date format](https://intl.cloud.tencent.com/document/product/862/37710?from_cn_redirect=1#52).Note: This field may return null, indicating that no valid values can be obtained.", }, + "resource_id": { + Type: schema.TypeInt, + Computed: true, + Description: "The resource ID. If there is no associated resource ID, fill it with the account's main resource ID.", + }, }, }, }, @@ -4565,6 +4570,10 @@ func dataSourceTencentCloudMpsSchedulesRead(d *schema.ResourceData, meta interfa schedulesInfoMap["update_time"] = schedulesInfo.UpdateTime } + if schedulesInfo.ResourceId != nil { + schedulesInfoMap["resource_id"] = schedulesInfo.ResourceId + } + ids = append(ids, helper.Int64ToStr(*schedulesInfo.ScheduleId)) tmpList = append(tmpList, schedulesInfoMap) } diff --git a/tencentcloud/services/mps/resource_tc_mps_schedule.go b/tencentcloud/services/mps/resource_tc_mps_schedule.go index 73d27ba14e..e4fe5f5179 100644 --- a/tencentcloud/services/mps/resource_tc_mps_schedule.go +++ b/tencentcloud/services/mps/resource_tc_mps_schedule.go @@ -2650,6 +2650,12 @@ func ResourceTencentCloudMpsSchedule() *schema.Resource { }, }, }, + + "resource_id": { + Optional: true, + Type: schema.TypeString, + Description: "Resource ID, you need to ensure that the corresponding resource is open. The default is the account main resource ID.", + }, }, } } @@ -4079,6 +4085,10 @@ func resourceTencentCloudMpsScheduleCreate(d *schema.ResourceData, meta interfac request.TaskNotifyConfig = &taskNotifyConfig } + if v, ok := d.GetOk("resource_id"); ok { + request.ResourceId = helper.String(v.(string)) + } + err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseMpsClient().CreateSchedule(request) if e != nil { @@ -6047,6 +6057,10 @@ func resourceTencentCloudMpsScheduleRead(d *schema.ResourceData, meta interface{ _ = d.Set("task_notify_config", []interface{}{taskNotifyConfigMap}) } + if schedule.ResourceId != nil { + _ = d.Set("resource_id", schedule.ResourceId) + } + return nil } @@ -7488,6 +7502,12 @@ func resourceTencentCloudMpsScheduleUpdate(d *schema.ResourceData, meta interfac } } + if d.HasChange("resource_id") { + if v, ok := d.GetOk("resource_id"); ok { + request.ResourceId = helper.String(v.(string)) + } + } + err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseMpsClient().ModifySchedule(request) if e != nil { diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/client.go index 7026cc6bbf..e481cb1b12 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/client.go @@ -822,6 +822,7 @@ func NewCreateScheduleResponse() (response *CreateScheduleResponse) { // // 可能返回的错误码: // FAILEDOPERATION_COSSTATUSINAVLID = "FailedOperation.CosStatusInavlid" +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCESSDBERROR = "InternalError.AccessDBError" @@ -861,6 +862,7 @@ func (c *Client) CreateSchedule(request *CreateScheduleRequest) (response *Creat // // 可能返回的错误码: // FAILEDOPERATION_COSSTATUSINAVLID = "FailedOperation.CosStatusInavlid" +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCESSDBERROR = "InternalError.AccessDBError" @@ -2989,6 +2991,7 @@ func NewDescribeSchedulesResponse() (response *DescribeSchedulesResponse) { // 查询编排。 // // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // FAILEDOPERATION_INVALIDUSER = "FailedOperation.InvalidUser" // INTERNALERROR = "InternalError" @@ -3002,6 +3005,7 @@ func (c *Client) DescribeSchedules(request *DescribeSchedulesRequest) (response // 查询编排。 // // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // FAILEDOPERATION_INVALIDUSER = "FailedOperation.InvalidUser" // INTERNALERROR = "InternalError" @@ -4270,7 +4274,7 @@ func NewEditMediaResponse() (response *EditMediaResponse) { // EditMedia // 对视频进行编辑,生成一个新的视频。编辑的功能包括: // -// +// // // // @@ -4295,6 +4299,7 @@ func NewEditMediaResponse() (response *EditMediaResponse) { // 4. 视频级别:转场、倍数播放、拼接、剪切、字幕、画中画、音画分离、出入场动效等 // // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" @@ -4305,7 +4310,7 @@ func (c *Client) EditMedia(request *EditMediaRequest) (response *EditMediaRespon // EditMedia // 对视频进行编辑,生成一个新的视频。编辑的功能包括: // -// +// // // // @@ -4330,6 +4335,7 @@ func (c *Client) EditMedia(request *EditMediaRequest) (response *EditMediaRespon // 4. 视频级别:转场、倍数播放、拼接、剪切、字幕、画中画、音画分离、出入场动效等 // // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" @@ -4375,6 +4381,7 @@ func NewEnableScheduleResponse() (response *EnableScheduleResponse) { // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_BUCKETNOTIFYALREADYEXIST = "FailedOperation.BucketNotifyAlreadyExist" // FAILEDOPERATION_COSSTATUSINAVLID = "FailedOperation.CosStatusInavlid" +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_GETSOURCENOTIFY = "FailedOperation.GetSourceNotify" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // FAILEDOPERATION_INVALIDUSER = "FailedOperation.InvalidUser" @@ -4396,6 +4403,7 @@ func (c *Client) EnableSchedule(request *EnableScheduleRequest) (response *Enabl // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_BUCKETNOTIFYALREADYEXIST = "FailedOperation.BucketNotifyAlreadyExist" // FAILEDOPERATION_COSSTATUSINAVLID = "FailedOperation.CosStatusInavlid" +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_GETSOURCENOTIFY = "FailedOperation.GetSourceNotify" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // FAILEDOPERATION_INVALIDUSER = "FailedOperation.InvalidUser" @@ -5212,6 +5220,7 @@ func NewModifyScheduleResponse() (response *ModifyScheduleResponse) { // 修改编排 // // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // FAILEDOPERATION_INVALIDUSER = "FailedOperation.InvalidUser" // INTERNALERROR = "InternalError" @@ -5226,6 +5235,7 @@ func (c *Client) ModifySchedule(request *ModifyScheduleRequest) (response *Modif // 修改编排 // // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // FAILEDOPERATION_INVALIDUSER = "FailedOperation.InvalidUser" // INTERNALERROR = "InternalError" @@ -5923,6 +5933,7 @@ func NewProcessLiveStreamResponse() (response *ProcessLiveStreamResponse) { // 直播流处理事件通知支持HTTP回调,也支持实时写入用户指定的消息队列 CMQ 中,用户从消息队列 CMQ 中获取事件通知结果,同时处理过程中存在输出文件的,会写入用户指定的输出文件的目标存储中。 // // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" @@ -5953,6 +5964,7 @@ func (c *Client) ProcessLiveStream(request *ProcessLiveStreamRequest) (response // 直播流处理事件通知支持HTTP回调,也支持实时写入用户指定的消息队列 CMQ 中,用户从消息队列 CMQ 中获取事件通知结果,同时处理过程中存在输出文件的,会写入用户指定的输出文件的目标存储中。 // // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" @@ -6011,11 +6023,14 @@ func NewProcessMediaResponse() (response *ProcessMediaResponse) { // // 7. 智能内容审核(鉴黄、敏感信息检测); // -// 8. 智能内容分析(标签、分类、封面、按帧标签、拆条、集锦、片头片尾); +// 8. 智能内容分析(标签、分类、封面、按帧标签、拆条、集锦、片头片尾、游戏打点); // // 9. 智能内容识别(人脸、文本全文、文本关键词、语音全文、语音关键词、语音翻译、物体识别)。 // +// 10. 媒体质检(直播流格式诊断、音画内容检测(抖动、模糊、低光照、过曝光、黑边、白边、黑屏、白屏、花屏、噪点、马赛克、二维码等)、无参考打分) +// // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" @@ -6043,11 +6058,14 @@ func (c *Client) ProcessMedia(request *ProcessMediaRequest) (response *ProcessMe // // 7. 智能内容审核(鉴黄、敏感信息检测); // -// 8. 智能内容分析(标签、分类、封面、按帧标签、拆条、集锦、片头片尾); +// 8. 智能内容分析(标签、分类、封面、按帧标签、拆条、集锦、片头片尾、游戏打点); // // 9. 智能内容识别(人脸、文本全文、文本关键词、语音全文、语音关键词、语音翻译、物体识别)。 // +// 10. 媒体质检(直播流格式诊断、音画内容检测(抖动、模糊、低光照、过曝光、黑边、白边、黑屏、白屏、花屏、噪点、马赛克、二维码等)、无参考打分) +// // 可能返回的错误码: +// FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" // FAILEDOPERATION_INVALIDMPSUSER = "FailedOperation.InvalidMpsUser" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/errors.go index 37bb2d50cc..aac856222b 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/errors.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/errors.go @@ -26,6 +26,9 @@ const ( // 操作失败:COS 已经停服。 FAILEDOPERATION_COSSTATUSINAVLID = "FailedOperation.CosStatusInavlid" + // 生成资源失败。 + FAILEDOPERATION_GENERATERESOURCE = "FailedOperation.GenerateResource" + // 操作失败:获取源通知错误。 FAILEDOPERATION_GETSOURCENOTIFY = "FailedOperation.GetSourceNotify" diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/models.go index b7553ad7c7..21037ba25d 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612/models.go @@ -347,6 +347,8 @@ type AiAnalysisResult struct { //
  • Tag:智能标签
  • //
  • FrameTag:智能按帧标签
  • //
  • Highlight:智能精彩集锦
  • + //
  • DeLogo:智能去水印
  • + //
  • Description:大模型摘要
  • Type *string `json:"Type,omitnil" name:"Type"` // 视频内容分析智能分类任务的查询结果,当任务类型为 Classification 时有效。 @@ -372,6 +374,10 @@ type AiAnalysisResult struct { // 视频内容分析去水印任务的查询结果,当任务类型为 DeLogo 时有效。 // 注意:此字段可能返回 null,表示取不到有效值。 DeLogoTask *AiAnalysisTaskDelLogoResult `json:"DeLogoTask,omitnil" name:"DeLogoTask"` + + // 视频内容分析摘要任务的查询结果,当任务类型为 Description 时有效。 + // 注意:此字段可能返回 null,表示取不到有效值。 + DescriptionTask *AiAnalysisTaskDescriptionResult `json:"DescriptionTask,omitnil" name:"DescriptionTask"` } type AiAnalysisTaskClassificationInput struct { @@ -470,6 +476,34 @@ type AiAnalysisTaskDelLogoResult struct { Output *AiAnalysisTaskDelLogoOutput `json:"Output,omitnil" name:"Output"` } +type AiAnalysisTaskDescriptionInput struct { + // 视频智能描述模板 ID。 + Definition *uint64 `json:"Definition,omitnil" name:"Definition"` +} + +type AiAnalysisTaskDescriptionOutput struct { + // 视频智能描述列表。 + DescriptionSet []*MediaAiAnalysisDescriptionItem `json:"DescriptionSet,omitnil" name:"DescriptionSet"` +} + +type AiAnalysisTaskDescriptionResult struct { + // 任务状态,有 PROCESSING,SUCCESS 和 FAIL 三种。 + Status *string `json:"Status,omitnil" name:"Status"` + + // 错误码,0:成功,其他值:失败。 + ErrCode *int64 `json:"ErrCode,omitnil" name:"ErrCode"` + + // 错误信息。 + Message *string `json:"Message,omitnil" name:"Message"` + + // 智能描述任务输入。 + Input *AiAnalysisTaskDescriptionInput `json:"Input,omitnil" name:"Input"` + + // 智能描述任务输出。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Output *AiAnalysisTaskDescriptionOutput `json:"Output,omitnil" name:"Output"` +} + type AiAnalysisTaskFrameTagInput struct { // 视频智能按帧标签模板 ID。 Definition *uint64 `json:"Definition,omitnil" name:"Definition"` @@ -640,6 +674,20 @@ type AiContentReviewTaskInput struct { Definition *uint64 `json:"Definition,omitnil" name:"Definition"` } +type AiParagraphInfo struct { + // 分段摘要 + // 注意:此字段可能返回 null,表示取不到有效值。 + Summary *string `json:"Summary,omitnil" name:"Summary"` + + // 分段起始时间点,秒 + // 注意:此字段可能返回 null,表示取不到有效值。 + StartTimeOffset *float64 `json:"StartTimeOffset,omitnil" name:"StartTimeOffset"` + + // 分段结束时间点,秒 + // 注意:此字段可能返回 null,表示取不到有效值。 + EndTimeOffset *float64 `json:"EndTimeOffset,omitnil" name:"EndTimeOffset"` +} + type AiQualityControlTaskInput struct { // 视频质检模板 ID 。暂时可以直接使用 预设模板ID 10,后面控制台支持用户配置自定义模板。 // 注意:此字段可能返回 null,表示取不到有效值。 @@ -717,6 +765,10 @@ type AiRecognitionTaskAsrFullTextResult struct { // 语音全文识别任务输出信息。 // 注意:此字段可能返回 null,表示取不到有效值。 Output *AiRecognitionTaskAsrFullTextResultOutput `json:"Output,omitnil" name:"Output"` + + // 任务进度。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Progress *uint64 `json:"Progress,omitnil" name:"Progress"` } type AiRecognitionTaskAsrFullTextResultInput struct { @@ -1084,6 +1136,10 @@ type AiRecognitionTaskTransTextResult struct { // 翻译任务输出信息。 // 注意:此字段可能返回 null,表示取不到有效值。 Output *AiRecognitionTaskTransTextResultOutput `json:"Output,omitnil" name:"Output"` + + // 任务进度。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Progress *uint64 `json:"Progress,omitnil" name:"Progress"` } type AiRecognitionTaskTransTextResultInput struct { @@ -1840,6 +1896,8 @@ type AudioSeparateConfig struct { type AudioTemplateInfo struct { // 音频流的编码格式。 + // 当不需要对音频进行转码时,可选值为: + //
  • copy。
  • // 当外层参数 Container 为 mp3 时,可选值为: //
  • libmp3lame。
  • // 当外层参数 Container 为 ogg 或 flac 时,可选值为: @@ -1850,7 +1908,8 @@ type AudioTemplateInfo struct { //
  • ac3。
  • // 当外层参数 Container 为 mp4 或 flv 时,可选值为: //
  • libfdk_aac:更适合 mp4;
  • - //
  • libmp3lame:更适合 flv。
  • + //
  • libmp3lame:更适合 flv;
  • + //
  • mp2。
  • // 当外层参数 Container 为 hls 时,可选值为: //
  • libfdk_aac;
  • //
  • libmp3lame。
  • @@ -1870,14 +1929,16 @@ type AudioTemplateInfo struct { // 音频通道方式,可选值: //
  • 1:单通道
  • //
  • 2:双通道
  • - //
  • 6:立体声
  • - // 当媒体的封装格式是音频格式时(flac,ogg,mp3,m4a)时,声道数不允许设为立体声。 + //
  • 6:5.1声道
  • + // 当媒体的封装格式是音频格式时(flac,ogg,mp3,m4a)时,声道数不允许设为5.1声道。 // 默认值:2。 AudioChannel *int64 `json:"AudioChannel,omitnil" name:"AudioChannel"` } type AudioTemplateInfoForUpdate struct { // 音频流的编码格式。 + // 当不需要对音频进行转码时,可选值为: + //
  • copy。
  • // 当外层参数 Container 为 mp3 时,可选值为: //
  • libmp3lame。
  • // 当外层参数 Container 为 ogg 或 flac 时,可选值为: @@ -2222,6 +2283,11 @@ type ComposeAudioStream struct { //
  • 1:单声道 。
  • //
  • 2:双声道(默认)。
  • AudioChannel *int64 `json:"AudioChannel,omitnil" name:"AudioChannel"` + + // 参考码率,单位 kbps,范围:26~10000。 + // 如果设置,编码时会尽量按该码率进行编码。 + // 如果不设置,服务将根据音频参数自动采用合适的码率。 + Bitrate *int64 `json:"Bitrate,omitnil" name:"Bitrate"` } type ComposeCanvas struct { @@ -2608,6 +2674,11 @@ type ComposeVideoStream struct { // 视频帧率,取值范围:[0, 60],单位:Hz。 // 默认值:0,表示和第一个视频帧率一致。 Fps *int64 `json:"Fps,omitnil" name:"Fps"` + + // 参考码率,单位 kbps,范围:50~35000。 + // 如果设置,编码时会尽量按该码率进行编码。 + // 如果不设置,服务将通过画面复杂度自动采用合适的码率。 + Bitrate *int64 `json:"Bitrate,omitnil" name:"Bitrate"` } type ContentReviewTemplateItem struct { @@ -3886,6 +3957,9 @@ type CreateScheduleRequestParams struct { // 任务的事件通知配置,不填代表不获取事件通知。 TaskNotifyConfig *TaskNotifyConfig `json:"TaskNotifyConfig,omitnil" name:"TaskNotifyConfig"` + + // 资源ID,需要保证对应资源是开启状态。默认为帐号主资源ID。 + ResourceId *string `json:"ResourceId,omitnil" name:"ResourceId"` } type CreateScheduleRequest struct { @@ -3909,6 +3983,9 @@ type CreateScheduleRequest struct { // 任务的事件通知配置,不填代表不获取事件通知。 TaskNotifyConfig *TaskNotifyConfig `json:"TaskNotifyConfig,omitnil" name:"TaskNotifyConfig"` + + // 资源ID,需要保证对应资源是开启状态。默认为帐号主资源ID。 + ResourceId *string `json:"ResourceId,omitnil" name:"ResourceId"` } func (r *CreateScheduleRequest) ToJsonString() string { @@ -3929,6 +4006,7 @@ func (r *CreateScheduleRequest) FromJsonString(s string) error { delete(f, "OutputStorage") delete(f, "OutputDir") delete(f, "TaskNotifyConfig") + delete(f, "ResourceId") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateScheduleRequest has unknown keys!", "") } @@ -10183,6 +10261,11 @@ type LiveStreamTagRecognitionResult struct { } type LiveStreamTaskNotifyConfig struct { + // 通知类型,默认CMQ,指定URL时HTTP回调推送到 NotifyUrl 指定的地址。 + // + // 注:不填或为空时默认 CMQ,如需采用其他类型需填写对应类型值。 + NotifyType *string `json:"NotifyType,omitnil" name:"NotifyType"` + // CMQ 的模型,有 Queue 和 Topic 两种,目前仅支持 Queue。 CmqModel *string `json:"CmqModel,omitnil" name:"CmqModel"` @@ -10195,11 +10278,6 @@ type LiveStreamTaskNotifyConfig struct { // 当模型为 Topic 时有效,表示接收事件通知的 CMQ 的主题名。 TopicName *string `json:"TopicName,omitnil" name:"TopicName"` - // 通知类型,默认CMQ,指定URL时HTTP回调推送到 NotifyUrl 指定的地址。 - // - // 注:不填或为空时默认 CMQ,如需采用其他类型需填写对应类型值。 - NotifyType *string `json:"NotifyType,omitnil" name:"NotifyType"` - // HTTP回调地址,NotifyType为URL时必填。 NotifyUrl *string `json:"NotifyUrl,omitnil" name:"NotifyUrl"` } @@ -10334,6 +10412,18 @@ type MediaAiAnalysisCoverItem struct { Confidence *float64 `json:"Confidence,omitnil" name:"Confidence"` } +type MediaAiAnalysisDescriptionItem struct { + // 智能描述。 + Description *string `json:"Description,omitnil" name:"Description"` + + // 智能描述的可信度,取值范围是 0 到 100。 + Confidence *float64 `json:"Confidence,omitnil" name:"Confidence"` + + // 分段结果。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Paragraphs []*AiParagraphInfo `json:"Paragraphs,omitnil" name:"Paragraphs"` +} + type MediaAiAnalysisFrameTagItem struct { // 按帧标签名称。 Tag *string `json:"Tag,omitnil" name:"Tag"` @@ -12093,6 +12183,9 @@ type ModifyScheduleRequestParams struct { // 任务的事件通知配置。 TaskNotifyConfig *TaskNotifyConfig `json:"TaskNotifyConfig,omitnil" name:"TaskNotifyConfig"` + + // 资源ID,需要保证对应资源是开启状态。 + ResourceId *string `json:"ResourceId,omitnil" name:"ResourceId"` } type ModifyScheduleRequest struct { @@ -12120,6 +12213,9 @@ type ModifyScheduleRequest struct { // 任务的事件通知配置。 TaskNotifyConfig *TaskNotifyConfig `json:"TaskNotifyConfig,omitnil" name:"TaskNotifyConfig"` + + // 资源ID,需要保证对应资源是开启状态。 + ResourceId *string `json:"ResourceId,omitnil" name:"ResourceId"` } func (r *ModifyScheduleRequest) ToJsonString() string { @@ -12141,6 +12237,7 @@ func (r *ModifyScheduleRequest) FromJsonString(s string) error { delete(f, "OutputStorage") delete(f, "OutputDir") delete(f, "TaskNotifyConfig") + delete(f, "ResourceId") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyScheduleRequest has unknown keys!", "") } @@ -13613,7 +13710,8 @@ type ProcessMediaRequestParams struct { // 编排ID。 // 注意1:对于OutputStorage、OutputDir参数: //
  • 当服务编排中子任务节点配置了OutputStorage、OutputDir时,该子任务节点中配置的输出作为子任务的输出。
  • - //
  • 当服务编排中子任务节点没有配置OutputStorage、OutputDir时,若创建任务接口(ProcessMedia)有输出,将覆盖原有编排的默认输出。
  • + //
  • 当服务编排中子任务节点没有配置OutputStorage、OutputDir时,若创建任务接口(ProcessMedia)有指定输出,将覆盖原有编排的默认输出。
  • + //
  • 即输出设置的优先级:编排子任务节点 > 任务接口指定 > 对应编排内的配置
  • // 注意2:对于TaskNotifyConfig参数,若创建任务接口(ProcessMedia)有设置,将覆盖原有编排的默认回调。 // // 注意3:编排的 Trigger 只是用来自动化触发场景,在手动发起的请求中已经配置的 Trigger 无意义。 @@ -13668,7 +13766,8 @@ type ProcessMediaRequest struct { // 编排ID。 // 注意1:对于OutputStorage、OutputDir参数: //
  • 当服务编排中子任务节点配置了OutputStorage、OutputDir时,该子任务节点中配置的输出作为子任务的输出。
  • - //
  • 当服务编排中子任务节点没有配置OutputStorage、OutputDir时,若创建任务接口(ProcessMedia)有输出,将覆盖原有编排的默认输出。
  • + //
  • 当服务编排中子任务节点没有配置OutputStorage、OutputDir时,若创建任务接口(ProcessMedia)有指定输出,将覆盖原有编排的默认输出。
  • + //
  • 即输出设置的优先级:编排子任务节点 > 任务接口指定 > 对应编排内的配置
  • // 注意2:对于TaskNotifyConfig参数,若创建任务接口(ProcessMedia)有设置,将覆盖原有编排的默认回调。 // // 注意3:编排的 Trigger 只是用来自动化触发场景,在手动发起的请求中已经配置的 Trigger 无意义。 @@ -14538,6 +14637,10 @@ type SchedulesInfo struct { // 最后编辑时间,使用 [ISO 日期格式](https://cloud.tencent.com/document/product/862/37710#52)。 // 注意:此字段可能返回 null,表示取不到有效值。 UpdateTime *string `json:"UpdateTime,omitnil" name:"UpdateTime"` + + // 资源ID,对于没有关联资源ID的,用账号主资源ID填充。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ResourceId *string `json:"ResourceId,omitnil" name:"ResourceId"` } type ScratchRepairConfig struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index a15270e2a9..4a41cc83bd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1234,7 +1234,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mongodb/v20190725 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.844 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor/v20180724 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.777 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.853 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps/v20190612 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/oceanus v1.0.831 diff --git a/website/docs/d/mps_schedules.html.markdown b/website/docs/d/mps_schedules.html.markdown index af175d81db..3f7f81ce71 100644 --- a/website/docs/d/mps_schedules.html.markdown +++ b/website/docs/d/mps_schedules.html.markdown @@ -428,6 +428,7 @@ In addition to all arguments above, the following attributes are exported: * `s3_secret_id` - The key ID required to upload files to the AWS S3 object. * `s3_secret_key` - The key required to upload files to the AWS S3 object. * `type` - The storage type for a media processing output file. Valid values:`COS`: Tencent Cloud COS. `AWS-S3`: AWS S3. This type is only supported for AWS tasks, and the output bucket must be in the same region as the bucket of the source file. + * `resource_id` - The resource ID. If there is no associated resource ID, fill it with the account's main resource ID. * `schedule_id` - The scheme ID. * `schedule_name` - The scheme name.Note: This field may return null, indicating that no valid values can be obtained. * `status` - The scheme status. Valid values:`Enabled``Disabled`Note: This field may return null, indicating that no valid values can be obtained. diff --git a/website/docs/r/mps_schedule.html.markdown b/website/docs/r/mps_schedule.html.markdown index 9bbec9fb25..0a7a131a32 100644 --- a/website/docs/r/mps_schedule.html.markdown +++ b/website/docs/r/mps_schedule.html.markdown @@ -160,6 +160,7 @@ The following arguments are supported: * `trigger` - (Required, List) The trigger of the scheme. If a file is uploaded to the specified bucket, the scheme will be triggered. * `output_dir` - (Optional, String) The directory to save the media processing output file, which must start and end with `/`, such as `/movie/201907/`.If you do not specify this, the file will be saved to the trigger directory. * `output_storage` - (Optional, List) The bucket to save the output file. If you do not specify this parameter, the bucket in `Trigger` will be used. +* `resource_id` - (Optional, String) Resource ID, you need to ensure that the corresponding resource is open. The default is the account main resource ID. * `task_notify_config` - (Optional, List) The notification configuration. If you do not specify this parameter, notifications will not be sent. The `activities` object supports the following: From 28fb4ea5d30b6744b6d24989506730f84564427f Mon Sep 17 00:00:00 2001 From: bruceybian Date: Wed, 31 Jan 2024 18:55:27 +0800 Subject: [PATCH 2/4] update e2e test --- .../mps/data_source_tc_mps_schedules.go | 2 +- .../mps/data_source_tc_mps_schedules_test.go | 149 +++++++++++++++++- .../mps/resource_tc_mps_schedule_test.go | 32 ++-- 3 files changed, 163 insertions(+), 20 deletions(-) diff --git a/tencentcloud/services/mps/data_source_tc_mps_schedules.go b/tencentcloud/services/mps/data_source_tc_mps_schedules.go index c9a653f6a9..60c2f7fbdc 100644 --- a/tencentcloud/services/mps/data_source_tc_mps_schedules.go +++ b/tencentcloud/services/mps/data_source_tc_mps_schedules.go @@ -2566,7 +2566,7 @@ func DataSourceTencentCloudMpsSchedules() *schema.Resource { Description: "The last updated time in [ISO date format](https://intl.cloud.tencent.com/document/product/862/37710?from_cn_redirect=1#52).Note: This field may return null, indicating that no valid values can be obtained.", }, "resource_id": { - Type: schema.TypeInt, + Type: schema.TypeString, Computed: true, Description: "The resource ID. If there is no associated resource ID, fill it with the account's main resource ID.", }, diff --git a/tencentcloud/services/mps/data_source_tc_mps_schedules_test.go b/tencentcloud/services/mps/data_source_tc_mps_schedules_test.go index df192942f1..647bcab170 100644 --- a/tencentcloud/services/mps/data_source_tc_mps_schedules_test.go +++ b/tencentcloud/services/mps/data_source_tc_mps_schedules_test.go @@ -28,16 +28,15 @@ func TestAccTencentCloudMpsSchedulesDataSource_basic(t *testing.T) { ), }, { - Config: fmt.Sprintf(testAccMpsSchedulesDataSource_specific_one, tcacctest.DefaultMpsScheduleId), + Config: fmt.Sprintf(testAccMpsSchedulesDataSource_specific_one), Check: resource.ComposeTestCheckFunc( tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_mps_schedules.schedules"), resource.TestCheckResourceAttrSet("data.tencentcloud_mps_schedules.schedules", "schedule_ids.#"), - resource.TestCheckTypeSetElemAttr("data.tencentcloud_mps_schedules.schedules", "schedule_ids.*", fmt.Sprint(tcacctest.DefaultMpsScheduleId)), resource.TestCheckResourceAttr("data.tencentcloud_mps_schedules.schedules", "trigger_type", "CosFileUpload"), resource.TestCheckResourceAttr("data.tencentcloud_mps_schedules.schedules", "status", "Disabled"), resource.TestCheckResourceAttrSet("data.tencentcloud_mps_schedules.schedules", "schedule_info_set.#"), - resource.TestCheckResourceAttr("data.tencentcloud_mps_schedules.schedules", "schedule_info_set.0.schedule_id", fmt.Sprint(tcacctest.DefaultMpsScheduleId)), - resource.TestCheckResourceAttr("data.tencentcloud_mps_schedules.schedules", "schedule_info_set.0.schedule_name", tcacctest.DefaultMpsScheduleName), + resource.TestCheckResourceAttrSet("data.tencentcloud_mps_schedules.schedules", "schedule_info_set.0.schedule_id"), + resource.TestCheckResourceAttr("data.tencentcloud_mps_schedules.schedules", "schedule_info_set.0.schedule_name", "tf_test_mps_schedule_001"), resource.TestCheckResourceAttr("data.tencentcloud_mps_schedules.schedules", "schedule_info_set.0.status", "Disabled"), resource.TestCheckResourceAttrSet("data.tencentcloud_mps_schedules.schedules", "schedule_info_set.0.trigger.#"), resource.TestCheckResourceAttrSet("data.tencentcloud_mps_schedules.schedules", "schedule_info_set.0.activities.#"), @@ -59,12 +58,148 @@ data "tencentcloud_mps_schedules" "schedules" { ` -const testAccMpsSchedulesDataSource_specific_one = ` +const testAccMpsSchedulesDataSource_specific_one = tcacctest.UserInfoData + ` +resource "tencentcloud_cos_bucket" "output" { + bucket = "tf-bucket-mps-schedule-output-${local.app_id}" + force_clean = true + acl = "public-read" +} + +resource "tencentcloud_cos_bucket_object" "object" { + bucket = tencentcloud_cos_bucket.output.bucket + key = "/mps-test/test.mov" + content = "aaaaaaaaaaaaaaaa" + content_type = "binary/octet-stream" +} + +resource "tencentcloud_mps_schedule" "schedule" { + schedule_name = "tf_test_mps_schedule_001" + + trigger { + type = "CosFileUpload" + cos_file_upload_trigger { + bucket = tencentcloud_cos_bucket_object.object.bucket + region = "ap-guangzhou" + dir = "/upload/" + formats = ["flv", "mov"] + } + } + + activities { + activity_type = "input" + reardrive_index = [1, 2] + } + + activities { + activity_type = "action-trans" + reardrive_index = [3] + activity_para { + transcode_task { + definition = 10 + } + } + } + + activities { + activity_type = "action-trans" + reardrive_index = [6, 7] + activity_para { + transcode_task { + definition = 10 + } + } + } + + activities { + activity_type = "action-trans" + reardrive_index = [4, 5] + activity_para { + transcode_task { + definition = 10 + } + } + } + + activities { + activity_type = "action-trans" + reardrive_index = [10] + activity_para { + transcode_task { + definition = 10 + } + } + } + + activities { + activity_type = "action-trans" + reardrive_index = [10] + activity_para { + transcode_task { + definition = 10 + } + } + } + + activities { + activity_type = "action-trans" + reardrive_index = [10] + activity_para { + transcode_task { + definition = 10 + } + } + } + + activities { + activity_type = "action-trans" + reardrive_index = [8] + activity_para { + transcode_task { + definition = 10 + } + } + } + + activities { + activity_type = "action-trans" + reardrive_index = [9] + activity_para { + transcode_task { + definition = 10 + } + } + } + + activities { + activity_type = "action-trans" + reardrive_index = [10] + activity_para { + transcode_task { + definition = 10 + } + } + } + + activities { + activity_type = "output" + } + + output_storage { + type = "COS" + cos_output_storage { + bucket = tencentcloud_cos_bucket.output.bucket + region = "ap-guangzhou" + } + } + + output_dir = "output/" + resource_id = "vts-2600014161-0" +} data "tencentcloud_mps_schedules" "schedules" { - schedule_ids = [%d] + schedule_ids = [tencentcloud_mps_schedule.schedule.id] trigger_type = "CosFileUpload" status = "Disabled" - } +} ` diff --git a/tencentcloud/services/mps/resource_tc_mps_schedule_test.go b/tencentcloud/services/mps/resource_tc_mps_schedule_test.go index 11b3f66dd6..c108917a04 100644 --- a/tencentcloud/services/mps/resource_tc_mps_schedule_test.go +++ b/tencentcloud/services/mps/resource_tc_mps_schedule_test.go @@ -126,6 +126,7 @@ func TestAccTencentCloudMpsScheduleResource_basic(t *testing.T) { resource.TestCheckResourceAttr("tencentcloud_mps_schedule.schedule", "output_storage.0.cos_output_storage.0.region", tcacctest.DefaultRegion), resource.TestCheckResourceAttr("tencentcloud_mps_schedule.schedule", "output_dir", "output/"), + resource.TestCheckResourceAttrSet("tencentcloud_mps_schedule.schedule", "resource_id"), ), }, { @@ -184,6 +185,7 @@ func TestAccTencentCloudMpsScheduleResource_basic(t *testing.T) { resource.TestCheckResourceAttr("tencentcloud_mps_schedule.schedule", "output_storage.0.cos_output_storage.0.region", tcacctest.DefaultRegion), resource.TestCheckResourceAttr("tencentcloud_mps_schedule.schedule", "output_dir", "output_chagned/"), + resource.TestCheckResourceAttrSet("tencentcloud_mps_schedule.schedule", "resource_id"), ), }, { @@ -196,24 +198,26 @@ func TestAccTencentCloudMpsScheduleResource_basic(t *testing.T) { } const testAccMpsSchedule = tcacctest.UserInfoData + ` -data "tencentcloud_cos_bucket_object" "object" { - bucket = "keep-bucket-${local.app_id}" - key = "/mps-test/test.mov" -} - resource "tencentcloud_cos_bucket" "output" { bucket = "tf-bucket-mps-schedule-output-${local.app_id}" force_clean = true acl = "public-read" } +resource "tencentcloud_cos_bucket_object" "object" { + bucket = tencentcloud_cos_bucket.output.bucket + key = "/mps-test/test.mov" + content = "aaaaaaaaaaaaaaaa" + content_type = "binary/octet-stream" +} + resource "tencentcloud_mps_schedule" "schedule" { schedule_name = "tf_test_mps_schedule_%d" trigger { type = "CosFileUpload" cos_file_upload_trigger { - bucket = data.tencentcloud_cos_bucket_object.object.bucket + bucket = tencentcloud_cos_bucket_object.object.bucket region = "%s" dir = "/upload/" formats = ["flv", "mov"] @@ -328,30 +332,33 @@ resource "tencentcloud_mps_schedule" "schedule" { } output_dir = "output/" + resource_id = "vts-2600014161-0" } ` const testAccMpsSchedule_update = tcacctest.UserInfoData + ` -data "tencentcloud_cos_bucket_object" "object" { - bucket = "keep-bucket-${local.app_id}" - key = "/mps-test/test.mov" -} - resource "tencentcloud_cos_bucket" "output" { bucket = "tf-bucket-mps-schedule-output-${local.app_id}" force_clean = true acl = "public-read" } +resource "tencentcloud_cos_bucket_object" "object" { + bucket = tencentcloud_cos_bucket.output.bucket + key = "/mps-test/test.mov" + content = "aaaaaaaaaaaaaaaa" + content_type = "binary/octet-stream" +} + resource "tencentcloud_mps_schedule" "schedule" { schedule_name = "tf_test_mps_schedule_%d_changed" trigger { type = "CosFileUpload" cos_file_upload_trigger { - bucket = data.tencentcloud_cos_bucket_object.object.bucket + bucket = tencentcloud_cos_bucket_object.object.bucket region = "%s" dir = "/upload_changed/" formats = ["mp4", "mov"] @@ -466,6 +473,7 @@ resource "tencentcloud_mps_schedule" "schedule" { } output_dir = "output_chagned/" + resource_id = "vts-2600014161-0" } From 6d1e23b958fd42cc45c7201a1d17981cc9ba64e1 Mon Sep 17 00:00:00 2001 From: bruceybian Date: Wed, 31 Jan 2024 18:58:43 +0800 Subject: [PATCH 3/4] add changelog 2513.txt --- .changelog/2513.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/2513.txt diff --git a/.changelog/2513.txt b/.changelog/2513.txt new file mode 100644 index 0000000000..c19c42daf2 --- /dev/null +++ b/.changelog/2513.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/tencentcloud_mps_schedule: Add `resource_id` field +``` + +```release-note:enhancement +resource/tencentcloud_mps_schedules: Add `resource_id` field +``` \ No newline at end of file From 1a2233a9cf6c872a3d731b7e5cc9092733318564 Mon Sep 17 00:00:00 2001 From: bruceybian Date: Wed, 31 Jan 2024 19:52:14 +0800 Subject: [PATCH 4/4] update e2e datasource test --- tencentcloud/services/mps/data_source_tc_mps_schedules_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tencentcloud/services/mps/data_source_tc_mps_schedules_test.go b/tencentcloud/services/mps/data_source_tc_mps_schedules_test.go index 647bcab170..02f0431b91 100644 --- a/tencentcloud/services/mps/data_source_tc_mps_schedules_test.go +++ b/tencentcloud/services/mps/data_source_tc_mps_schedules_test.go @@ -1,7 +1,6 @@ package mps_test import ( - "fmt" "testing" tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" @@ -28,7 +27,7 @@ func TestAccTencentCloudMpsSchedulesDataSource_basic(t *testing.T) { ), }, { - Config: fmt.Sprintf(testAccMpsSchedulesDataSource_specific_one), + Config: testAccMpsSchedulesDataSource_specific_one, Check: resource.ComposeTestCheckFunc( tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_mps_schedules.schedules"), resource.TestCheckResourceAttrSet("data.tencentcloud_mps_schedules.schedules", "schedule_ids.#"),