【发布时间】:2020-09-06 16:04:42
【问题描述】:
使用 Google 云 AP,我想检索以下有关 VM 实例的数据
过去一个月内提供的谷歌实例的开始时间和停止时间。
有没有可能
【问题讨论】:
标签: google-cloud-platform cloud
使用 Google 云 AP,我想检索以下有关 VM 实例的数据
过去一个月内提供的谷歌实例的开始时间和停止时间。
有没有可能
【问题讨论】:
标签: google-cloud-platform cloud
Google Cloud AP 是什么意思?
另一方面,您可以在 Cloud Logging 上获取 VM 的活动,有关您需要的信息,请转到 Cloud Logging 页面 convert to advance filter,您可以将此查询应用于启动操作:
resource.type="gce_instance"
"compute.instances.start"
这用于停止操作:
resource.type="gce_instance"
"compute.instances.stop"
您可以应用日期和时间过滤器以获得更好的结果。
您也可以通过gcloud command获得相同的信息:
gcloud 日志读取“jsonPayload.event_subtype = 计算.instances.stop"
和
gcloud 日志读取“jsonPayload.event_subtype = 计算.instances.start"
如需更多高级选项,请查看documentation.
【讨论】:
谢谢。这有帮助
我可以使用日志记录 api
https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list
检索 VM 资源的开始和停止时间
【讨论】: