一种自动编写脚本以在gcp中启动和停止sql数据库的方法

编程入门 行业动态 更新时间:2024-10-26 04:24:58
本文介绍了一种自动编写脚本以在gcp中启动和停止sql数据库的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在gcp的cloud Scheduler中运行作业,以在工作日的工作日启动和停止sql数据库.

i want to run a job in cloud scheduler in gcp to start and stop the sql database in weekdays at working hours.

我已经尝试通过触发云功能并使用pubsub进行尝试,但是我没有找到正确的方法来实现它.

I have tried by triggering cloud function and using pubsub but i am not getting proper way to do it.

推荐答案

为实现此目的,您可以使用云功能以调用使用Cloud SQL Admin API 来启动和停止Cloud SQL实例(您将需要2个Cloud函数).您可以看到有关如何使用云功能启动Cloud SQL实例,然后停止一个Cloud SQL实例

In order to achieve this you can use a Cloud Function to make a call to the Cloud SQL Admin API to start and stop your Cloud SQL instance (you will need 2 Cloud functions). You can see my code on how to use a Cloud Function to start a Cloud SQL instance and stop a Cloud SQL instance

创建Cloud函数后,您可以配置Cloud Scheduler 来触发http每个Cloud函数的地址

After creating your Cloud Function you can configure the Cloud Scheduler to trigger the http address of each Cloud function

更多推荐

一种自动编写脚本以在gcp中启动和停止sql数据库的方法

本文发布于:2023-10-28 13:20:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536748.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   数据库   方法   sql   gcp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!