一组用于选择新的或现有公共 IP 地址的控件。
UI 示例

- 如果用户针对公共 IP 地址选择了“None”,则域名标签文本框会被隐藏。
- 如果用户选择了一个现有公共 IP 地址,则域名标签文本框会被禁用。 它的值是所选 IP 地址的域名标签。
- 域名后缀(例如 chinanorth.cloudapp.chinacloudapi.cn)会基于所选位置自动更新。
架构
{
"name": "element1",
"type": "Microsoft.Network.PublicIpAddressCombo",
"label": {
"publicIpAddress": "Public IP address",
"domainNameLabel": "Domain name label"
},
"toolTip": {
"publicIpAddress": "",
"domainNameLabel": ""
},
"defaultValue": {
"publicIpAddressName": "ip01",
"domainNameLabel": "mydomain"
},
"constraints": {
"required": {
"domainNameLabel": true
}
},
"options": {
"hideNone": false,
"hideDomainNameLabel": false,
"hideExisting": false,
"zone": 3
},
"visible": true
}
示例输出
如果用户未选择公共 IP 地址,则控件返回以下输出:
{
"newOrExistingOrNone": "none"
}
如果用户选择了新的或现有 IP 地址,则控件返回以下输出:
{
"name": "ip01",
"resourceGroup": "rg01",
"domainNameLabel": "mydomain",
"publicIPAllocationMethod": "Dynamic",
"sku": "Basic",
"newOrExistingOrNone": "new"
}
- 如果
options.hideNone指定为true,则newOrExistingOrNone只有值new或existing。 - 如果
options.hideDomainNameLabel指定为true,将取消声明domainNameLabel。
注解
- 如果
constraints.required.domainNameLabel设置为true,则用户在创建新的公共 IP 地址时必须提供域名标签。 没有标签的现有公共 IP 地址不可供选择。 - 如果
options.hideNone设置为true,则用于为公共 IP 地址选择“无”的选项会被隐藏。 默认值为false。 - 如果
options.hideDomainNameLabel设置为true,则域名标签的文本框会被隐藏。 默认值为false。 - 如果
options.hideExisting为 true,则用户无法选择现有的公共 IP 地址。 默认值为false。 - 对于
zone,仅指定区域的公共 IP 地址或区域复原公共 IP 地址可用。
后续步骤
- 有关创建 UI 定义的简介,请参阅 CreateUiDefinition 入门。
- 有关 UI 元素中的公用属性的说明,请参阅 CreateUiDefinition 元素。