Virtual machine 使用gcloud,如何查找虚拟机名称?
我尝试在登录到VM时使用gcloud命令查找Google云计算虚拟机名称 我在文档中搜索没有得到结果 谢谢 见 具体而言:Virtual machine 使用gcloud,如何查找虚拟机名称?,virtual-machine,gcloud,Virtual Machine,Gcloud,我尝试在登录到VM时使用gcloud命令查找Google云计算虚拟机名称 我在文档中搜索没有得到结果 谢谢 见 具体而言: curl\ --标题“元数据风格:谷歌”\ http://metadata.google.internal/computeMetadata/v1/instance/name 元数据服务是一个实现良好的API,您可以在资源树上下导航,例如,从上面的URL中删除最后的名称,枚举实例下的所有资源: curl\ --标题“元数据风格:谷歌”\ http://metadata.g
curl\
--标题“元数据风格:谷歌”\
http://metadata.google.internal/computeMetadata/v1/instance/name
元数据服务是一个实现良好的API,您可以在资源树上下导航,例如,从上面的URL中删除最后的名称
,枚举实例
下的所有资源:
curl\
--标题“元数据风格:谷歌”\
http://metadata.google.internal/computeMetadata/v1/instance/
返回:
attributes/
cpu-platform
description
disks/
guest-attributes/
hostname
id
image
legacy-endpoint-access/
licenses/
machine-type
maintenance-event
name
network-interfaces/
preempted
remaining-cpu-time
scheduling/
service-accounts/
tags
virtual-clock/
zone
然后,您可以选择上述任何一项,将其附加到URL以继续浏览
中的文档同样全面,对于实例元数据,正如预期的那样,反映了GET'ing的响应
i、 e:
请参见
具体而言:
curl\
--标题“元数据风格:谷歌”\
http://metadata.google.internal/computeMetadata/v1/instance/name
元数据服务是一个实现良好的API,您可以在资源树上下导航,例如,从上面的URL中删除最后的名称
,枚举实例
下的所有资源:
curl\
--标题“元数据风格:谷歌”\
http://metadata.google.internal/computeMetadata/v1/instance/
返回:
attributes/
cpu-platform
description
disks/
guest-attributes/
hostname
id
image
legacy-endpoint-access/
licenses/
machine-type
maintenance-event
name
network-interfaces/
preempted
remaining-cpu-time
scheduling/
service-accounts/
tags
virtual-clock/
zone
然后,您可以选择上述任何一项,将其附加到URL以继续浏览
中的文档同样全面,对于实例元数据,正如预期的那样,反映了GET'ing的响应
i、 e: