1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getScfLogs
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getScfLogs

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query SCF function logs.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const fooScfFunction = new tencentcloud.ScfFunction("fooScfFunction", {
        handler: "main.do_it",
        runtime: "Python3.6",
        cosBucketName: "scf-code-1234567890",
        cosObjectName: "code.zip",
        cosBucketRegion: "ap-guangzhou",
    });
    const fooScfLogs = tencentcloud.getScfLogsOutput({
        functionName: fooScfFunction.name,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo_scf_function = tencentcloud.ScfFunction("fooScfFunction",
        handler="main.do_it",
        runtime="Python3.6",
        cos_bucket_name="scf-code-1234567890",
        cos_object_name="code.zip",
        cos_bucket_region="ap-guangzhou")
    foo_scf_logs = tencentcloud.get_scf_logs_output(function_name=foo_scf_function.name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooScfFunction, err := tencentcloud.NewScfFunction(ctx, "fooScfFunction", &tencentcloud.ScfFunctionArgs{
    			Handler:         pulumi.String("main.do_it"),
    			Runtime:         pulumi.String("Python3.6"),
    			CosBucketName:   pulumi.String("scf-code-1234567890"),
    			CosObjectName:   pulumi.String("code.zip"),
    			CosBucketRegion: pulumi.String("ap-guangzhou"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = tencentcloud.GetScfLogsOutput(ctx, tencentcloud.GetScfLogsOutputArgs{
    			FunctionName: fooScfFunction.Name,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var fooScfFunction = new Tencentcloud.ScfFunction("fooScfFunction", new()
        {
            Handler = "main.do_it",
            Runtime = "Python3.6",
            CosBucketName = "scf-code-1234567890",
            CosObjectName = "code.zip",
            CosBucketRegion = "ap-guangzhou",
        });
    
        var fooScfLogs = Tencentcloud.GetScfLogs.Invoke(new()
        {
            FunctionName = fooScfFunction.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ScfFunction;
    import com.pulumi.tencentcloud.ScfFunctionArgs;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetScfLogsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var fooScfFunction = new ScfFunction("fooScfFunction", ScfFunctionArgs.builder()
                .handler("main.do_it")
                .runtime("Python3.6")
                .cosBucketName("scf-code-1234567890")
                .cosObjectName("code.zip")
                .cosBucketRegion("ap-guangzhou")
                .build());
    
            final var fooScfLogs = TencentcloudFunctions.getScfLogs(GetScfLogsArgs.builder()
                .functionName(fooScfFunction.name())
                .build());
    
        }
    }
    
    resources:
      fooScfFunction:
        type: tencentcloud:ScfFunction
        properties:
          handler: main.do_it
          runtime: Python3.6
          cosBucketName: scf-code-1234567890
          cosObjectName: code.zip
          cosBucketRegion: ap-guangzhou
    variables:
      fooScfLogs:
        fn::invoke:
          function: tencentcloud:getScfLogs
          arguments:
            functionName: ${fooScfFunction.name}
    

    Using getScfLogs

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getScfLogs(args: GetScfLogsArgs, opts?: InvokeOptions): Promise<GetScfLogsResult>
    function getScfLogsOutput(args: GetScfLogsOutputArgs, opts?: InvokeOptions): Output<GetScfLogsResult>
    def get_scf_logs(end_time: Optional[str] = None,
                     function_name: Optional[str] = None,
                     id: Optional[str] = None,
                     invoke_request_id: Optional[str] = None,
                     limit: Optional[float] = None,
                     namespace: Optional[str] = None,
                     offset: Optional[float] = None,
                     order: Optional[str] = None,
                     order_by: Optional[str] = None,
                     result_output_file: Optional[str] = None,
                     ret_code: Optional[str] = None,
                     start_time: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetScfLogsResult
    def get_scf_logs_output(end_time: Optional[pulumi.Input[str]] = None,
                     function_name: Optional[pulumi.Input[str]] = None,
                     id: Optional[pulumi.Input[str]] = None,
                     invoke_request_id: Optional[pulumi.Input[str]] = None,
                     limit: Optional[pulumi.Input[float]] = None,
                     namespace: Optional[pulumi.Input[str]] = None,
                     offset: Optional[pulumi.Input[float]] = None,
                     order: Optional[pulumi.Input[str]] = None,
                     order_by: Optional[pulumi.Input[str]] = None,
                     result_output_file: Optional[pulumi.Input[str]] = None,
                     ret_code: Optional[pulumi.Input[str]] = None,
                     start_time: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetScfLogsResult]
    func GetScfLogs(ctx *Context, args *GetScfLogsArgs, opts ...InvokeOption) (*GetScfLogsResult, error)
    func GetScfLogsOutput(ctx *Context, args *GetScfLogsOutputArgs, opts ...InvokeOption) GetScfLogsResultOutput

    > Note: This function is named GetScfLogs in the Go SDK.

    public static class GetScfLogs 
    {
        public static Task<GetScfLogsResult> InvokeAsync(GetScfLogsArgs args, InvokeOptions? opts = null)
        public static Output<GetScfLogsResult> Invoke(GetScfLogsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetScfLogsResult> getScfLogs(GetScfLogsArgs args, InvokeOptions options)
    public static Output<GetScfLogsResult> getScfLogs(GetScfLogsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getScfLogs:getScfLogs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    FunctionName string
    Name of the SCF function to be queried.
    EndTime string
    The end time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from start_time.
    Id string
    InvokeRequestId string
    Corresponding requestId when executing function.
    Limit double
    Number of logs, the default is 10000, offset+limit cannot be greater than 10000.
    Namespace string
    Namespace of the SCF function to be queried.
    Offset double
    Log offset, default is 0, offset+limit cannot be greater than 10000.
    Order string
    Order to sort the log, optional values desc and asc, default desc.
    OrderBy string
    Sort the logs according to the following fields: function_name, duration, mem_usage, start_time, default start_time.
    ResultOutputFile string
    Used to save results.
    RetCode string
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    StartTime string
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    FunctionName string
    Name of the SCF function to be queried.
    EndTime string
    The end time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from start_time.
    Id string
    InvokeRequestId string
    Corresponding requestId when executing function.
    Limit float64
    Number of logs, the default is 10000, offset+limit cannot be greater than 10000.
    Namespace string
    Namespace of the SCF function to be queried.
    Offset float64
    Log offset, default is 0, offset+limit cannot be greater than 10000.
    Order string
    Order to sort the log, optional values desc and asc, default desc.
    OrderBy string
    Sort the logs according to the following fields: function_name, duration, mem_usage, start_time, default start_time.
    ResultOutputFile string
    Used to save results.
    RetCode string
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    StartTime string
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    functionName String
    Name of the SCF function to be queried.
    endTime String
    The end time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from start_time.
    id String
    invokeRequestId String
    Corresponding requestId when executing function.
    limit Double
    Number of logs, the default is 10000, offset+limit cannot be greater than 10000.
    namespace String
    Namespace of the SCF function to be queried.
    offset Double
    Log offset, default is 0, offset+limit cannot be greater than 10000.
    order String
    Order to sort the log, optional values desc and asc, default desc.
    orderBy String
    Sort the logs according to the following fields: function_name, duration, mem_usage, start_time, default start_time.
    resultOutputFile String
    Used to save results.
    retCode String
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    startTime String
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    functionName string
    Name of the SCF function to be queried.
    endTime string
    The end time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from start_time.
    id string
    invokeRequestId string
    Corresponding requestId when executing function.
    limit number
    Number of logs, the default is 10000, offset+limit cannot be greater than 10000.
    namespace string
    Namespace of the SCF function to be queried.
    offset number
    Log offset, default is 0, offset+limit cannot be greater than 10000.
    order string
    Order to sort the log, optional values desc and asc, default desc.
    orderBy string
    Sort the logs according to the following fields: function_name, duration, mem_usage, start_time, default start_time.
    resultOutputFile string
    Used to save results.
    retCode string
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    startTime string
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    function_name str
    Name of the SCF function to be queried.
    end_time str
    The end time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from start_time.
    id str
    invoke_request_id str
    Corresponding requestId when executing function.
    limit float
    Number of logs, the default is 10000, offset+limit cannot be greater than 10000.
    namespace str
    Namespace of the SCF function to be queried.
    offset float
    Log offset, default is 0, offset+limit cannot be greater than 10000.
    order str
    Order to sort the log, optional values desc and asc, default desc.
    order_by str
    Sort the logs according to the following fields: function_name, duration, mem_usage, start_time, default start_time.
    result_output_file str
    Used to save results.
    ret_code str
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    start_time str
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    functionName String
    Name of the SCF function to be queried.
    endTime String
    The end time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from start_time.
    id String
    invokeRequestId String
    Corresponding requestId when executing function.
    limit Number
    Number of logs, the default is 10000, offset+limit cannot be greater than 10000.
    namespace String
    Namespace of the SCF function to be queried.
    offset Number
    Log offset, default is 0, offset+limit cannot be greater than 10000.
    order String
    Order to sort the log, optional values desc and asc, default desc.
    orderBy String
    Sort the logs according to the following fields: function_name, duration, mem_usage, start_time, default start_time.
    resultOutputFile String
    Used to save results.
    retCode String
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    startTime String
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.

    getScfLogs Result

    The following output properties are available:

    FunctionName string
    Name of the SCF function.
    Id string
    Logs List<GetScfLogsLog>
    An information list of logs. Each element contains the following attributes:
    EndTime string
    InvokeRequestId string
    Limit double
    Namespace string
    Offset double
    Order string
    OrderBy string
    ResultOutputFile string
    RetCode string
    Execution result of function, 0 means the execution is successful, other values indicate failure.
    StartTime string
    Point in time at which the function begins execution.
    FunctionName string
    Name of the SCF function.
    Id string
    Logs []GetScfLogsLog
    An information list of logs. Each element contains the following attributes:
    EndTime string
    InvokeRequestId string
    Limit float64
    Namespace string
    Offset float64
    Order string
    OrderBy string
    ResultOutputFile string
    RetCode string
    Execution result of function, 0 means the execution is successful, other values indicate failure.
    StartTime string
    Point in time at which the function begins execution.
    functionName String
    Name of the SCF function.
    id String
    logs List<GetScfLogsLog>
    An information list of logs. Each element contains the following attributes:
    endTime String
    invokeRequestId String
    limit Double
    namespace String
    offset Double
    order String
    orderBy String
    resultOutputFile String
    retCode String
    Execution result of function, 0 means the execution is successful, other values indicate failure.
    startTime String
    Point in time at which the function begins execution.
    functionName string
    Name of the SCF function.
    id string
    logs GetScfLogsLog[]
    An information list of logs. Each element contains the following attributes:
    endTime string
    invokeRequestId string
    limit number
    namespace string
    offset number
    order string
    orderBy string
    resultOutputFile string
    retCode string
    Execution result of function, 0 means the execution is successful, other values indicate failure.
    startTime string
    Point in time at which the function begins execution.
    function_name str
    Name of the SCF function.
    id str
    logs Sequence[GetScfLogsLog]
    An information list of logs. Each element contains the following attributes:
    end_time str
    invoke_request_id str
    limit float
    namespace str
    offset float
    order str
    order_by str
    result_output_file str
    ret_code str
    Execution result of function, 0 means the execution is successful, other values indicate failure.
    start_time str
    Point in time at which the function begins execution.
    functionName String
    Name of the SCF function.
    id String
    logs List<Property Map>
    An information list of logs. Each element contains the following attributes:
    endTime String
    invokeRequestId String
    limit Number
    namespace String
    offset Number
    order String
    orderBy String
    resultOutputFile String
    retCode String
    Execution result of function, 0 means the execution is successful, other values indicate failure.
    startTime String
    Point in time at which the function begins execution.

    Supporting Types

    GetScfLogsLog

    BillDuration double
    Function billing time, according to duration up to the last 100ms, unit is ms.
    Duration double
    Function execution time-consuming, unit is ms.
    FunctionName string
    Name of the SCF function to be queried.
    InvokeFinished double
    Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
    Level string
    Log level.
    Log string
    Log output during function execution.
    MemUsage double
    The actual memory size consumed in the execution of the function, unit is Byte.
    RequestId string
    Execute the requestId corresponding to the function.
    RetCode double
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    RetMsg string
    Return value after function execution is completed.
    Source string
    Log source.
    StartTime string
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    BillDuration float64
    Function billing time, according to duration up to the last 100ms, unit is ms.
    Duration float64
    Function execution time-consuming, unit is ms.
    FunctionName string
    Name of the SCF function to be queried.
    InvokeFinished float64
    Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
    Level string
    Log level.
    Log string
    Log output during function execution.
    MemUsage float64
    The actual memory size consumed in the execution of the function, unit is Byte.
    RequestId string
    Execute the requestId corresponding to the function.
    RetCode float64
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    RetMsg string
    Return value after function execution is completed.
    Source string
    Log source.
    StartTime string
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    billDuration Double
    Function billing time, according to duration up to the last 100ms, unit is ms.
    duration Double
    Function execution time-consuming, unit is ms.
    functionName String
    Name of the SCF function to be queried.
    invokeFinished Double
    Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
    level String
    Log level.
    log String
    Log output during function execution.
    memUsage Double
    The actual memory size consumed in the execution of the function, unit is Byte.
    requestId String
    Execute the requestId corresponding to the function.
    retCode Double
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    retMsg String
    Return value after function execution is completed.
    source String
    Log source.
    startTime String
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    billDuration number
    Function billing time, according to duration up to the last 100ms, unit is ms.
    duration number
    Function execution time-consuming, unit is ms.
    functionName string
    Name of the SCF function to be queried.
    invokeFinished number
    Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
    level string
    Log level.
    log string
    Log output during function execution.
    memUsage number
    The actual memory size consumed in the execution of the function, unit is Byte.
    requestId string
    Execute the requestId corresponding to the function.
    retCode number
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    retMsg string
    Return value after function execution is completed.
    source string
    Log source.
    startTime string
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    bill_duration float
    Function billing time, according to duration up to the last 100ms, unit is ms.
    duration float
    Function execution time-consuming, unit is ms.
    function_name str
    Name of the SCF function to be queried.
    invoke_finished float
    Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
    level str
    Log level.
    log str
    Log output during function execution.
    mem_usage float
    The actual memory size consumed in the execution of the function, unit is Byte.
    request_id str
    Execute the requestId corresponding to the function.
    ret_code float
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    ret_msg str
    Return value after function execution is completed.
    source str
    Log source.
    start_time str
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.
    billDuration Number
    Function billing time, according to duration up to the last 100ms, unit is ms.
    duration Number
    Function execution time-consuming, unit is ms.
    functionName String
    Name of the SCF function to be queried.
    invokeFinished Number
    Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
    level String
    Log level.
    log String
    Log output during function execution.
    memUsage Number
    The actual memory size consumed in the execution of the function, unit is Byte.
    requestId String
    Execute the requestId corresponding to the function.
    retCode Number
    Use to filter log, optional value: not0 only returns the error log. is0 only returns the correct log. TimeLimitExceeded returns the log of the function call timeout. ResourceLimitExceeded returns the function call generation resource overrun log. UserCodeException returns logs of the user code error that occurred in the function call. Not passing the parameter means returning all logs.
    retMsg String
    Return value after function execution is completed.
    source String
    Log source.
    startTime String
    The start time of the query, the format is 2017-05-16 20:00:00, which can only be within one day from end_time.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack