Network Watchers - Create Or Update
在指定的資源群組中建立或更新網路監看員。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}?api-version=2025-09-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
network
|
path | True |
string |
網路監看員的名稱。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
|
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
要求本文
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string |
資源識別。 |
| location |
string |
資源位置。 |
| tags |
object |
資源標籤。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
資源「NetworkWatcher」更新操作成功 |
|
| 201 Created |
資源「NetworkWatcher」建立操作成功 |
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| user_impersonation | 冒用您的使用者帳戶 |
範例
Create network watcher
範例要求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1?api-version=2025-09-01
{
"location": "eastus",
"properties": {}
}
範例回覆
{
"name": "nw1",
"type": "Microsoft.Network/networkWatchers",
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1",
"location": "eastus",
"properties": {
"provisioningState": "Succeeded"
},
"tags": {}
}
{
"name": "nw1",
"type": "Microsoft.Network/networkWatchers",
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1",
"location": "eastus",
"properties": {
"provisioningState": "Succeeded"
},
"tags": {}
}
定義
| 名稱 | Description |
|---|---|
|
Error |
常見的錯誤詳細數據表示。 |
|
Error |
error 物件。 |
|
Network |
資源群組中的網路監看員。 |
|
Provisioning |
布建資源的狀態。 |
ErrorDetails
常見的錯誤詳細數據表示。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
錯誤碼。 |
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
error 物件。
| 名稱 | 類型 | Description |
|---|---|---|
| error |
錯誤 |
NetworkWatcher
資源群組中的網路監看員。
| 名稱 | 類型 | Description |
|---|---|---|
| etag |
string |
每當更新資源時變更的唯一隻讀字串。 |
| id |
string |
資源識別。 |
| location |
string |
資源位置。 |
| name |
string |
資源名稱。 |
| properties.provisioningState |
網路監看員資源的佈建狀態。 |
|
| tags |
object |
資源標籤。 |
| type |
string |
資源類型。 |
ProvisioningState
布建資源的狀態。
| 值 | Description |
|---|---|
| Failed |
失敗 |
| Succeeded |
成功 |
| Canceled |
已取消 |
| Creating |
建立中 |
| Updating |
更新中 |
| Deleting |
刪除中 |