发送反馈
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
管理函数
使用 cloudfunctions.googleapis.com
v2 API 创建的 Cloud Run functions 可以使用 run.googleapis.com
v1 或 v2 API 进行管理。例如,您可以使用 Google Cloud CLI 通过 gcloud functions
或 gcloud run
命令更新现有函数:
gcloud functions
gcloud functions deploy FUNCTION_NAME" \
--runtime=nodejs22\
--source= . \
--entry-point=ENTRYPOINT"
--trigger-http
gcloud run
gcloud run deploy FUNCTION_NAME" \
--source= . \
--function="ENTRYPOINT"
--base-image=google-22-full/nodejs22
注意 :如果您使用 run.googleapis.com
v1 或 v2 API (gcloud run
) 创建了 Cloud Run 函数,则无法使用 cloudfunctions.googleapis.com
v2 API (gcloud functions
) 管理该函数。 分离
Preview
— Cloud Run functions detach
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section
of the Service Specific Terms .
Pre-GA features are available "as is" and might have limited support.
For more information, see the
launch stage descriptions .
使用 cloudfunctions.googleapis.com
v2 API 创建的 Cloud Run functions 可以从 cloudfunctions.googleapis.com
API 环境中分离,以便仅使用 run.googleapis.com
进行管理。
为分离函数做准备
在准备分离函数时,请考虑以下事项:
分离操作无法撤销。
分离操作无法应用于 Cloud Run functions(第 1 代)。
熟悉如何使用 Google Cloud 控制台、Google Cloud CLI 和 Terraform 在 Cloud Run 中部署函数 。
HTTP 函数将保留分配给它们的网址。
系统会保留关联到事件驱动型函数的触发器。
无法直接通过 run.googleapis.com
API 管理触发器。请务必熟悉适用于 Eventarc 或 Pub/Sub 的触发器管理指南。
停用在失败时重试 功能不是 Cloud Run 支持的功能。
在分离操作期间,系统会修改关联到使用失败时不重试 配置的函数的触发器,以便底层 Pub/Sub 主题最多尝试交付五次。分离操作完成后,系统会创建一个死信队列 主题,用于存储未传送的消息,您可以通过创建对死信队列的新订阅来检索这些消息。
成功分离函数后,系统会创建新的 Cloud Run 修订版本。从该修订版起,系统将使用 Cloud Run SKU 对该函数进行结算。
分离函数
您可以使用以下命令分离函数:
gcloud beta functions detach FUNCTION_NAME
将 FUNCTION_NAME 替换为您的函数的名称。
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-26。
需要向我们提供更多信息?
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-02-26。"],[],[]]