tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
tencentcloud.getScfLogs
Explore with Pulumi AI
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:
- Function
Name string - Name of the SCF function to be queried.
- End
Time string - The end time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromstart_time
. - Id string
- Invoke
Request stringId - 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
andasc
, defaultdesc
. - Order
By string - Sort the logs according to the following fields:
function_name
,duration
,mem_usage
,start_time
, defaultstart_time
. - Result
Output stringFile - Used to save results.
- Ret
Code 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. - Start
Time string - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_time
.
- Function
Name string - Name of the SCF function to be queried.
- End
Time string - The end time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromstart_time
. - Id string
- Invoke
Request stringId - 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
andasc
, defaultdesc
. - Order
By string - Sort the logs according to the following fields:
function_name
,duration
,mem_usage
,start_time
, defaultstart_time
. - Result
Output stringFile - Used to save results.
- Ret
Code 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. - Start
Time string - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_time
.
- function
Name String - Name of the SCF function to be queried.
- end
Time String - The end time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromstart_time
. - id String
- invoke
Request StringId - 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
andasc
, defaultdesc
. - order
By String - Sort the logs according to the following fields:
function_name
,duration
,mem_usage
,start_time
, defaultstart_time
. - result
Output StringFile - Used to save results.
- ret
Code 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. - start
Time String - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_time
.
- function
Name string - Name of the SCF function to be queried.
- end
Time string - The end time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromstart_time
. - id string
- invoke
Request stringId - 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
andasc
, defaultdesc
. - order
By string - Sort the logs according to the following fields:
function_name
,duration
,mem_usage
,start_time
, defaultstart_time
. - result
Output stringFile - Used to save results.
- ret
Code 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. - start
Time string - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_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 fromstart_time
. - id str
- invoke_
request_ strid - 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
andasc
, defaultdesc
. - order_
by str - Sort the logs according to the following fields:
function_name
,duration
,mem_usage
,start_time
, defaultstart_time
. - result_
output_ strfile - 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 fromend_time
.
- function
Name String - Name of the SCF function to be queried.
- end
Time String - The end time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromstart_time
. - id String
- invoke
Request StringId - 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
andasc
, defaultdesc
. - order
By String - Sort the logs according to the following fields:
function_name
,duration
,mem_usage
,start_time
, defaultstart_time
. - result
Output StringFile - Used to save results.
- ret
Code 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. - start
Time String - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_time
.
getScfLogs Result
The following output properties are available:
- Function
Name string - Name of the SCF function.
- Id string
- Logs
List<Get
Scf Logs Log> - An information list of logs. Each element contains the following attributes:
- End
Time string - Invoke
Request stringId - Limit double
- Namespace string
- Offset double
- Order string
- Order
By string - Result
Output stringFile - Ret
Code string - Execution result of function,
0
means the execution is successful, other values indicate failure. - Start
Time string - Point in time at which the function begins execution.
- Function
Name string - Name of the SCF function.
- Id string
- Logs
[]Get
Scf Logs Log - An information list of logs. Each element contains the following attributes:
- End
Time string - Invoke
Request stringId - Limit float64
- Namespace string
- Offset float64
- Order string
- Order
By string - Result
Output stringFile - Ret
Code string - Execution result of function,
0
means the execution is successful, other values indicate failure. - Start
Time string - Point in time at which the function begins execution.
- function
Name String - Name of the SCF function.
- id String
- logs
List<Get
Scf Logs Log> - An information list of logs. Each element contains the following attributes:
- end
Time String - invoke
Request StringId - limit Double
- namespace String
- offset Double
- order String
- order
By String - result
Output StringFile - ret
Code String - Execution result of function,
0
means the execution is successful, other values indicate failure. - start
Time String - Point in time at which the function begins execution.
- function
Name string - Name of the SCF function.
- id string
- logs
Get
Scf Logs Log[] - An information list of logs. Each element contains the following attributes:
- end
Time string - invoke
Request stringId - limit number
- namespace string
- offset number
- order string
- order
By string - result
Output stringFile - ret
Code string - Execution result of function,
0
means the execution is successful, other values indicate failure. - start
Time string - Point in time at which the function begins execution.
- function_
name str - Name of the SCF function.
- id str
- logs
Sequence[Get
Scf Logs Log] - An information list of logs. Each element contains the following attributes:
- end_
time str - invoke_
request_ strid - limit float
- namespace str
- offset float
- order str
- order_
by str - result_
output_ strfile - 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.
- function
Name String - Name of the SCF function.
- id String
- logs List<Property Map>
- An information list of logs. Each element contains the following attributes:
- end
Time String - invoke
Request StringId - limit Number
- namespace String
- offset Number
- order String
- order
By String - result
Output StringFile - ret
Code String - Execution result of function,
0
means the execution is successful, other values indicate failure. - start
Time String - Point in time at which the function begins execution.
Supporting Types
GetScfLogsLog
- Bill
Duration double - Function billing time, according to duration up to the last 100ms, unit is ms.
- Duration double
- Function execution time-consuming, unit is ms.
- Function
Name string - Name of the SCF function to be queried.
- Invoke
Finished 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.
- Mem
Usage double - The actual memory size consumed in the execution of the function, unit is Byte.
- Request
Id string - Execute the requestId corresponding to the function.
- Ret
Code 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. - Ret
Msg string - Return value after function execution is completed.
- Source string
- Log source.
- Start
Time string - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_time
.
- Bill
Duration float64 - Function billing time, according to duration up to the last 100ms, unit is ms.
- Duration float64
- Function execution time-consuming, unit is ms.
- Function
Name string - Name of the SCF function to be queried.
- Invoke
Finished 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.
- Mem
Usage float64 - The actual memory size consumed in the execution of the function, unit is Byte.
- Request
Id string - Execute the requestId corresponding to the function.
- Ret
Code 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. - Ret
Msg string - Return value after function execution is completed.
- Source string
- Log source.
- Start
Time string - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_time
.
- bill
Duration Double - Function billing time, according to duration up to the last 100ms, unit is ms.
- duration Double
- Function execution time-consuming, unit is ms.
- function
Name String - Name of the SCF function to be queried.
- invoke
Finished 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.
- mem
Usage Double - The actual memory size consumed in the execution of the function, unit is Byte.
- request
Id String - Execute the requestId corresponding to the function.
- ret
Code 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. - ret
Msg String - Return value after function execution is completed.
- source String
- Log source.
- start
Time String - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_time
.
- bill
Duration number - Function billing time, according to duration up to the last 100ms, unit is ms.
- duration number
- Function execution time-consuming, unit is ms.
- function
Name string - Name of the SCF function to be queried.
- invoke
Finished 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.
- mem
Usage number - The actual memory size consumed in the execution of the function, unit is Byte.
- request
Id string - Execute the requestId corresponding to the function.
- ret
Code 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. - ret
Msg string - Return value after function execution is completed.
- source string
- Log source.
- start
Time string - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_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 fromend_time
.
- bill
Duration Number - Function billing time, according to duration up to the last 100ms, unit is ms.
- duration Number
- Function execution time-consuming, unit is ms.
- function
Name String - Name of the SCF function to be queried.
- invoke
Finished 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.
- mem
Usage Number - The actual memory size consumed in the execution of the function, unit is Byte.
- request
Id String - Execute the requestId corresponding to the function.
- ret
Code 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. - ret
Msg String - Return value after function execution is completed.
- source String
- Log source.
- start
Time String - The start time of the query, the format is
2017-05-16 20:00:00
, which can only be within one day fromend_time
.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack