Virtual Network Subnets - Create Or Update
创建或更新虚拟网络子网的作。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}?api-version=2026-04-01-preview
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subnet
|
path | True |
string pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ |
虚拟网络子网名称 |
|
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
|
virtual
|
path | True |
string pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ |
虚拟网络的名称 |
|
api-version
|
query | True |
string minLength: 1 |
用于此作的 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| extendedLocation |
资源的 extendedLocation。 |
|
| properties |
此资源的资源特定属性。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
资源“VirtualNetworkSubnet”更新作成功 |
|
| 201 Created |
资源“VirtualNetworkSubnet”创建作成功 标头
|
|
| Other Status Codes |
意外的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流程。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
PutVirtualNetworkSubnet
示例请求
PUT https://management.azure.com/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/virtualNetworks/test-vnet/subnets/subnet1?api-version=2026-04-01-preview
{
"properties": {
"addressPrefix": "10.0.0.0/28"
}
}
示例响应
{
"name": "subnet",
"type": "Microsoft.AzureStackHCI/virtualNetworks/subnets",
"extendedLocation": {
"name": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
"type": "CustomLocation"
},
"id": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualNetworks/test-vnet/subnets/subnet1",
"properties": {
"addressPrefix": "10.0.0.0/28",
"provisioningState": "Accepted"
}
}
{
"name": "test-vnet",
"type": "Microsoft.AzureStackHCI/virtualNetworks",
"extendedLocation": {
"name": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
"type": "CustomLocation"
},
"id": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualNetworks/test-vnet/subnets/subnet1",
"properties": {
"addressPrefix": "10.0.0.0/28",
"provisioningState": "Succeeded"
}
}
定义
| 名称 | 说明 |
|---|---|
|
created |
创建资源的标识的类型。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Extended |
扩展位置的复杂类型。 |
|
Extended |
extendedLocation 的类型。 |
|
Nat |
网络安全组的 ARM ID。 |
|
Network |
网络安全组的 Azure 资源 ID。 |
|
Provisioning |
资源的预配状态。 |
| Route |
路由 - 路由资源。 |
|
Route |
路由表资源。 |
| Status |
对资源执行的操作的状态 [Succeeded, Failed, InProgress] |
|
system |
与创建和上次修改资源相关的元数据。 |
|
Virtual |
虚拟网络资源定义。 |
|
Virtual |
Azure 资源 ID 用于子网上资源消耗 IP 的 IP |
|
Virtual |
VirtualNetwork 子网资源 |
|
Virtual |
虚拟网络子网作状态 |
|
Virtual |
虚拟网络子网作状态 |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
附加信息。 |
| type |
string |
附加信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
ExtendedLocation
扩展位置的复杂类型。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
扩展位置的名称。 |
| type |
扩展位置的类型。 |
ExtendedLocationTypes
extendedLocation 的类型。
| 值 | 说明 |
|---|---|
| CustomLocation |
自定义扩展位置类型 |
NatGatewayArmReference
网络安全组的 ARM ID。
| 名称 | 类型 | 说明 |
|---|---|---|
| resourceId |
string (arm-id) |
网络安全组的 ARM ID。 |
NetworkSecurityGroupArmReference
网络安全组的 Azure 资源 ID。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string (arm-id) |
网络安全组的 Azure 资源 ID。 |
ProvisioningStateEnum
资源的预配状态。
| 值 | 说明 |
|---|---|
| Succeeded |
预配已成功 |
| Failed |
预配失败 |
| InProgress |
正在进行预配 |
| Accepted |
已接受预配 |
| Deleting |
正在删除资源 |
| Canceled |
已取消预配 |
Route
路由 - 路由资源。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$ |
名称 - 子网的名称 |
| properties.addressPrefix |
string |
路由应用到的目标 CIDR。 |
| properties.nextHopIpAddress |
string |
数据包应转发到的 IP 地址。 只有在下一跃点类型为 VirtualAppliance 的路由中才允许下一跃点值。 |
RouteTable
路由表资源。
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
一个唯一的只读字符串,每当更新资源时更改。 |
| name |
string |
资源名称。 |
| properties.routes |
Route[] |
路由表中包含的路由的集合。 |
| type |
string |
资源类型。 |
Status
对资源执行的操作的状态 [Succeeded, Failed, InProgress]
| 值 | 说明 |
|---|---|
| Succeeded |
作成功 |
| Failed |
作失败 |
| InProgress |
作正在进行中 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
资源上次修改的时间戳 (UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |
VirtualNetworkSubnet
虚拟网络资源定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| extendedLocation |
资源的 extendedLocation。 |
|
| id |
string (arm-id) |
资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| name |
string |
资源的名称 |
| properties |
此资源的资源特定属性。 |
|
| systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
| type |
string |
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
VirtualNetworkSubnetIpConfigurationReference
Azure 资源 ID 用于子网上资源消耗 IP 的 IP
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string (arm-id) |
网络接口的 Azure 资源 ID。 |
VirtualNetworkSubnetProperties
VirtualNetwork 子网资源
| 名称 | 类型 | 说明 |
|---|---|---|
| addressPrefix |
string |
子网 CIDR |
| ipConfigurations |
子网的IP配置列表 |
|
| natGateway |
Nat Gateway 连接到子网用于非 VNET 流量。 |
|
| networkSecurityGroup |
连接到子网的网络安全组。 |
|
| provisioningState |
虚拟网络子网资源的配置状态。 |
|
| routeTable |
路由表定义子网的自定义路由。 |
|
| status |
虚拟网络子网资源的观察状态。 |
VirtualNetworkSubnetStatus
虚拟网络子网作状态
| 名称 | 类型 | 说明 |
|---|---|---|
| errorCode |
string |
VirtualNetworkSubnet 配置错误代码 |
| errorMessage |
string |
描述性错误消息 |
| provisioningStatus |
公共IP配置状态 |
VirtualNetworkSubnetStatusProvisioningStatus
虚拟网络子网作状态
| 名称 | 类型 | 说明 |
|---|---|---|
| operationId |
string |
虚拟网络子网执行作的ID |
| status |
虚拟网络子网执行作的状态 [成功,失败,进行中] |