1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getScfLogs
tencentcloud 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack

tencentcloud.getScfLogs

Explore with Pulumi AI

tencentcloud 1.81.182 published on Monday, Apr 14, 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,
});
Copy
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)
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetScfLogs(ctx *Context, args *GetScfLogsArgs, opts ...InvokeOption) (*GetScfLogsResult, error)
func GetScfLogsOutput(ctx *Context, args *GetScfLogsOutputArgs, opts ...InvokeOption) GetScfLogsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetScfLogsResult> getScfLogs(GetScfLogsArgs args, InvokeOptions options)
public static Output<GetScfLogsResult> getScfLogs(GetScfLogsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: tencentcloud:index/getScfLogs:getScfLogs
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

FunctionName This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. double
Function billing time, according to duration up to the last 100ms, unit is ms.
Duration This property is required. double
Function execution time-consuming, unit is ms.
FunctionName This property is required. string
Name of the SCF function to be queried.
InvokeFinished This property is required. double
Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
Level This property is required. string
Log level.
Log This property is required. string
Log output during function execution.
MemUsage This property is required. double
The actual memory size consumed in the execution of the function, unit is Byte.
RequestId This property is required. string
Execute the requestId corresponding to the function.
RetCode This property is required. 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 This property is required. string
Return value after function execution is completed.
Source This property is required. string
Log source.
StartTime This property is required. 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 This property is required. float64
Function billing time, according to duration up to the last 100ms, unit is ms.
Duration This property is required. float64
Function execution time-consuming, unit is ms.
FunctionName This property is required. string
Name of the SCF function to be queried.
InvokeFinished This property is required. float64
Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
Level This property is required. string
Log level.
Log This property is required. string
Log output during function execution.
MemUsage This property is required. float64
The actual memory size consumed in the execution of the function, unit is Byte.
RequestId This property is required. string
Execute the requestId corresponding to the function.
RetCode This property is required. 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 This property is required. string
Return value after function execution is completed.
Source This property is required. string
Log source.
StartTime This property is required. 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 This property is required. Double
Function billing time, according to duration up to the last 100ms, unit is ms.
duration This property is required. Double
Function execution time-consuming, unit is ms.
functionName This property is required. String
Name of the SCF function to be queried.
invokeFinished This property is required. Double
Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
level This property is required. String
Log level.
log This property is required. String
Log output during function execution.
memUsage This property is required. Double
The actual memory size consumed in the execution of the function, unit is Byte.
requestId This property is required. String
Execute the requestId corresponding to the function.
retCode This property is required. 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 This property is required. String
Return value after function execution is completed.
source This property is required. String
Log source.
startTime This property is required. 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 This property is required. number
Function billing time, according to duration up to the last 100ms, unit is ms.
duration This property is required. number
Function execution time-consuming, unit is ms.
functionName This property is required. string
Name of the SCF function to be queried.
invokeFinished This property is required. number
Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
level This property is required. string
Log level.
log This property is required. string
Log output during function execution.
memUsage This property is required. number
The actual memory size consumed in the execution of the function, unit is Byte.
requestId This property is required. string
Execute the requestId corresponding to the function.
retCode This property is required. 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 This property is required. string
Return value after function execution is completed.
source This property is required. string
Log source.
startTime This property is required. 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 This property is required. float
Function billing time, according to duration up to the last 100ms, unit is ms.
duration This property is required. float
Function execution time-consuming, unit is ms.
function_name This property is required. str
Name of the SCF function to be queried.
invoke_finished This property is required. float
Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
level This property is required. str
Log level.
log This property is required. str
Log output during function execution.
mem_usage This property is required. float
The actual memory size consumed in the execution of the function, unit is Byte.
request_id This property is required. str
Execute the requestId corresponding to the function.
ret_code This property is required. 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 This property is required. str
Return value after function execution is completed.
source This property is required. str
Log source.
start_time This property is required. 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 This property is required. Number
Function billing time, according to duration up to the last 100ms, unit is ms.
duration This property is required. Number
Function execution time-consuming, unit is ms.
functionName This property is required. String
Name of the SCF function to be queried.
invokeFinished This property is required. Number
Whether the function call ends, 1 means the execution ends, other values indicate the call exception.
level This property is required. String
Log level.
log This property is required. String
Log output during function execution.
memUsage This property is required. Number
The actual memory size consumed in the execution of the function, unit is Byte.
requestId This property is required. String
Execute the requestId corresponding to the function.
retCode This property is required. 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 This property is required. String
Return value after function execution is completed.
source This property is required. String
Log source.
startTime This property is required. 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 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack