Skip to main content

getFunctionInfo()

获取有关给定名称和区域的函数的信息。

🌐 Gets information about a function given its name and region.

要获取已部署函数的列表,请使用 getFunctions()

🌐 To get a list of deployed functions, use getFunctions().

要部署一个函数,请使用 deployFunction()

🌐 To deploy a function, use deployFunction().

示例

🌐 Example

import {getFunctionInfo} from '@remotion/lambda';

const info = await getFunctionInfo({
  functionName: 'remotion-render-d7nd2a9f',
  region: 'eu-central-1',
});
console.log(info.functionName); // remotion-render-d7nd2a9f
console.log(info.memorySizeInMb); // 1500
console.log(info.diskSizeInMb); // 2048
console.log(info.version); // '2021-07-14'
console.log(info.timeoutInSeconds); // 120

参数

🌐 Arguments

一个包含以下属性的对象:

🌐 An object containing the following properties:

region

函数所在的 AWS 区域

🌐 The AWS region the function resides in.

functionName

函数的名称。

🌐 The name of the function.

logLevel?v4.0.115

One of trace, verbose, info, warn, error.
Determines how much info is being logged to the console.

Default info.

返回值

🌐 Return value

如果函数不存在,AWS SDK 会抛出错误。 如果函数存在,将返回一个解析为具有以下属性的对象的 Promise:

🌐 If the function does not exist, an error is thrown by the AWS SDK. If the function exists, promise resolving to an object with the following properties is returned:

memorySizeInMb

分配给函数的内存量。

🌐 The amount of memory allocated to the function.

diskSizeInMb

分配给该函数的磁盘空间量。

🌐 The amount of disk space allocated to the function.

functionName

函数的名称。

🌐 The name of the function.

version

函数的版本。Remotion 对 Lambda 函数进行版本控制,并且渲染只能从与函数版本匹配的 @remotion/lambda 版本触发。

🌐 The version of the function. Remotion is versioning the Lambda function and a render can only be triggered from a version of @remotion/lambda that is matching the one of the function.

timeoutInSeconds

已分配给 Lambda 函数的超时时间。

🌐 The timeout that has been assigned to the Lambda function.

另请参阅

🌐 See also