diff --git a/go.mod b/go.mod index c2a8dc916b..8751c3b34b 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/postgres v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis v1.0.199 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.199 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.267 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssm v1.0.199 diff --git a/go.sum b/go.sum index 2a77fd7b06..8c7d9d4dd6 100644 --- a/go.sum +++ b/go.sum @@ -494,6 +494,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis v1.0.199 h1:lXCng github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis v1.0.199/go.mod h1:5bwboqeXqVnRvUlKn2G9Y9DbOnWMSVQ0zWhhPZKUVZE= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.199 h1:vvxCCj6RiRM4FkSdxncroAx9JGD6xBBhAnXugQrE3j8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.199/go.mod h1:Pew6DV5oBGrzHYWZ8ssiHeJS/Z39ggVv1y5ADGWdO4s= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.267 h1:ipvvQOzGyUUGohsVLElJnDDZn4Xoq1axk8my+GLyRYs= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.267/go.mod h1:Pew6DV5oBGrzHYWZ8ssiHeJS/Z39ggVv1y5ADGWdO4s= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.199 h1:Ms62XLYCuqrdG4mD5S72oj/ZxdNTxJ+Mc4w0Kxqucwo= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.199/go.mod h1:ySz4zbciCFruAviNMeBcu7wW2+BY9Maw8qGWawTywkM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.199 h1:UkF3qBxMbpOf2VjxgzMgqvBCS+Hqr8XXSrtRd+rABMk= diff --git a/tencentcloud/resource_tc_scf_function.go b/tencentcloud/resource_tc_scf_function.go index d9cf17f17a..e3313e2822 100644 --- a/tencentcloud/resource_tc_scf_function.go +++ b/tencentcloud/resource_tc_scf_function.go @@ -207,20 +207,20 @@ func resourceTencentCloudScfFunction() *schema.Resource { "cos_bucket_name": { Type: schema.TypeString, Optional: true, - ConflictsWith: []string{"zip_file"}, + ConflictsWith: []string{"zip_file", "image_config"}, Description: "Cos bucket name of the SCF function, such as `cos-1234567890`, conflict with `zip_file`.", }, "cos_object_name": { Type: schema.TypeString, Optional: true, - ConflictsWith: []string{"zip_file"}, + ConflictsWith: []string{"zip_file", "image_config"}, ValidateFunc: validateStringSuffix(".zip", ".jar"), Description: "Cos object name of the SCF function, should have suffix `.zip` or `.jar`, conflict with `zip_file`.", }, "cos_bucket_region": { Type: schema.TypeString, Optional: true, - ConflictsWith: []string{"zip_file"}, + ConflictsWith: []string{"zip_file", "image_config"}, Description: "Cos bucket region of the SCF function, conflict with `zip_file`.", }, @@ -228,10 +228,54 @@ func resourceTencentCloudScfFunction() *schema.Resource { "zip_file": { Type: schema.TypeString, Optional: true, - ConflictsWith: []string{"cos_bucket_name", "cos_object_name", "cos_bucket_region"}, + ConflictsWith: []string{"cos_bucket_name", "cos_object_name", "cos_bucket_region", "image_config"}, Description: "Zip file of the SCF function, conflict with `cos_bucket_name`, `cos_object_name`, `cos_bucket_region`.", }, + // image + "image_config": { + Type: schema.TypeList, + Optional: true, + ConflictsWith: []string{"cos_bucket_name", "cos_object_name", "cos_bucket_region", "zip_file"}, + Description: "Image of the SCF function, conflict with ``.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "image_type": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateAllowedStringValue([]string{"personal", "enterprise"}), + Description: "The image type. personal or enterprise.", + }, + "image_uri": { + Type: schema.TypeString, + Required: true, + Description: "The uri of image.", + }, + "registry_id": { + Type: schema.TypeString, + Optional: true, + Description: "The registry id of TCR. When image type is enterprise, it must be set.", + }, + "entry_point": { + Type: schema.TypeString, + Optional: true, + Description: "The entrypoint of app.", + }, + "command": { + Type: schema.TypeString, + Optional: true, + Description: "The command of entrypoint.", + }, + "args": { + Type: schema.TypeString, + Optional: true, + Description: "the parameters of command.", + }, + + }, + }, + }, + "triggers": { Type: schema.TypeSet, Optional: true, @@ -423,6 +467,7 @@ func resourceTencentCloudScfFunctionCreate(d *schema.ResourceData, m interface{} const ( scfFunctionCosCode scfFunctionCodeType = iota + 1 // start at 1 so we can check if codeType set or not scfFunctionZipFileCode + scfFunctionImageCode ) var codeType scfFunctionCodeType @@ -496,6 +541,34 @@ func resourceTencentCloudScfFunctionCreate(d *schema.ResourceData, m interface{} functionInfo.zipFile = &content } + var imageConfigs = make([]*scf.ImageConfig, 0) + + if raw, ok := d.GetOk("image_config"); ok { + configs := raw.([]interface{}) + for _, v := range configs { + value := v.(map[string]interface{}) + imageType := value["image_type"].(string) + imageUri := value["image_uri"].(string) + registryId := value["registry_id"].(string) + entryPoint := value["entry_point"].(string) + command := value["command"].(string) + args := value["args"].(string) + + config := &scf.ImageConfig{ + ImageType : &imageType, + ImageUri: &imageUri, + RegistryId: ®istryId, + EntryPoint: &entryPoint, + Command: &command, + Args: &args, + } + imageConfigs = append(imageConfigs, config) + } + codeType = scfFunctionImageCode + } + + functionInfo.imageConfig = imageConfigs[0] + switch codeType { case scfFunctionCosCode: if err := helper.CheckIfSetTogether(d, "cos_bucket_name", "cos_object_name", "cos_bucket_region"); err != nil { @@ -503,7 +576,7 @@ func resourceTencentCloudScfFunctionCreate(d *schema.ResourceData, m interface{} } case scfFunctionZipFileCode: - + case scfFunctionImageCode: default: return errors.New("no function code set") } @@ -764,6 +837,34 @@ func resourceTencentCloudScfFunctionUpdate(d *schema.ResourceData, m interface{} functionInfo.zipFile = &content } + if d.HasChange("image_config") { + updateAttrs = append(updateAttrs, "image_config") + if raw, ok := d.GetOk("image_config"); ok { + var imageConfigs = make([]*scf.ImageConfig, 0) + configs := raw.([]interface{}) + for _, v := range configs { + value := v.(map[string]interface{}) + imageType := value["image_type"].(string) + imageUri := value["image_uri"].(string) + registryId := value["registry_id"].(string) + entryPoint := value["entry_point"].(string) + command := value["command"].(string) + args := value["args"].(string) + + config := &scf.ImageConfig{ + ImageType : &imageType, + ImageUri: &imageUri, + RegistryId: ®istryId, + EntryPoint: &entryPoint, + Command: &command, + Args: &args, + } + imageConfigs = append(imageConfigs, config) + } + functionInfo.imageConfig = imageConfigs[0] + } + } + // update function code if len(updateAttrs) > 0 { if len(updateAttrs) == 0 && updateAttrs[0] == "handler" { diff --git a/tencentcloud/service_tencentcloud_scf.go b/tencentcloud/service_tencentcloud_scf.go index cd04d19a6c..2ac6ff82d2 100644 --- a/tencentcloud/service_tencentcloud_scf.go +++ b/tencentcloud/service_tencentcloud_scf.go @@ -35,6 +35,8 @@ type scfFunctionInfo struct { cosBucketRegion *string zipFile *string + + imageConfig *scf.ImageConfig } type scfTrigger struct { @@ -86,6 +88,7 @@ func (me *ScfService) CreateFunction(ctx context.Context, info scfFunctionInfo) CosObjectName: info.cosObjectName, CosBucketRegion: info.cosBucketRegion, ZipFile: info.zipFile, + ImageConfig: info.imageConfig, } if err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { @@ -194,6 +197,7 @@ func (me *ScfService) ModifyFunctionCode(ctx context.Context, info scfFunctionIn CosObjectName: info.cosObjectName, CosBucketRegion: info.cosBucketRegion, ZipFile: info.zipFile, + ImageConfig: info.imageConfig, } if err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/client.go index 3fbe5425dc..e66525a7de 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/client.go @@ -34,7 +34,7 @@ func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, return } -func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { +func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { client = &Client{} client.Init(region). WithCredential(credential). @@ -182,8 +182,8 @@ func NewCreateFunctionResponse() (response *CreateFunctionResponse) { // INVALIDPARAMETER_PAYLOAD = "InvalidParameter.Payload" // INVALIDPARAMETERVALUE = "InvalidParameterValue" // INVALIDPARAMETERVALUE_ACTION = "InvalidParameterValue.Action" +// INVALIDPARAMETERVALUE_CFSPARAMETERDUPLICATE = "InvalidParameterValue.CfsParameterDuplicate" // INVALIDPARAMETERVALUE_CFSPARAMETERERROR = "InvalidParameterValue.CfsParameterError" -// INVALIDPARAMETERVALUE_CFSSTRUCTIONERROR = "InvalidParameterValue.CfsStructionError" // INVALIDPARAMETERVALUE_CLS = "InvalidParameterValue.Cls" // INVALIDPARAMETERVALUE_CODE = "InvalidParameterValue.Code" // INVALIDPARAMETERVALUE_CODESECRET = "InvalidParameterValue.CodeSecret" @@ -202,17 +202,21 @@ func NewCreateFunctionResponse() (response *CreateFunctionResponse) { // INVALIDPARAMETERVALUE_GITCOMMITID = "InvalidParameterValue.GitCommitId" // INVALIDPARAMETERVALUE_GITURL = "InvalidParameterValue.GitUrl" // INVALIDPARAMETERVALUE_HANDLER = "InvalidParameterValue.Handler" +// INVALIDPARAMETERVALUE_IDLETIMEOUT = "InvalidParameterValue.IdleTimeOut" // INVALIDPARAMETERVALUE_LAYERS = "InvalidParameterValue.Layers" // INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" // INVALIDPARAMETERVALUE_MEMORY = "InvalidParameterValue.Memory" // INVALIDPARAMETERVALUE_MEMORYSIZE = "InvalidParameterValue.MemorySize" // INVALIDPARAMETERVALUE_NAMESPACE = "InvalidParameterValue.Namespace" +// INVALIDPARAMETERVALUE_PROTOCOLTYPE = "InvalidParameterValue.ProtocolType" // INVALIDPARAMETERVALUE_PUBLICNETCONFIG = "InvalidParameterValue.PublicNetConfig" // INVALIDPARAMETERVALUE_RUNTIME = "InvalidParameterValue.Runtime" // INVALIDPARAMETERVALUE_STAMP = "InvalidParameterValue.Stamp" // INVALIDPARAMETERVALUE_TEMPCOSOBJECTNAME = "InvalidParameterValue.TempCosObjectName" +// INVALIDPARAMETERVALUE_TRACEENABLE = "InvalidParameterValue.TraceEnable" // INVALIDPARAMETERVALUE_TYPE = "InvalidParameterValue.Type" // INVALIDPARAMETERVALUE_VPCNOTSETWHENOPENCFS = "InvalidParameterValue.VpcNotSetWhenOpenCfs" +// INVALIDPARAMETERVALUE_WEBSOCKETSPARAMS = "InvalidParameterValue.WebSocketsParams" // INVALIDPARAMETERVALUE_ZIPFILE = "InvalidParameterValue.ZipFile" // INVALIDPARAMETERVALUE_ZIPFILEBASE64BINASCIIERROR = "InvalidParameterValue.ZipFileBase64BinasciiError" // LIMITEXCEEDED_EIP = "LimitExceeded.Eip" @@ -226,6 +230,7 @@ func NewCreateFunctionResponse() (response *CreateFunctionResponse) { // RESOURCEINUSE_FUNCTION = "ResourceInUse.Function" // RESOURCEINUSE_FUNCTIONNAME = "ResourceInUse.FunctionName" // RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCENOTFOUND_CFSMOUNTINSNOTMATCH = "ResourceNotFound.CfsMountInsNotMatch" // RESOURCENOTFOUND_CFSVPCNOTMATCH = "ResourceNotFound.CfsVpcNotMatch" // RESOURCENOTFOUND_CMQ = "ResourceNotFound.Cmq" // RESOURCENOTFOUND_DEMO = "ResourceNotFound.Demo" @@ -328,6 +333,7 @@ func NewCreateTriggerResponse() (response *CreateTriggerResponse) { // INVALIDPARAMETERVALUE_CUSTOMARGUMENT = "InvalidParameterValue.CustomArgument" // INVALIDPARAMETERVALUE_ENABLE = "InvalidParameterValue.Enable" // INVALIDPARAMETERVALUE_FUNCTIONNAME = "InvalidParameterValue.FunctionName" +// INVALIDPARAMETERVALUE_SECRETINFO = "InvalidParameterValue.SecretInfo" // INVALIDPARAMETERVALUE_SERVICENAME = "InvalidParameterValue.ServiceName" // INVALIDPARAMETERVALUE_TRIGGERDESC = "InvalidParameterValue.TriggerDesc" // INVALIDPARAMETERVALUE_TRIGGERNAME = "InvalidParameterValue.TriggerName" @@ -390,6 +396,8 @@ func NewDeleteAliasResponse() (response *DeleteAliasResponse) { // 可能返回的错误码: // FAILEDOPERATION_DELETEALIAS = "FailedOperation.DeleteAlias" // INTERNALERROR_SYSTEM = "InternalError.System" +// INVALIDPARAMETERVALUE_ALIAS = "InvalidParameterValue.Alias" +// INVALIDPARAMETERVALUE_NAME = "InvalidParameterValue.Name" // RESOURCENOTFOUND_ALIAS = "ResourceNotFound.Alias" // RESOURCENOTFOUND_FUNCTION = "ResourceNotFound.Function" // RESOURCENOTFOUND_FUNCTIONNAME = "ResourceNotFound.FunctionName" @@ -544,10 +552,12 @@ func NewDeleteProvisionedConcurrencyConfigResponse() (response *DeleteProvisione // 可能返回的错误码: // FAILEDOPERATION_PROVISIONEDINPROGRESS = "FailedOperation.ProvisionedInProgress" // INTERNALERROR = "InternalError" +// INVALIDPARAMETERVALUE_FUNCTIONNAME = "InvalidParameterValue.FunctionName" // INVALIDPARAMETERVALUE_QUALIFIER = "InvalidParameterValue.Qualifier" // RESOURCENOTFOUND_FUNCTION = "ResourceNotFound.Function" // RESOURCENOTFOUND_FUNCTIONVERSION = "ResourceNotFound.FunctionVersion" // RESOURCENOTFOUND_NAMESPACE = "ResourceNotFound.Namespace" +// RESOURCENOTFOUND_VERSION = "ResourceNotFound.Version" // UNAUTHORIZEDOPERATION = "UnauthorizedOperation" func (c *Client) DeleteProvisionedConcurrencyConfig(request *DeleteProvisionedConcurrencyConfigRequest) (response *DeleteProvisionedConcurrencyConfigResponse, err error) { if request == nil { @@ -574,7 +584,7 @@ func NewDeleteReservedConcurrencyConfigResponse() (response *DeleteReservedConcu } // DeleteReservedConcurrencyConfig -// 删除函数的保留并发配置。 +// 删除函数的最大独占配额配置。 // // 可能返回的错误码: // FAILEDOPERATION_DEBUGMODESTATUS = "FailedOperation.DebugModeStatus" @@ -869,6 +879,7 @@ func NewGetFunctionLogsResponse() (response *GetFunctionLogsResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_TOPICNOTEXIST = "FailedOperation.TopicNotExist" // INTERNALERROR = "InternalError" // INTERNALERROR_ES = "InternalError.ES" // INTERNALERROR_EXCEPTION = "InternalError.Exception" @@ -879,6 +890,7 @@ func NewGetFunctionLogsResponse() (response *GetFunctionLogsResponse) { // INVALIDPARAMETERVALUE_OFFSET = "InvalidParameterValue.Offset" // INVALIDPARAMETERVALUE_ORDER = "InvalidParameterValue.Order" // INVALIDPARAMETERVALUE_ORDERBY = "InvalidParameterValue.OrderBy" +// INVALIDPARAMETERVALUE_RETCODE = "InvalidParameterValue.RetCode" // INVALIDPARAMETERVALUE_STARTTIMEORENDTIME = "InvalidParameterValue.StartTimeOrEndTime" // LIMITEXCEEDED_OFFSET = "LimitExceeded.Offset" // RESOURCENOTFOUND_FUNCTION = "ResourceNotFound.Function" @@ -978,7 +990,7 @@ func NewGetReservedConcurrencyConfigResponse() (response *GetReservedConcurrency } // GetReservedConcurrencyConfig -// 获取函数的保留并发详情。 +// 获取函数的最大独占配额详情。 // // 可能返回的错误码: // INTERNALERROR = "InternalError" @@ -1037,6 +1049,46 @@ func (c *Client) Invoke(request *InvokeRequest) (response *InvokeResponse, err e return } +func NewInvokeFunctionRequest() (request *InvokeFunctionRequest) { + request = &InvokeFunctionRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("scf", APIVersion, "InvokeFunction") + return +} + +func NewInvokeFunctionResponse() (response *InvokeFunctionResponse) { + response = &InvokeFunctionResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// InvokeFunction +// SCF同步调用函数接口 +// +// 可能返回的错误码: +// FAILEDOPERATION_FUNCTIONSTATUSERROR = "FailedOperation.FunctionStatusError" +// FAILEDOPERATION_INVOKEFUNCTION = "FailedOperation.InvokeFunction" +// INTERNALERROR = "InternalError" +// INTERNALERROR_SYSTEM = "InternalError.System" +// INVALIDPARAMETER_FUNCTIONNAME = "InvalidParameter.FunctionName" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_PARAM = "InvalidParameterValue.Param" +// RESOURCENOTFOUND_FUNCTION = "ResourceNotFound.Function" +// RESOURCENOTFOUND_FUNCTIONNAME = "ResourceNotFound.FunctionName" +// RESOURCENOTFOUND_QUALIFIER = "ResourceNotFound.Qualifier" +// RESOURCEUNAVAILABLE_INSUFFICIENTBALANCE = "ResourceUnavailable.InsufficientBalance" +// UNAUTHORIZEDOPERATION_CAM = "UnauthorizedOperation.CAM" +func (c *Client) InvokeFunction(request *InvokeFunctionRequest) (response *InvokeFunctionResponse, err error) { + if request == nil { + request = NewInvokeFunctionRequest() + } + response = NewInvokeFunctionResponse() + err = c.Send(request, response) + return +} + func NewListAliasesRequest() (request *ListAliasesRequest) { request = &ListAliasesRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -1091,8 +1143,10 @@ func NewListAsyncEventsResponse() (response *ListAsyncEventsResponse) { // 拉取函数异步事件列表 // // 可能返回的错误码: +// INVALIDPARAMETERVALUE_FUNCTIONNAME = "InvalidParameterValue.FunctionName" // INVALIDPARAMETERVALUE_INVOKETYPE = "InvalidParameterValue.InvokeType" // INVALIDPARAMETERVALUE_LIMIT = "InvalidParameterValue.Limit" +// INVALIDPARAMETERVALUE_NAMESPACE = "InvalidParameterValue.Namespace" // INVALIDPARAMETERVALUE_ORDER = "InvalidParameterValue.Order" // INVALIDPARAMETERVALUE_STATUS = "InvalidParameterValue.Status" // RESOURCENOTFOUND_FUNCTION = "ResourceNotFound.Function" @@ -1131,6 +1185,7 @@ func NewListFunctionsResponse() (response *ListFunctionsResponse) { // INVALIDPARAMETER_PAYLOAD = "InvalidParameter.Payload" // INVALIDPARAMETERVALUE = "InvalidParameterValue" // INVALIDPARAMETERVALUE_LIMIT = "InvalidParameterValue.Limit" +// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" // INVALIDPARAMETERVALUE_NAMESPACE = "InvalidParameterValue.Namespace" // INVALIDPARAMETERVALUE_OFFSET = "InvalidParameterValue.Offset" // INVALIDPARAMETERVALUE_ORDER = "InvalidParameterValue.Order" @@ -1267,6 +1322,7 @@ func NewListTriggersResponse() (response *ListTriggersResponse) { // FAILEDOPERATION_APIGW = "FailedOperation.Apigw" // INVALIDPARAMETERVALUE_FILTERS = "InvalidParameterValue.Filters" // INVALIDPARAMETERVALUE_ORDER = "InvalidParameterValue.Order" +// INVALIDPARAMETERVALUE_ORDERBY = "InvalidParameterValue.OrderBy" func (c *Client) ListTriggers(request *ListTriggersRequest) (response *ListTriggersResponse, err error) { if request == nil { request = NewListTriggersRequest() @@ -1348,6 +1404,7 @@ func NewPublishLayerVersionResponse() (response *PublishLayerVersionResponse) { // INVALIDPARAMETERVALUE_RUNTIME = "InvalidParameterValue.Runtime" // INVALIDPARAMETERVALUE_STAMP = "InvalidParameterValue.Stamp" // INVALIDPARAMETERVALUE_TEMPCOSOBJECTNAME = "InvalidParameterValue.TempCosObjectName" +// INVALIDPARAMETERVALUE_ZIPFILEBASE64BINASCIIERROR = "InvalidParameterValue.ZipFileBase64BinasciiError" // LIMITEXCEEDED_LAYERVERSIONS = "LimitExceeded.LayerVersions" // RESOURCEINUSE = "ResourceInUse" // UNAUTHORIZEDOPERATION_CAM = "UnauthorizedOperation.CAM" @@ -1465,7 +1522,7 @@ func NewPutReservedConcurrencyConfigResponse() (response *PutReservedConcurrency } // PutReservedConcurrencyConfig -// 设置函数保留并发 +// 设置函数最大独占配额 // // 可能返回的错误码: // FAILEDOPERATION_DEBUGMODESTATUS = "FailedOperation.DebugModeStatus" @@ -1684,13 +1741,16 @@ func NewUpdateFunctionConfigurationResponse() (response *UpdateFunctionConfigura // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_DEBUGMODEUPDATETIMEOUTFAIL = "FailedOperation.DebugModeUpdateTimeOutFail" -// FAILEDOPERATION_QCSROLENOTFOUND = "FailedOperation.QcsRoleNotFound" // FAILEDOPERATION_RESERVEDINPROGRESS = "FailedOperation.ReservedInProgress" // FAILEDOPERATION_UPDATEFUNCTIONCONFIGURATION = "FailedOperation.UpdateFunctionConfiguration" // INTERNALERROR_SYSTEM = "InternalError.System" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" // INVALIDPARAMETER_PAYLOAD = "InvalidParameter.Payload" // INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_CFSPARAMETERDUPLICATE = "InvalidParameterValue.CfsParameterDuplicate" +// INVALIDPARAMETERVALUE_CFSPARAMETERERROR = "InvalidParameterValue.CfsParameterError" // INVALIDPARAMETERVALUE_CLS = "InvalidParameterValue.Cls" +// INVALIDPARAMETERVALUE_CLSROLE = "InvalidParameterValue.ClsRole" // INVALIDPARAMETERVALUE_DESCRIPTION = "InvalidParameterValue.Description" // INVALIDPARAMETERVALUE_EIPCONFIG = "InvalidParameterValue.EipConfig" // INVALIDPARAMETERVALUE_ENVIRONMENT = "InvalidParameterValue.Environment" @@ -1698,6 +1758,7 @@ func NewUpdateFunctionConfigurationResponse() (response *UpdateFunctionConfigura // INVALIDPARAMETERVALUE_ENVIRONMENTSYSTEMPROTECT = "InvalidParameterValue.EnvironmentSystemProtect" // INVALIDPARAMETERVALUE_FUNCTIONNAME = "InvalidParameterValue.FunctionName" // INVALIDPARAMETERVALUE_HANDLER = "InvalidParameterValue.Handler" +// INVALIDPARAMETERVALUE_IDLETIMEOUT = "InvalidParameterValue.IdleTimeOut" // INVALIDPARAMETERVALUE_LAYERS = "InvalidParameterValue.Layers" // INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" // INVALIDPARAMETERVALUE_MEMORY = "InvalidParameterValue.Memory" @@ -1706,6 +1767,8 @@ func NewUpdateFunctionConfigurationResponse() (response *UpdateFunctionConfigura // INVALIDPARAMETERVALUE_PUBLICNETCONFIG = "InvalidParameterValue.PublicNetConfig" // INVALIDPARAMETERVALUE_RUNTIME = "InvalidParameterValue.Runtime" // INVALIDPARAMETERVALUE_SYSTEMENVIRONMENT = "InvalidParameterValue.SystemEnvironment" +// INVALIDPARAMETERVALUE_TRACEENABLE = "InvalidParameterValue.TraceEnable" +// INVALIDPARAMETERVALUE_WEBSOCKETSPARAMS = "InvalidParameterValue.WebSocketsParams" // LIMITEXCEEDED_EIP = "LimitExceeded.Eip" // LIMITEXCEEDED_INITTIMEOUT = "LimitExceeded.InitTimeout" // LIMITEXCEEDED_MEMORY = "LimitExceeded.Memory" diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/errors.go index 26c4aff73c..ac3718d5e8 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/errors.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/errors.go @@ -116,6 +116,9 @@ const ( // 当前函数已有保留并发设置任务处于进行中,请稍后重试。 FAILEDOPERATION_RESERVEDINPROGRESS = "FailedOperation.ReservedInProgress" + // Topic不存在。 + FAILEDOPERATION_TOPICNOTEXIST = "FailedOperation.TopicNotExist" + // 用户并发内存配额设置任务处于进行中,请稍后重试。 FAILEDOPERATION_TOTALCONCURRENCYMEMORYINPROGRESS = "FailedOperation.TotalConcurrencyMemoryInProgress" @@ -179,6 +182,9 @@ const ( // AdditionalVersionWeights参数传入错误。 INVALIDPARAMETERVALUE_ADDITIONALVERSIONWEIGHTS = "InvalidParameterValue.AdditionalVersionWeights" + // 不支持删除默认别名,请修正后重试。 + INVALIDPARAMETERVALUE_ALIAS = "InvalidParameterValue.Alias" + // ApiGateway参数错误。 INVALIDPARAMETERVALUE_APIGATEWAY = "InvalidParameterValue.ApiGateway" @@ -188,18 +194,21 @@ const ( // Cdn传入错误。 INVALIDPARAMETERVALUE_CDN = "InvalidParameterValue.Cdn" + // cfs配置项重复。 + INVALIDPARAMETERVALUE_CFSPARAMETERDUPLICATE = "InvalidParameterValue.CfsParameterDuplicate" + // cfs配置项取值与规范不符。 INVALIDPARAMETERVALUE_CFSPARAMETERERROR = "InvalidParameterValue.CfsParameterError" - // cfs参数格式与规范不符。 - INVALIDPARAMETERVALUE_CFSSTRUCTIONERROR = "InvalidParameterValue.CfsStructionError" - // Ckafka传入错误。 INVALIDPARAMETERVALUE_CKAFKA = "InvalidParameterValue.Ckafka" // Cls传入错误。 INVALIDPARAMETERVALUE_CLS = "InvalidParameterValue.Cls" + // 修改Cls配置需要传入Role参数,请修正后重试。 + INVALIDPARAMETERVALUE_CLSROLE = "InvalidParameterValue.ClsRole" + // Cmq传入错误。 INVALIDPARAMETERVALUE_CMQ = "InvalidParameterValue.Cmq" @@ -287,6 +296,9 @@ const ( // Handler传入错误。 INVALIDPARAMETERVALUE_HANDLER = "InvalidParameterValue.Handler" + // IdleTimeOut参数传入错误。 + INVALIDPARAMETERVALUE_IDLETIMEOUT = "InvalidParameterValue.IdleTimeOut" + // InlineZipFile非法。 INVALIDPARAMETERVALUE_INLINEZIPFILE = "InvalidParameterValue.InlineZipFile" @@ -332,12 +344,18 @@ const ( // 入参不是标准的json。 INVALIDPARAMETERVALUE_PARAM = "InvalidParameterValue.Param" + // ProtocolType参数传入错误。 + INVALIDPARAMETERVALUE_PROTOCOLTYPE = "InvalidParameterValue.ProtocolType" + // PublicNetConfig参数错误。 INVALIDPARAMETERVALUE_PUBLICNETCONFIG = "InvalidParameterValue.PublicNetConfig" // 不支持的函数版本。 INVALIDPARAMETERVALUE_QUALIFIER = "InvalidParameterValue.Qualifier" + // RetCode不合法。 + INVALIDPARAMETERVALUE_RETCODE = "InvalidParameterValue.RetCode" + // RoutingConfig取值与规范不符,请修正后再试。可参考:https://tencentcs.com/5jXKFnBW。 INVALIDPARAMETERVALUE_ROUTINGCONFIG = "InvalidParameterValue.RoutingConfig" @@ -347,6 +365,9 @@ const ( // searchkey 不是 Keyword,Tag 或者 Runtime。 INVALIDPARAMETERVALUE_SEARCHKEY = "InvalidParameterValue.SearchKey" + // SecretInfo错误。 + INVALIDPARAMETERVALUE_SECRETINFO = "InvalidParameterValue.SecretInfo" + // ServiceName命名不规范。 INVALIDPARAMETERVALUE_SERVICENAME = "InvalidParameterValue.ServiceName" @@ -365,6 +386,9 @@ const ( // 非法的TempCosObjectName。 INVALIDPARAMETERVALUE_TEMPCOSOBJECTNAME = "InvalidParameterValue.TempCosObjectName" + // TraceEnable取值与规范不符,请修正后再试。 + INVALIDPARAMETERVALUE_TRACEENABLE = "InvalidParameterValue.TraceEnable" + // TriggerDesc传入参数错误。 INVALIDPARAMETERVALUE_TRIGGERDESC = "InvalidParameterValue.TriggerDesc" @@ -377,6 +401,9 @@ const ( // 开启cfs配置的同时必须开启vpc。 INVALIDPARAMETERVALUE_VPCNOTSETWHENOPENCFS = "InvalidParameterValue.VpcNotSetWhenOpenCfs" + // WebSocketsParams参数传入错误。 + INVALIDPARAMETERVALUE_WEBSOCKETSPARAMS = "InvalidParameterValue.WebSocketsParams" + // 检测到不是标准的zip文件,请重新压缩后再试。 INVALIDPARAMETERVALUE_ZIPFILE = "InvalidParameterValue.ZipFile" @@ -503,6 +530,9 @@ const ( // Cdn不存在。 RESOURCENOTFOUND_CDN = "ResourceNotFound.Cdn" + // 指定的cfs下未找到您所指定的挂载点。 + RESOURCENOTFOUND_CFSMOUNTINSNOTMATCH = "ResourceNotFound.CfsMountInsNotMatch" + // cfs与云函数所处vpc不一致。 RESOURCENOTFOUND_CFSVPCNOTMATCH = "ResourceNotFound.CfsVpcNotMatch" diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/models.go index 5682c62c17..0f0b7b2635 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416/models.go @@ -65,7 +65,7 @@ type AsyncEvent struct { // 函数版本 Qualifier *string `json:"Qualifier,omitempty" name:"Qualifier"` - // 事件状态 + // 事件状态,RUNNING 表示运行中, FINISHED 表示调用成功, ABORTED 表示调用终止, FAILED 表示调用失败 Status *string `json:"Status,omitempty" name:"Status"` // 调用开始时间,格式: "%Y-%m-%d %H:%M:%S.%f" @@ -131,7 +131,7 @@ type Code struct { // 对象存储桶名称(填写存储桶名称自定义部分,不包含-appid) CosBucketName *string `json:"CosBucketName,omitempty" name:"CosBucketName"` - // 对象存储对象路径 + // 对象存储中代码包文件路径,以/开头 CosObjectName *string `json:"CosObjectName,omitempty" name:"CosObjectName"` // 包含函数代码文件及其依赖项的 zip 格式文件,zip包大小上限为 50MB,使用该接口时要求将 zip 文件的内容转成 base64 编码 @@ -169,6 +169,9 @@ type Code struct { // 加密后的Git用户名,一般无需指定 GitUserNameSecret *string `json:"GitUserNameSecret,omitempty" name:"GitUserNameSecret"` + + // 镜像部署时配置TCR镜像信息 + ImageConfig *ImageConfig `json:"ImageConfig,omitempty" name:"ImageConfig"` } type CopyFunctionRequest struct { @@ -376,7 +379,7 @@ type CreateFunctionRequest struct { // 文件系统配置参数,用于云函数挂载文件系统 CfsConfig *CfsConfig `json:"CfsConfig,omitempty" name:"CfsConfig"` - // 函数初始化超时时间 + // 函数初始化超时时间,默认 65s,镜像部署函数默认 90s。 InitTimeout *int64 `json:"InitTimeout,omitempty" name:"InitTimeout"` // 函数 Tag 参数,以键值对数组形式传入 @@ -509,7 +512,7 @@ type CreateTriggerRequest struct { // 新建触发器名称。如果是定时触发器,名称支持英文字母、数字、连接符和下划线,最长100个字符;如果是cos触发器,需要是对应cos存储桶适用于XML API的访问域名(例如:5401-5ff414-12345.cos.ap-shanghai.myqcloud.com);如果是其他触发器,见具体触发器绑定参数的说明 TriggerName *string `json:"TriggerName,omitempty" name:"TriggerName"` - // 触发器类型,目前支持 cos 、cmq、 timer、 ckafka、apigw类型 + // 触发器类型,目前支持 cos 、cmq、 timer、 ckafka、apigw类型。创建 cls 触发器请参考[CLS 创建投递 SCF 任务](https://cloud.tencent.com/document/product/614/61096)。 Type *string `json:"Type,omitempty" name:"Type"` // 触发器对应的参数,可见具体[触发器描述说明](https://cloud.tencent.com/document/product/583/39901) @@ -850,7 +853,7 @@ func (r *DeleteProvisionedConcurrencyConfigResponse) FromJsonString(s string) er type DeleteReservedConcurrencyConfigRequest struct { *tchttp.BaseRequest - // 需要删除预置并发的函数的名称 + // 需要删除最大独占配额的函数的名称 FunctionName *string `json:"FunctionName,omitempty" name:"FunctionName"` // 函数所属命名空间,默认为default @@ -1048,6 +1051,12 @@ type Function struct { // 函数并发保留内存 // 注意:此字段可能返回 null,表示取不到有效值。 ReservedConcurrencyMem *uint64 `json:"ReservedConcurrencyMem,omitempty" name:"ReservedConcurrencyMem"` + + // 函数异步属性,取值 TRUE 或者 FALSE + AsyncRunEnable *string `json:"AsyncRunEnable,omitempty" name:"AsyncRunEnable"` + + // 异步函数是否开启调用追踪,取值 TRUE 或者 FALSE + TraceEnable *string `json:"TraceEnable,omitempty" name:"TraceEnable"` } type FunctionLog struct { @@ -1619,6 +1628,14 @@ type GetFunctionResponse struct { // 注意:此字段可能返回 null,表示取不到有效值。 StatusReasons []*StatusReason `json:"StatusReasons,omitempty" name:"StatusReasons"` + // 是否开启异步属性 + // 注意:此字段可能返回 null,表示取不到有效值。 + AsyncRunEnable *string `json:"AsyncRunEnable,omitempty" name:"AsyncRunEnable"` + + // 是否开启事件追踪 + // 注意:此字段可能返回 null,表示取不到有效值。 + TraceEnable *string `json:"TraceEnable,omitempty" name:"TraceEnable"` + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` @@ -1779,7 +1796,7 @@ func (r *GetProvisionedConcurrencyConfigResponse) FromJsonString(s string) error type GetReservedConcurrencyConfigRequest struct { *tchttp.BaseRequest - // 需要获取预置并发详情的函数名称。 + // 需要获取最大独占配额详情的函数名称。 FunctionName *string `json:"FunctionName,omitempty" name:"FunctionName"` // 函数所在的命名空间,默认为default。 @@ -1810,7 +1827,7 @@ type GetReservedConcurrencyConfigResponse struct { *tchttp.BaseResponse Response *struct { - // 该函数的保留并发内存。 + // 该函数的最大独占配额。 // 注意:此字段可能返回 null,表示取不到有效值。 ReservedMem *uint64 `json:"ReservedMem,omitempty" name:"ReservedMem"` @@ -1830,22 +1847,116 @@ func (r *GetReservedConcurrencyConfigResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type ImageConfig struct { + + // 镜像仓库类型,个人版或者企业版:personal/enterprise + ImageType *string `json:"ImageType,omitempty" name:"ImageType"` + + // {domain}/{namespace}/{imageName}:{tag}@{digest} + ImageUri *string `json:"ImageUri,omitempty" name:"ImageUri"` + + // 用于企业版TCR获取镜像拉取临时凭证,ImageType为"enterprise"时必填 + // 注意:此字段可能返回 null,表示取不到有效值。 + RegistryId *string `json:"RegistryId,omitempty" name:"RegistryId"` + + // 应用的ENTRYPOINT + // 注意:此字段可能返回 null,表示取不到有效值。 + EntryPoint *string `json:"EntryPoint,omitempty" name:"EntryPoint"` + + // entrypoint执行命令 + // 注意:此字段可能返回 null,表示取不到有效值。 + Command *string `json:"Command,omitempty" name:"Command"` + + // 命令参数 + // 注意:此字段可能返回 null,表示取不到有效值。 + Args *string `json:"Args,omitempty" name:"Args"` +} + +type InvokeFunctionRequest struct { + *tchttp.BaseRequest + + // 函数名称 + FunctionName *string `json:"FunctionName,omitempty" name:"FunctionName"` + + // 触发函数的版本号或别名,默认值为$DEFAULT + Qualifier *string `json:"Qualifier,omitempty" name:"Qualifier"` + + // 运行函数时的参数,以json格式传入,最大支持的参数长度是 6MB。该字段信息对应函数 [event 入参](https://cloud.tencent.com/document/product/583/9210#.E5.87.BD.E6.95.B0.E5.85.A5.E5.8F.82.3Ca-id.3D.22input.22.3E.3C.2Fa.3E)。 + Event *string `json:"Event,omitempty" name:"Event"` + + // 返回值会包含4KB的日志,可选值为None和Tail,默认值为None。当该值为Tail时,返回参数中的Log字段会包含对应的函数执行日志 + LogType *string `json:"LogType,omitempty" name:"LogType"` + + // 命名空间,不填默认为 default + Namespace *string `json:"Namespace,omitempty" name:"Namespace"` + + // 函数灰度流量控制调用,以json格式传入,例如{"k":"v"},注意kv都需要是字符串类型,最大支持的参数长度是1024字节 + RoutingKey *string `json:"RoutingKey,omitempty" name:"RoutingKey"` +} + +func (r *InvokeFunctionRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *InvokeFunctionRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "FunctionName") + delete(f, "Qualifier") + delete(f, "Event") + delete(f, "LogType") + delete(f, "Namespace") + delete(f, "RoutingKey") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InvokeFunctionRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type InvokeFunctionResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 函数执行结果 + Result *Result `json:"Result,omitempty" name:"Result"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *InvokeFunctionResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *InvokeFunctionResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type InvokeRequest struct { *tchttp.BaseRequest // 函数名称 FunctionName *string `json:"FunctionName,omitempty" name:"FunctionName"` - // RequestResponse(同步) 和 Event(异步),默认为同步 + // 同步调用请使用[同步 Invoke 调用接口](https://cloud.tencent.com/document/product/583/58400) 或填写同步调用参数 RequestResponse ,建议使用同步调用接口以获取最佳性能;异步调用填写 Event;默认为同步。接口超时时间为 300s,更长超时时间请使用异步调用。 InvocationType *string `json:"InvocationType,omitempty" name:"InvocationType"` // 触发函数的版本号或别名 Qualifier *string `json:"Qualifier,omitempty" name:"Qualifier"` - // 运行函数时的参数,以json格式传入,最大支持的参数长度是 1M + // 运行函数时的参数,以json格式传入,同步调用最大支持 6MB,异步调用最大支持 128 KB。该字段信息对应函数 [event 入参](https://cloud.tencent.com/document/product/583/9210#.E5.87.BD.E6.95.B0.E5.85.A5.E5.8F.82.3Ca-id.3D.22input.22.3E.3C.2Fa.3E)。 ClientContext *string `json:"ClientContext,omitempty" name:"ClientContext"` - // 同步调用时指定该字段,返回值会包含4K的日志,可选值为None和Tail,默认值为None。当该值为Tail时,返回参数中的Log字段会包含对应的函数执行日志 + // 异步调用该字段返回为空。 LogType *string `json:"LogType,omitempty" name:"LogType"` // 命名空间 @@ -2327,6 +2438,9 @@ type ListNamespacesRequest struct { // 以升序还是降序的方式返回结果,可选值 ASC 和 DESC Order *string `json:"Order,omitempty" name:"Order"` + + // 关键字匹配搜索,Key 可选值为 Namespace 和 Description,多个搜索条件之间是与的关系 + SearchKey []*SearchKey `json:"SearchKey,omitempty" name:"SearchKey"` } func (r *ListNamespacesRequest) ToJsonString() string { @@ -2345,6 +2459,7 @@ func (r *ListNamespacesRequest) FromJsonString(s string) error { delete(f, "Offset") delete(f, "Orderby") delete(f, "Order") + delete(f, "SearchKey") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ListNamespacesRequest has unknown keys!", "") } @@ -2844,10 +2959,10 @@ func (r *PutProvisionedConcurrencyConfigResponse) FromJsonString(s string) error type PutReservedConcurrencyConfigRequest struct { *tchttp.BaseRequest - // 需要设置预置并发的函数的名称 + // 需要设置最大独占配额的函数的名称 FunctionName *string `json:"FunctionName,omitempty" name:"FunctionName"` - // 函数保留并发内存,注:函数的保留并发内存总和上限:用户总并发内存配额 - 12800 + // 函数最大独占配额,注:函数的最大独占配额内存总和上限:用户总并发内存配额 - 12800 ReservedConcurrencyMem *uint64 `json:"ReservedConcurrencyMem,omitempty" name:"ReservedConcurrencyMem"` // 函数所属命名空间,默认为default @@ -2987,6 +3102,15 @@ type RoutingConfig struct { AddtionVersionMatchs []*VersionMatch `json:"AddtionVersionMatchs,omitempty" name:"AddtionVersionMatchs"` } +type SearchKey struct { + + // 搜索关键字 + Key *string `json:"Key,omitempty" name:"Key"` + + // 搜索内容 + Value *string `json:"Value,omitempty" name:"Value"` +} + type StatusReason struct { // 错误码 @@ -3389,7 +3513,7 @@ type UpdateFunctionConfigurationRequest struct { // 文件系统配置入参,用于云函数绑定CFS文件系统 CfsConfig *CfsConfig `json:"CfsConfig,omitempty" name:"CfsConfig"` - // 函数初始化执行超时时间,默认15秒 + // 函数初始化执行超时时间 InitTimeout *int64 `json:"InitTimeout,omitempty" name:"InitTimeout"` } diff --git a/vendor/modules.txt b/vendor/modules.txt index 54b61a1c95..f081542e7c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -577,7 +577,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor/v20180724 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/postgres/v20170312 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis/v20180412 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.199 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.267 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver/v20180328 diff --git a/website/docs/r/scf_function.html.markdown b/website/docs/r/scf_function.html.markdown index 3cc34f356f..e5d65e08a0 100644 --- a/website/docs/r/scf_function.html.markdown +++ b/website/docs/r/scf_function.html.markdown @@ -41,6 +41,7 @@ The following arguments are supported: * `enable_eip_config` - (Optional) Indicates whether EIP config set to `ENABLE` when `enable_public_net` was true. * `enable_public_net` - (Optional) Indicates whether public net config enabled. * `environment` - (Optional) Environment of the SCF function. +* `image_config` - (Optional) Image of the SCF function, conflict with ``. * `l5_enable` - (Optional) Enable L5 for SCF function, default is `false`. * `mem_size` - (Optional) Memory size of the SCF function, unit is MB. The default is `128`MB. The range is 128M-1536M, and the ladder is 128M. * `namespace` - (Optional, ForceNew) Namespace of the SCF function, default is `default`. @@ -52,6 +53,15 @@ The following arguments are supported: * `vpc_id` - (Optional) VPC ID of the SCF function. * `zip_file` - (Optional) Zip file of the SCF function, conflict with `cos_bucket_name`, `cos_object_name`, `cos_bucket_region`. +The `image_config` object supports the following: + +* `image_type` - (Required) The image type. personal or enterprise. +* `image_uri` - (Required) The uri of image. +* `args` - (Optional) the parameters of command. +* `command` - (Optional) The command of entrypoint. +* `entry_point` - (Optional) The entrypoint of app. +* `registry_id` - (Optional) The registry id of TCR. When image type is enterprise, it must be set. + The `triggers` object supports the following: * `name` - (Required) Name of the SCF function trigger, if `type` is `ckafka`, the format of name must be `-`; if `type` is `cos`, the name is cos bucket id, other In any case, it can be combined arbitrarily. It can only contain English letters, numbers, connectors and underscores. The maximum length is 100.