getServiceInfo()
获取给定名称和区域的服务的信息。
要获取已部署服务的列表,请使用 getServices()
。
要部署服务,请使用 deployService()
。
示例
ts
import {getServiceInfo } from "@remotion/cloudrun/client";constinfo = awaitgetServiceInfo ({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-500console .log (info .timeoutInSeconds ); // 500console .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"
ts
import {getServiceInfo } from "@remotion/cloudrun/client";constinfo = awaitgetServiceInfo ({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-500console .log (info .timeoutInSeconds ); // 500console .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
导入,以避免导入整个渲染器,因为无法捆绑。
参数
包含以下属性的对象:
region
服务所在的 GCP 区域。
serviceName
服务的名称。
返回值
如果服务不存在,则 GCP SDK 会抛出错误。 如果服务存在,则返回一个解析为具有以下属性的对象的 Promise:
memoryLimit
Cloud Run 服务可以消耗的 RAM 量的上限。
cpuLimit
Cloud Run 服务用于处理请求的 CPU 核心的最大数量。
remotionVersion
服务的 Remotion 版本。Remotion 正在对 Cloud Run 服务进行版本控制,只能从与服务版本匹配的 @remotion/cloudrun
版本触发渲染。
timeoutInSeconds
已分配给 Cloud Run 服务的超时时间。
uri
服务的端点。
region
部署服务的区域。
consoleUrl
指向此服务的 GCP 控制台页面的链接。具体来说,是日志显示的链接。
参见
Please paste the Markdown content you'd like me to translate into Chinese.