【问题标题】:Is there a way to know the creator of a GCP instance with gcloud SDK?有没有办法通过 gcloud SDK 了解 GCP 实例的创建者?
【发布时间】:2018-10-04 12:41:56
【问题描述】:

我正在尝试查找可以提供有关实例创建者信息的 gcloud 命令。有没有办法做到这一点?

谢谢。

【问题讨论】:

    标签: google-cloud-platform google-compute-engine


    【解决方案1】:

    我的建议是执行gcloud logging read,尤其是gcloud logging read "resource.type=gce_instance"

    您应该能够看到一个名为authenticationInfo 的字段,其中包含the email address of who did a certain operation。在这种情况下,如果我没记错的话,您必须查找具有值compute.instances.insertmethod 字段。

    【讨论】:

      【解决方案2】:

      是的,请参见下文并相应地替换 [实例名称]。

      gcloud logging read "resource.type=gce_instance AND jsonPayload.event_subtype=compute.instances.insert AND jsonPayload
      .resource.name=[instance name]" | grep user
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-06
        • 1970-01-01
        • 2018-12-12
        • 2021-07-07
        相关资源
        最近更新 更多