Hiermee worden alle routetabellen op een netwerkinterface toegepast.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable?api-version=2024-05-01
URI-parameters
Name |
In |
Vereist |
Type |
Description |
networkInterfaceName
|
path |
True
|
string
|
De naam van de netwerkinterface.
|
resourceGroupName
|
path |
True
|
string
|
De naam van de resourcegroep.
|
subscriptionId
|
path |
True
|
string
|
De abonnementsreferenties waarmee het Microsoft Azure-abonnement uniek wordt geïdentificeerd. De abonnements-id maakt deel uit van de URI voor elke serviceoproep.
|
api-version
|
query |
True
|
string
|
Client-API-versie.
|
Antwoorden
Name |
Type |
Description |
200 OK
|
EffectiveRouteListResult
|
Aanvraag is voltooid. De bewerking retourneert een lijst met EffectRoute-resources.
|
202 Accepted
|
|
Geaccepteerd en de bewerking wordt asynchroon voltooid.
|
Other Status Codes
|
CloudError
|
Foutreactie waarin wordt beschreven waarom de bewerking is mislukt.
|
Beveiliging
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
Name |
Description |
user_impersonation
|
Uw gebruikersaccount imiteren
|
Voorbeelden
Show network interface effective route tables
Voorbeeldaanvraag
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
Voorbeeldrespons
{
"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
Definities
CloudError
Object
Een foutreactie van de service.
CloudErrorBody
Object
Een foutreactie van de service.
Name |
Type |
Description |
code
|
string
|
Een id voor de fout. Codes zijn invariant en zijn bedoeld om programmatisch te worden gebruikt.
|
details
|
CloudErrorBody[]
|
Een lijst met aanvullende informatie over de fout.
|
message
|
string
|
Een bericht met een beschrijving van de fout, bedoeld om te worden weergegeven in een gebruikersinterface.
|
target
|
string
|
Het doel van de specifieke fout. Bijvoorbeeld de naam van de eigenschap in fout.
|
EffectiveRoute
Object
Effectieve route.
Name |
Type |
Description |
addressPrefix
|
string[]
|
De adresvoorvoegsels van de effectieve routes in CIDR-notatie.
|
disableBgpRoutePropagation
|
boolean
|
Indien waar, worden on-premises routes niet doorgegeven aan de netwerkinterfaces in het subnet.
|
name
|
string
|
De naam van de door de gebruiker gedefinieerde route. Dit is optioneel.
|
nextHopIpAddress
|
string[]
|
Het IP-adres van de volgende hop van de effectieve route.
|
nextHopType
|
RouteNextHopType
|
Het type Azure-hop waar het pakket naartoe moet worden verzonden.
|
source
|
EffectiveRouteSource
|
Wie heeft de route gemaakt.
|
state
|
EffectiveRouteState
|
De waarde van effectieve route.
|
EffectiveRouteListResult
Object
Antwoord voor een lijst met effectieve route-API-service-aanroep.
Name |
Type |
Description |
nextLink
|
string
|
De URL voor het ophalen van de volgende set resultaten.
|
value
|
EffectiveRoute[]
|
Een lijst met effectieve routes.
|
EffectiveRouteSource
Enumeration
Wie heeft de route gemaakt.
Waarde |
Description |
Default
|
|
Unknown
|
|
User
|
|
VirtualNetworkGateway
|
|
EffectiveRouteState
Enumeration
De waarde van effectieve route.
Waarde |
Description |
Active
|
|
Invalid
|
|
RouteNextHopType
Enumeration
Het type Azure-hop waar het pakket naartoe moet worden verzonden.
Waarde |
Description |
Internet
|
|
None
|
|
VirtualAppliance
|
|
VirtualNetworkGateway
|
|
VnetLocal
|
|