Virtual Networks - List
List virtual networks in a given lab.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks?api-version=2018-09-15
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks?$expand={$expand}&$filter={$filter}&$top={$top}&$orderby={$orderby}&api-version=2018-09-15
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
lab
|
path | True |
string |
The name of the lab. |
resource
|
path | True |
string |
The name of the resource group. |
subscription
|
path | True |
string |
The subscription ID. |
api-version
|
query | True |
string |
Client API version. |
$expand
|
query |
string |
Specify the $expand query. Example: 'properties($expand=externalSubnets)' |
|
$filter
|
query |
string |
The filter to apply to the operation. Example: '$filter=contains(name,'myName') |
|
$orderby
|
query |
string |
The ordering expression for the results, using OData notation. Example: '$orderby=name desc' |
|
$top
|
query |
integer int32 |
The maximum number of resources to return from the operation. Example: '$top=10' |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
|
Other Status Codes |
BadRequest |
Security
azure_auth
OAuth2 Implicit Grant
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | Access Microsoft Azure |
Examples
VirtualNetworks_List
Sample Request
Sample Response
{
"value": [
{
"properties": {
"allowedSubnets": [
{
"resourceId": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet",
"labSubnetName": "{virtualNetworkName}Subnet",
"allowPublicIp": "Allow"
}
],
"externalProviderResourceId": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}",
"subnetOverrides": [
{
"resourceId": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet",
"labSubnetName": "{virtualNetworkName}Subnet",
"useInVmCreationPermission": "Allow",
"usePublicIpAddressPermission": "Allow",
"sharedPublicIpAddressConfiguration": {
"allowedPorts": [
{
"transportProtocol": "Tcp",
"backendPort": 3389
},
{
"transportProtocol": "Tcp",
"backendPort": 22
}
]
}
}
],
"createdDate": "2018-10-01T13:01:44.6005134-07:00",
"provisioningState": "Succeeded",
"uniqueIdentifier": "{uniqueIdentifier}"
},
"id": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}",
"name": "{virtualNetworkName}",
"type": "Microsoft.DevTestLab/labs/virtualNetworks",
"tags": {
"tagName1": "tagValue1"
}
}
]
}
Definitions
Name | Description |
---|---|
Cloud |
Error from a REST request. |
Cloud |
Body of an error from a REST request. |
External |
Subnet information as returned by the Microsoft.Network API. |
Port |
Properties of a network port. |
Subnet |
Subnet information. |
Subnet |
Property overrides on a subnet of a virtual network. |
Subnet |
Configuration for public IP address sharing. |
Transport |
The transport protocol for the endpoint. |
Usage |
The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)). |
Virtual |
A virtual network. |
Virtual |
The response of a list operation. |
CloudError
Error from a REST request.
Name | Type | Description |
---|---|---|
error |
The cloud error that occurred |
CloudErrorBody
Body of an error from a REST request.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
details |
Inner errors. |
|
message |
string |
The error message. |
target |
string |
The error target. |
ExternalSubnet
Subnet information as returned by the Microsoft.Network API.
Name | Type | Description |
---|---|---|
id |
string |
Gets or sets the identifier. |
name |
string |
Gets or sets the name. |
Port
Properties of a network port.
Name | Type | Description |
---|---|---|
backendPort |
integer |
Backend port of the target virtual machine. |
transportProtocol |
Protocol type of the port. |
Subnet
Subnet information.
Name | Type | Description |
---|---|---|
allowPublicIp |
The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)). |
|
labSubnetName |
string |
The name of the subnet as seen in the lab. |
resourceId |
string |
The resource ID of the subnet. |
SubnetOverride
Property overrides on a subnet of a virtual network.
Name | Type | Description |
---|---|---|
labSubnetName |
string |
The name given to the subnet within the lab. |
resourceId |
string |
The resource ID of the subnet. |
sharedPublicIpAddressConfiguration |
Properties that virtual machines on this subnet will share. |
|
useInVmCreationPermission |
Indicates whether this subnet can be used during virtual machine creation (i.e. Allow, Deny). |
|
usePublicIpAddressPermission |
Indicates whether public IP addresses can be assigned to virtual machines on this subnet (i.e. Allow, Deny). |
|
virtualNetworkPoolName |
string |
The virtual network pool associated with this subnet. |
SubnetSharedPublicIpAddressConfiguration
Configuration for public IP address sharing.
Name | Type | Description |
---|---|---|
allowedPorts |
Port[] |
Backend ports that virtual machines on this subnet are allowed to expose |
TransportProtocol
The transport protocol for the endpoint.
Name | Type | Description |
---|---|---|
Tcp |
string |
|
Udp |
string |
UsagePermissionType
The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)).
Name | Type | Description |
---|---|---|
Allow |
string |
|
Default |
string |
|
Deny |
string |
VirtualNetwork
A virtual network.
Name | Type | Description |
---|---|---|
id |
string |
The identifier of the resource. |
location |
string |
The location of the resource. |
name |
string |
The name of the resource. |
properties.allowedSubnets |
Subnet[] |
The allowed subnets of the virtual network. |
properties.createdDate |
string |
The creation date of the virtual network. |
properties.description |
string |
The description of the virtual network. |
properties.externalProviderResourceId |
string |
The Microsoft.Network resource identifier of the virtual network. |
properties.externalSubnets |
The external subnet properties. |
|
properties.provisioningState |
string |
The provisioning status of the resource. |
properties.subnetOverrides |
The subnet overrides of the virtual network. |
|
properties.uniqueIdentifier |
string |
The unique immutable identifier of a resource (Guid). |
tags |
object |
The tags of the resource. |
type |
string |
The type of the resource. |
VirtualNetworkList
The response of a list operation.
Name | Type | Description |
---|---|---|
nextLink |
string |
Link for next set of results. |
value |
Results of the list operation. |