有没有办法告诉谁在Google Cloud Platform中启动了实例? [英] Is there a way to tell who started an instance in Google Cloud Platform?

查看:131
本文介绍了有没有办法告诉谁在Google Cloud Platform中启动了实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们仅在Google Cloud Platform上运行少数实例,并且并非一直都在运行它们.通常,我们只是启动一个,执行我们需要做的,然后将其关闭...这很棒,除非我们"忘记关闭它们.

We run only a small handful of instances on Google Cloud Platform and we don't run them all the time. Generally we just fire one up, do what we need to do then shut it down... which is great, except when "we" forget to shut them down.

我已经能够找到相关的 REST APIs gcloud sdk ,但我不知道没有看到任何内容说明谁启动了实例.实际上,它也没有启动时间的时间戳.

I've been able to track down the relevant REST APIs and the gcloud sdk but I don't see anything that says who started the instance. Actually it also doesn't have a timestamp on when it was started.

我确实找到了 python应用引擎脚本,重写以在X倍的时间后停止实例,但是我宁愿找到一种方法来通知启动它的用户,并让他们知道实例仍在运行.

I did find this python app engine script that I might be able to rewrite to stop the instances after X amount of time, but I'd rather find a way to notify the user who started it and let them know the instance is still running.

有人尝试做类似的事情还是看到了在GCP中获取实例启动器"的方法?

Has anyone tried to do something similar or seen a way to get the "starter" of the instance in GCP?

推荐答案

您可以查看审核日志,以确定谁在何时何地执行了什么操作.此外,您可以使用Stackdriver Logging API方法entrys.list来检索审核日志条目用于您的用例.

You can look into the Audit Logs to determine who did what, where, and when. Further, you can use the Stackdriver Logging API method entries.list to retrieve audit log entries for your use case.

您还可以选择使用活动日志来了解详细信息,例如发出API请求的授权用户.

Also you can choose use the Activity Logs to know the details such as the authorized user who made the API request.

这篇关于有没有办法告诉谁在Google Cloud Platform中启动了实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆