【问题标题】:azure-sdk-for-node: virtualMachines.get does not return VM status (stopped, running, deallocated, etc.)azure-sdk-for-node:virtualMachines.get 不返回 VM 状态(已停止、正在运行、已解除分配等)
【发布时间】:2017-04-04 18:01:23
【问题描述】:

我已调用 virtualMachines.get 以检索有关我的 VM 的实例信息。在输出中,我看不到您从哪里获得 VM 的状态(停止、运行、解除分配)。还有其他方法可以获取我正在寻找的状态吗?

【问题讨论】:

    标签: azure-node-sdk


    【解决方案1】:

    使用可选的查询参数 $expand=instanceView。

    示例:

    //assuming you have instantiated the client ...
    let options = {expand: 'instanceView'};
    client.virtualMachines.get('rg-name', 'vm-name', options).then((vminfo) => {
      console.dir(vminfo, {depth: null, colors: true});
    }).catch((err) => {
      console.dir(err, {depth: null, colors: true});
    });

    找到文档here

    【讨论】:

      猜你喜欢
      • 2020-05-22
      • 1970-01-01
      • 1970-01-01
      • 2021-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-01
      • 1970-01-01
      相关资源
      最近更新 更多