你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

创建网络资源

创建或更新网络资源。

使用指定的名称和说明创建网络资源。 如果已存在同名网络,则其说明将更新为此请求中指示的网络。

使用网络资源创建专用网络并为应用程序中的服务配置公共连接。

请求

方法 请求 URI
PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/networks/{networkName}?api-version=2018-07-01-preview

参数

名称 类型 必须 位置
subscriptionId string 路径
resourceGroupName 字符串 路径
networkName 字符串 路径
api-version 字符串 查询
networkResourceDescription NetworkResourceDescription “是” Body

subscriptionId

类型:字符串
必需:是

客户订阅标识符


resourceGroupName

类型:字符串
必需:是

Azure 资源组名称


networkName

类型:字符串
必需:是

网络的标识。


api-version

类型:字符串
必需:是
默认

API 的版本。 此参数是必需的,其值必须为 2018-07-01-preview


networkResourceDescription

类型NetworkResourceDescription
必需:是

有关创建网络资源的说明。

响应

HTTP 状态代码 说明 响应架构
200 (正常) 正常
NetworkResourceDescription
201 (已创建) 创建
NetworkResourceDescription
所有其他状态代码 错误
ErrorModel

示例

Network_Create

此示例演示如何创建具有自定义地址范围和负载均衡公共终结点的网络资源。

请求

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sbz_demo/providers/Microsoft.ServiceFabricMesh/networks/helloWorldNetworkWindows?api-version=2018-07-01-preview
正文
{
  "properties": {
    "addressPrefix": "10.0.0.4/22",
    "ingressConfig": {
      "layer4": [
        {
          "publicPort": "80",
          "applicationName": "helloWorldAppWindows",
          "serviceName": "helloWorldService",
          "endpointName": "helloWorldListener"
        }
      ]
    }
  },
  "location": "eastus"
}

200 响应

正文
{
  "type": "Microsoft.ServiceFabricMesh/networks",
  "location": "eastus",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sbz_demo/providers/Microsoft.ServiceFabricMesh/networks/helloWorldNetworkWindows",
  "name": "helloWorldNetworkWindows",
  "tags": {},
  "properties": {
    "provisioningState": "Succeeded",
    "addressPrefix": "10.0.0.4/22",
    "ingressConfig": {
      "qosLevel": "Bronze",
      "layer4": [
        {
          "publicPort": "80",
          "applicationName": "helloWorldAppWindows",
          "serviceName": "helloWorldService",
          "endpointName": "helloWorldListener"
        }
      ]
    }
  }
}

201 响应

正文
{
  "type": "Microsoft.ServiceFabricMesh/networks",
  "location": "eastus",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sbz_demo/providers/Microsoft.ServiceFabricMesh/networks/helloWorldNetworkWindows",
  "name": "helloWorldNetworkWindows",
  "tags": {},
  "properties": {
    "provisioningState": "Updating",
    "addressPrefix": "10.0.0.4/22",
    "ingressConfig": {
      "qosLevel": "Bronze",
      "layer4": [
        {
          "publicPort": "80",
          "applicationName": "helloWorldAppWindows",
          "serviceName": "helloWorldService",
          "endpointName": "helloWorldListener"
        }
      ]
    }
  }
}