Lekéri a hálózati adapterre alkalmazott összes útvonaltáblát.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable?api-version=2023-09-01
URI-paraméterek
Name |
In |
Kötelező |
Típus |
Description |
networkInterfaceName
|
path |
True
|
string
|
A hálózati adapter neve.
|
resourceGroupName
|
path |
True
|
string
|
Az erőforráscsoport neve.
|
subscriptionId
|
path |
True
|
string
|
Az előfizetés hitelesítő adatai, amelyek egyedileg azonosítják a Microsoft Azure-előfizetést. Az előfizetés-azonosító az URI részét képezi minden szolgáltatáshíváshoz.
|
api-version
|
query |
True
|
string
|
Ügyfél API-verziója.
|
Válaszok
Name |
Típus |
Description |
200 OK
|
EffectiveRouteListResult
|
A kérés sikeres. A művelet az EffectRoute-erőforrások listáját adja vissza.
|
202 Accepted
|
|
Elfogadva, és a művelet aszinkron módon fejeződik be.
|
Other Status Codes
|
CloudError
|
Hibaválasz, amely leírja, hogy a művelet miért hiúsult meg.
|
Biztonság
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
felhasználói fiók megszemélyesítése
|
Példák
Show network interface effective route tables
Sample Request
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1/effectiveRouteTable?api-version=2023-09-01
/**
* Samples for NetworkInterfaces GetEffectiveRouteTable.
*/
public final class Main {
/*
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/
* NetworkInterfaceEffectiveRouteTableList.json
*/
/**
* Sample code: Show network interface effective route tables.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void showNetworkInterfaceEffectiveRouteTables(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getNetworkInterfaces().getEffectiveRouteTable("rg1", "nic1",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python network_interface_effective_route_table_list.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.network_interfaces.begin_get_effective_route_table(
resource_group_name="rg1",
network_interface_name="nic1",
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/NetworkInterfaceEffectiveRouteTableList.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/NetworkInterfaceEffectiveRouteTableList.json
func ExampleInterfacesClient_BeginGetEffectiveRouteTable() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewInterfacesClient().BeginGetEffectiveRouteTable(ctx, "rg1", "nic1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.EffectiveRouteListResult = armnetwork.EffectiveRouteListResult{
// Value: []*armnetwork.EffectiveRoute{
// {
// AddressPrefix: []*string{
// to.Ptr("172.20.2.0/24")},
// NextHopIPAddress: []*string{
// },
// NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVnetLocal),
// Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault),
// State: to.Ptr(armnetwork.EffectiveRouteStateActive),
// },
// {
// AddressPrefix: []*string{
// to.Ptr("0.0.0.0/0")},
// NextHopIPAddress: []*string{
// },
// NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet),
// Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault),
// State: to.Ptr(armnetwork.EffectiveRouteStateActive),
// },
// {
// AddressPrefix: []*string{
// to.Ptr("10.0.0.0/8")},
// NextHopIPAddress: []*string{
// },
// NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone),
// Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault),
// State: to.Ptr(armnetwork.EffectiveRouteStateActive),
// },
// {
// AddressPrefix: []*string{
// to.Ptr("100.64.0.0/10")},
// NextHopIPAddress: []*string{
// },
// NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone),
// Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault),
// State: to.Ptr(armnetwork.EffectiveRouteStateActive),
// },
// {
// AddressPrefix: []*string{
// to.Ptr("172.16.0.0/12")},
// NextHopIPAddress: []*string{
// },
// NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone),
// Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault),
// State: to.Ptr(armnetwork.EffectiveRouteStateActive),
// },
// {
// AddressPrefix: []*string{
// to.Ptr("192.168.0.0/16")},
// NextHopIPAddress: []*string{
// },
// NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone),
// Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault),
// State: to.Ptr(armnetwork.EffectiveRouteStateActive),
// }},
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets all route tables applied to a network interface.
*
* @summary Gets all route tables applied to a network interface.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/NetworkInterfaceEffectiveRouteTableList.json
*/
async function showNetworkInterfaceEffectiveRouteTables() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const networkInterfaceName = "nic1";
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.networkInterfaces.beginGetEffectiveRouteTableAndWait(
resourceGroupName,
networkInterfaceName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Network;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/NetworkInterfaceEffectiveRouteTableList.json
// this example is just showing the usage of "NetworkInterfaces_GetEffectiveRouteTable" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this NetworkInterfaceResource created on azure
// for more information of creating NetworkInterfaceResource, please refer to the document of NetworkInterfaceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string networkInterfaceName = "nic1";
ResourceIdentifier networkInterfaceResourceId = NetworkInterfaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkInterfaceName);
NetworkInterfaceResource networkInterface = client.GetNetworkInterfaceResource(networkInterfaceResourceId);
// invoke the operation
ArmOperation<EffectiveRouteListResult> lro = await networkInterface.GetEffectiveRouteTableAsync(WaitUntil.Completed);
EffectiveRouteListResult result = lro.Value;
Console.WriteLine($"Succeeded: {result}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"source": "Default",
"state": "Active",
"addressPrefix": [
"172.20.2.0/24"
],
"nextHopType": "VnetLocal",
"nextHopIpAddress": []
},
{
"source": "Default",
"state": "Active",
"addressPrefix": [
"0.0.0.0/0"
],
"nextHopType": "Internet",
"nextHopIpAddress": []
},
{
"source": "Default",
"state": "Active",
"addressPrefix": [
"10.0.0.0/8"
],
"nextHopType": "None",
"nextHopIpAddress": []
},
{
"source": "Default",
"state": "Active",
"addressPrefix": [
"100.64.0.0/10"
],
"nextHopType": "None",
"nextHopIpAddress": []
},
{
"source": "Default",
"state": "Active",
"addressPrefix": [
"172.16.0.0/12"
],
"nextHopType": "None",
"nextHopIpAddress": []
},
{
"source": "Default",
"state": "Active",
"addressPrefix": [
"192.168.0.0/16"
],
"nextHopType": "None",
"nextHopIpAddress": []
}
]
}
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1/operationResults/00000000-0000-0000-0000-000000000000?api-version=2023-09-01
Definíciók
CloudError
Hibaválasz a szolgáltatástól.
CloudErrorBody
Hibaválasz a szolgáltatástól.
Name |
Típus |
Description |
code
|
string
|
A hiba azonosítója. A kódok invariánsak, és programozott módon használhatók.
|
details
|
CloudErrorBody[]
|
A hibával kapcsolatos további részletek listája.
|
message
|
string
|
A hibát leíró üzenet, amely alkalmas a felhasználói felületen való megjelenítésre.
|
target
|
string
|
Az adott hiba célja. Például a hibás tulajdonság neve.
|
EffectiveRoute
Érvényes útvonal.
Name |
Típus |
Description |
addressPrefix
|
string[]
|
A CIDR-jelölésben szereplő érvényes útvonalak címelőtagjai.
|
disableBgpRoutePropagation
|
boolean
|
Ha igaz, a helyszíni útvonalak nem lesznek propagálva az alhálózat hálózati adapterein.
|
name
|
string
|
A felhasználó által megadott útvonal neve. Ez nem kötelező.
|
nextHopIpAddress
|
string[]
|
Az érvényes útvonal következő ugrásának IP-címe.
|
nextHopType
|
RouteNextHopType
|
Az Azure ugrás típusa, amellyel a csomagot küldeni kell.
|
source
|
EffectiveRouteSource
|
Ki hozta létre az útvonalat.
|
state
|
EffectiveRouteState
|
A tényleges útvonal értéke.
|
EffectiveRouteListResult
Válasz az érvényes útvonal API-szolgáltatáshívások listájára.
Name |
Típus |
Description |
nextLink
|
string
|
A következő eredményhalmaz lekéréséhez tartozó URL-cím.
|
value
|
EffectiveRoute[]
|
A hatékony útvonalak listája.
|
EffectiveRouteSource
Ki hozta létre az útvonalat.
Name |
Típus |
Description |
Default
|
string
|
|
Unknown
|
string
|
|
User
|
string
|
|
VirtualNetworkGateway
|
string
|
|
EffectiveRouteState
A tényleges útvonal értéke.
Name |
Típus |
Description |
Active
|
string
|
|
Invalid
|
string
|
|
RouteNextHopType
Az Azure ugrás típusa, amellyel a csomagot küldeni kell.
Name |
Típus |
Description |
Internet
|
string
|
|
None
|
string
|
|
VirtualAppliance
|
string
|
|
VirtualNetworkGateway
|
string
|
|
VnetLocal
|
string
|
|