Ruft alle Routentabellen ab, die auf eine Netzwerkschnittstelle angewendet werden.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable?api-version=2024-05-01
URI-Parameter
Name |
In |
Erforderlich |
Typ |
Beschreibung |
networkInterfaceName
|
path |
True
|
string
|
Der Name der Netzwerkschnittstelle.
|
resourceGroupName
|
path |
True
|
string
|
Der Name der Ressourcengruppe.
|
subscriptionId
|
path |
True
|
string
|
Die Abonnementanmeldeinformationen, die das Microsoft Azure-Abonnement eindeutig identifizieren. Die Abonnement-ID ist Teil des URI für jeden Dienstaufruf.
|
api-version
|
query |
True
|
string
|
Client-API-Version.
|
Antworten
Name |
Typ |
Beschreibung |
200 OK
|
EffectiveRouteListResult
|
Anforderung erfolgreich. Der Vorgang gibt eine Liste der EffectRoute-Ressourcen zurück.
|
202 Accepted
|
|
Angenommen und der Vorgang wird asynchron abgeschlossen.
|
Other Status Codes
|
CloudError
|
Fehlerantwort, die beschreibt, warum der Vorgang fehlgeschlagen ist.
|
Sicherheit
azure_auth
Azure Active Directory OAuth2-Fluss.
Typ:
oauth2
Ablauf:
implicit
Autorisierungs-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiche
Name |
Beschreibung |
user_impersonation
|
Identitätswechsel ihres Benutzerkontos
|
Beispiele
Show network interface effective route tables
Beispielanforderung
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1/effectiveRouteTable?api-version=2024-05-01
/**
* Samples for NetworkInterfaces GetEffectiveRouteTable.
*/
public final class Main {
/*
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/2024-05-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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/2024-05-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 Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-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
Beispiel für eine Antwort
{
"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=2024-05-01
Definitionen
CloudError
Eine Fehlerantwort des Diensts.
CloudErrorBody
Eine Fehlerantwort des Diensts.
Name |
Typ |
Beschreibung |
code
|
string
|
Ein Bezeichner für den Fehler. Codes sind unveränderlich und sollen programmgesteuert genutzt werden.
|
details
|
CloudErrorBody[]
|
Eine Liste mit zusätzlichen Details zum Fehler.
|
message
|
string
|
Eine Meldung, die den Fehler beschreibt, der für die Anzeige in einer Benutzeroberfläche geeignet ist.
|
target
|
string
|
Das Ziel des bestimmten Fehlers. Beispielsweise der Name der Eigenschaft im Fehler.
|
EffectiveRoute
Effektive Route.
Name |
Typ |
Beschreibung |
addressPrefix
|
string[]
|
Die Adresspräfixe der effektiven Routen in CIDR-Notation.
|
disableBgpRoutePropagation
|
boolean
|
Bei "true" werden lokale Routen nicht an die Netzwerkschnittstellen im Subnetz weitergegeben.
|
name
|
string
|
Der Name der benutzerdefinierten Route. Dies ist optional.
|
nextHopIpAddress
|
string[]
|
Die IP-Adresse des nächsten Hops der effektiven Route.
|
nextHopType
|
RouteNextHopType
|
Der Typ des Azure-Hops, an den das Paket gesendet werden soll.
|
source
|
EffectiveRouteSource
|
Wer die Route erstellt hat.
|
state
|
EffectiveRouteState
|
Der Wert der effektiven Route.
|
EffectiveRouteListResult
Antwort für listenwirksamen Routen-API-Dienstaufruf.
Name |
Typ |
Beschreibung |
nextLink
|
string
|
Die URL, um den nächsten Satz von Ergebnissen abzurufen.
|
value
|
EffectiveRoute[]
|
Eine Liste der effektiven Routen.
|
EffectiveRouteSource
Wer die Route erstellt hat.
Name |
Typ |
Beschreibung |
Default
|
string
|
|
Unknown
|
string
|
|
User
|
string
|
|
VirtualNetworkGateway
|
string
|
|
EffectiveRouteState
Der Wert der effektiven Route.
Name |
Typ |
Beschreibung |
Active
|
string
|
|
Invalid
|
string
|
|
RouteNextHopType
Der Typ des Azure-Hops, an den das Paket gesendet werden soll.
Name |
Typ |
Beschreibung |
Internet
|
string
|
|
None
|
string
|
|
VirtualAppliance
|
string
|
|
VirtualNetworkGateway
|
string
|
|
VnetLocal
|
string
|
|