2017-04-19 89 views
0

我正尝试在Azure中使用Node js SDK创建网络接口。Azure Node Js Api - 创建网络接口

虽然它不工作,我不断得到“无法解析请求”。微软文档并不是那么有用。

请求为:

{ 
    "resourceGroupName": "name", 
    "networkInterfaceName": "another-name", 
    "properties": { 
    "location": "eastus2", 
     "ipConfigurations": [ 
     { 
     "properties": { 
      "privateIpAddress": "10.1.10.1" 
     } 
     } 
    ] 
    } 
} 

的响应是:

{ 
    "request": { 
    "id": "7384079f-83a6-459f-b8a9-096f76db97ff", 
    "url": "/network/networkInterface/", 
    "method": "POST", 
    "timestamp": "2017-04-19T07:40:56.022Z" 
    }, 
    "response": { 
    "status": { 
     "code": 400, 
     "message": "Bad Request" 
    }, 
    "errors": [ 
     { 
     "code": "Error", 
     "message": "Cannot parse the request." 
     } 
    ] 
    } 
} 

没有ipConfigurations阵列时,收到它规定我必须重视ipConfigurations的响应。

感谢, 吉拉德

+0

你可以分享创建网络接口的代码吗? –

回答

0

其实我刚刚成功地解决这一问题。 我添加了一个子网属性,它的工作。