Lekéri az összes VirtualHubBgpConnections adatait.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections?api-version=2023-09-01
URI-paraméterek
Name |
In |
Kötelező |
Típus |
Description |
resourceGroupName
|
path |
True
|
string
|
A VirtualHub erőforráscsoportjának 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.
|
virtualHubName
|
path |
True
|
string
|
A VirtualHub neve.
|
api-version
|
query |
True
|
string
|
Ügyfél API-verziója.
|
Válaszok
Name |
Típus |
Description |
200 OK
|
ListVirtualHubBgpConnectionResults
|
A kérés sikeres. A VirtualHub összes VirtualHubBgpConnections elemének adatait adja vissza.
|
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
VirtualHubRouteTableV2List
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections?api-version=2023-09-01
/**
* Samples for VirtualHubBgpConnections List.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/VirtualHubBgpConnectionList.
* json
*/
/**
* Sample code: VirtualHubRouteTableV2List.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void virtualHubRouteTableV2List(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getVirtualHubBgpConnections().list("rg1", "hub1",
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 virtual_hub_bgp_connection_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.virtual_hub_bgp_connections.list(
resource_group_name="rg1",
virtual_hub_name="hub1",
)
for item in response:
print(item)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/VirtualHubBgpConnectionList.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/VirtualHubBgpConnectionList.json
func ExampleVirtualHubBgpConnectionsClient_NewListPager() {
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)
}
pager := clientFactory.NewVirtualHubBgpConnectionsClient().NewListPager("rg1", "hub1", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.ListVirtualHubBgpConnectionResults = armnetwork.ListVirtualHubBgpConnectionResults{
// Value: []*armnetwork.BgpConnection{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"),
// Name: to.Ptr("conn1"),
// Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""),
// Properties: &armnetwork.BgpConnectionProperties{
// ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected),
// HubVirtualNetworkConnection: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"),
// },
// PeerAsn: to.Ptr[int64](20000),
// PeerIP: to.Ptr("192.168.1.5"),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// },
// }},
// }
}
}
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 Retrieves the details of all VirtualHubBgpConnections.
*
* @summary Retrieves the details of all VirtualHubBgpConnections.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/VirtualHubBgpConnectionList.json
*/
async function virtualHubRouteTableV2List() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const virtualHubName = "hub1";
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualHubBgpConnections.list(resourceGroupName, virtualHubName)) {
resArray.push(item);
}
console.log(resArray);
}
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;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/VirtualHubBgpConnectionList.json
// this example is just showing the usage of "VirtualHubBgpConnections_List" 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 VirtualHubResource created on azure
// for more information of creating VirtualHubResource, please refer to the document of VirtualHubResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string virtualHubName = "hub1";
ResourceIdentifier virtualHubResourceId = VirtualHubResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, virtualHubName);
VirtualHubResource virtualHub = client.GetVirtualHubResource(virtualHubResourceId);
// get the collection of this BgpConnectionResource
BgpConnectionCollection collection = virtualHub.GetBgpConnections();
// invoke the operation and iterate over the result
await foreach (BgpConnectionResource item in collection.GetAllAsync())
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BgpConnectionData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
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": [
{
"name": "conn1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1",
"etag": "W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\"",
"properties": {
"provisioningState": "Succeeded",
"peerIp": "192.168.1.5",
"peerAsn": 20000,
"connectionState": "Connected",
"hubVirtualNetworkConnection": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"
}
}
}
]
}
Definíciók
BgpConnection
Virtuális berendezés helyerőforrása.
Name |
Típus |
Description |
etag
|
string
|
Egyedi írásvédett sztring, amely az erőforrás frissítésekor változik.
|
id
|
string
|
Erőforrás-azonosító.
|
name
|
string
|
A kapcsolat neve.
|
properties.connectionState
|
HubBgpConnectionStatus
|
A VirtualHub to Peer aktuális állapota.
|
properties.hubVirtualNetworkConnection
|
SubResource
|
A HubVirtualNetworkConnection erőforrásra mutató hivatkozás.
|
properties.peerAsn
|
integer
|
A társcsomópont ASN-je.
|
properties.peerIp
|
string
|
Társ IP-címe.
|
properties.provisioningState
|
ProvisioningState
|
Az erőforrás kiépítési állapota.
|
type
|
string
|
Kapcsolat típusa.
|
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.
|
HubBgpConnectionStatus
A VirtualHub to Peer aktuális állapota.
Name |
Típus |
Description |
Connected
|
string
|
|
Connecting
|
string
|
|
NotConnected
|
string
|
|
Unknown
|
string
|
|
ListVirtualHubBgpConnectionResults
VirtualHubBgpConnections lista.
Name |
Típus |
Description |
nextLink
|
string
|
URL-cím a következő eredménykészlet lekéréséhez.
|
value
|
BgpConnection[]
|
A VirtualHubBgpConnections listája.
|
ProvisioningState
Az aktuális kiépítési állapot.
Name |
Típus |
Description |
Deleting
|
string
|
|
Failed
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
SubResource
Hivatkozás egy másik alforrásra.
Name |
Típus |
Description |
id
|
string
|
Erőforrás-azonosító.
|