Skip to main content

getServiceInfo()

EXPERIMENTAL

获取有关指定名称和区域的服务的信息。

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

要获取已部署服务的列表,请使用 getServices()

🌐 To get a list of deployed services, use getServices().

要部署服务,请使用 deployService()

🌐 To deploy a service, use deployService().

示例

🌐 Example

import {getServiceInfo} from '@remotion/cloudrun/client';

const info = await getServiceInfo({
  region: 'us-east1',
  serviceName: 'remotion--3-3-82--mem512mi--cpu1-0--t-500',
});
console.log(info.serviceName); // remotion--3-3-82--mem512mi--cpu1-0--t-500
console.log(info.timeoutInSeconds); // 500
console.log(info.memoryLimit); // "2Gi"
console.log(info.cpuLimit); // "1.0"
console.log(info.remotionVersion); // '4.0.1'
console.log(info.uri); // "https://remotion--3-3-82--mem512mi--cpu1-0--t-500-1a2b3c4d5e-ue.a.run.app"
console.log(info.region); // "us-east1"
console.log(info.consoleUrl); // "https://console.cloud.google.com/run/detail/us-east1/remotion--3-3-82--mem512mi--cpu1-0--t-500/logs"
note

@remotion/cloudrun/client 导入,而不是导入整个渲染器,因为整个渲染器无法打包。

参数

🌐 Arguments

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

🌐 An object containing the following properties:

region

该服务所在的 GCP 区域

🌐 The GCP region the service resides in.

serviceName

服务的名称。

🌐 The name of the service.

返回值

🌐 Return value

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

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

memoryLimit

Cloud Run 服务可以消耗的 RAM 的上限。

🌐 The upper bound on the amount of RAM that the Cloud Run service can consume.

cpuLimit

Cloud Run 服务可以使用来处理请求的最大 CPU 核心数。

🌐 The maximum number of CPU cores that the Cloud Run service can use to process requests.

remotionVersion

该服务的 Remotion 版本。Remotion 对 Cloud Run 服务进行版本控制,并且渲染只能从与服务版本匹配的 @remotion/cloudrun 版本触发。

🌐 The Remotion version of the service. Remotion is versioning the Cloud Run service and a render can only be triggered from a version of @remotion/cloudrun that is matching the one of the service.

timeoutInSeconds

已分配给 Cloud Run 服务的超时时间。

🌐 The timeout that has been assigned to the Cloud Run service.

uri

服务的终点。

🌐 The endpoint of the service.

region

已部署服务的区域。

🌐 The region of the deployed service.

consoleUrl

此服务的 GCP 控制台页面的链接。具体来说,是日志显示的链接。

🌐 A link to the GCP console page for this service. Specifically, a link to logs display.

另请参阅

🌐 See also