建立網路資源

建立或更新網路資源。

建立具有指定名稱和描述的網路資源。 如果具有相同名稱的網路已經存在,則會將其描述更新為此要求中所指出的網路。

使用網路資源來建立私人網路,並設定應用程式內服務的公用連線能力。

要求

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

參數

名稱 類型 必要 Location
subscriptionId 字串 路徑
resourceGroupName 字串 路徑
networkName 字串 路徑
api-version 字串 查詢
networkResourceDescription NetworkResourceDescription body

subscriptionId

類型:字串
必要:是

客戶訂用帳戶識別碼


resourceGroupName

類型:字串
必要:是

Azure 資源群組名稱


networkName

類型:字串
必要:是

網路的身分識別。


api-version

類型:字串
必要:是
預設2018-07-01-preview

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"
        }
      ]
    }
  }
}