Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
Berechtigungstyp
Berechtigung mit den geringsten Rechten
Berechtigungen mit höheren Berechtigungen
Delegiert (Geschäfts-, Schul- oder Unikonto)
Nicht unterstützt
Nicht unterstützt
Delegiert (persönliches Microsoft-Konto)
Nicht unterstützt
Nicht unterstützt
Anwendung
Nicht unterstützt
Nicht unterstützt
Wichtig
In delegierten Szenarien mit Geschäfts-, Schul- oder Unikonten muss dem angemeldeten Benutzer eine unterstützte Microsoft Entra Rolle oder eine benutzerdefinierte Rolle mit einer unterstützten Rollenberechtigung zugewiesen werden. Die folgenden Rollen mit den geringsten Berechtigungen werden für diesen Vorgang unterstützt.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Networkaccess;
var requestBody = new RemoteNetwork
{
Name = "Bellevue branch",
Region = Region.CanadaEast,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.NetworkAccess.Connectivity.RemoteNetworks.PostAsync(requestBody);
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelsnetworkaccess "github.com/microsoftgraph/msgraph-beta-sdk-go/models/networkaccess"
//other-imports
)
requestBody := graphmodelsnetworkaccess.NewRemoteNetwork()
name := "Bellevue branch"
requestBody.SetName(&name)
region := graphmodels.CANADAEAST_REGION
requestBody.SetRegion(®ion)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
remoteNetworks, err := graphClient.NetworkAccess().Connectivity().RemoteNetworks().Post(context.Background(), requestBody, nil)
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.networkaccess.RemoteNetwork remoteNetwork = new com.microsoft.graph.beta.models.networkaccess.RemoteNetwork();
remoteNetwork.setName("Bellevue branch");
remoteNetwork.setRegion(com.microsoft.graph.beta.models.networkaccess.Region.CanadaEast);
com.microsoft.graph.models.networkaccess.RemoteNetwork result = graphClient.networkAccess().connectivity().remoteNetworks().post(remoteNetwork);
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\RemoteNetwork;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\Region;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new RemoteNetwork();
$requestBody->setName('Bellevue branch');
$requestBody->setRegion(new Region('canadaEast'));
$result = $graphServiceClient->networkAccess()->connectivity()->remoteNetworks()->post($requestBody)->wait();
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
Import-Module Microsoft.Graph.Beta.NetworkAccess
$params = @{
name = "Bellevue branch"
region = "canadaEast"
}
New-MgBetaNetworkAccessConnectivityRemoteNetwork -BodyParameter $params
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.networkaccess.remote_network import RemoteNetwork
from msgraph_beta.generated.models.region import Region
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RemoteNetwork(
name = "Bellevue branch",
region = Region.CanadaEast,
)
result = await graph_client.network_access.connectivity.remote_networks.post(request_body)
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Networkaccess;
var requestBody = new RemoteNetwork
{
Name = "Bellevue branch w/ fwd profile",
Region = Region.CanadaEast,
ForwardingProfiles = new List<ForwardingProfile>
{
new ForwardingProfile
{
Id = "1adaf535-1e31-4e14-983f-2270408162bf",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.NetworkAccess.Connectivity.RemoteNetworks.PostAsync(requestBody);
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelsnetworkaccess "github.com/microsoftgraph/msgraph-beta-sdk-go/models/networkaccess"
//other-imports
)
requestBody := graphmodelsnetworkaccess.NewRemoteNetwork()
name := "Bellevue branch w/ fwd profile"
requestBody.SetName(&name)
region := graphmodels.CANADAEAST_REGION
requestBody.SetRegion(®ion)
forwardingProfile := graphmodelsnetworkaccess.NewForwardingProfile()
id := "1adaf535-1e31-4e14-983f-2270408162bf"
forwardingProfile.SetId(&id)
forwardingProfiles := []graphmodelsnetworkaccess.ForwardingProfileable {
forwardingProfile,
}
requestBody.SetForwardingProfiles(forwardingProfiles)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
remoteNetworks, err := graphClient.NetworkAccess().Connectivity().RemoteNetworks().Post(context.Background(), requestBody, nil)
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.networkaccess.RemoteNetwork remoteNetwork = new com.microsoft.graph.beta.models.networkaccess.RemoteNetwork();
remoteNetwork.setName("Bellevue branch w/ fwd profile");
remoteNetwork.setRegion(com.microsoft.graph.beta.models.networkaccess.Region.CanadaEast);
LinkedList<com.microsoft.graph.beta.models.networkaccess.ForwardingProfile> forwardingProfiles = new LinkedList<com.microsoft.graph.beta.models.networkaccess.ForwardingProfile>();
com.microsoft.graph.beta.models.networkaccess.ForwardingProfile forwardingProfile = new com.microsoft.graph.beta.models.networkaccess.ForwardingProfile();
forwardingProfile.setId("1adaf535-1e31-4e14-983f-2270408162bf");
forwardingProfiles.add(forwardingProfile);
remoteNetwork.setForwardingProfiles(forwardingProfiles);
com.microsoft.graph.models.networkaccess.RemoteNetwork result = graphClient.networkAccess().connectivity().remoteNetworks().post(remoteNetwork);
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\RemoteNetwork;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\Region;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\ForwardingProfile;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new RemoteNetwork();
$requestBody->setName('Bellevue branch w/ fwd profile');
$requestBody->setRegion(new Region('canadaEast'));
$forwardingProfilesForwardingProfile1 = new ForwardingProfile();
$forwardingProfilesForwardingProfile1->setId('1adaf535-1e31-4e14-983f-2270408162bf');
$forwardingProfilesArray []= $forwardingProfilesForwardingProfile1;
$requestBody->setForwardingProfiles($forwardingProfilesArray);
$result = $graphServiceClient->networkAccess()->connectivity()->remoteNetworks()->post($requestBody)->wait();
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
Import-Module Microsoft.Graph.Beta.NetworkAccess
$params = @{
name = "Bellevue branch w/ fwd profile"
region = "canadaEast"
forwardingProfiles = @(
@{
id = "1adaf535-1e31-4e14-983f-2270408162bf"
}
)
}
New-MgBetaNetworkAccessConnectivityRemoteNetwork -BodyParameter $params
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.networkaccess.remote_network import RemoteNetwork
from msgraph_beta.generated.models.region import Region
from msgraph_beta.generated.models.networkaccess.forwarding_profile import ForwardingProfile
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RemoteNetwork(
name = "Bellevue branch w/ fwd profile",
region = Region.CanadaEast,
forwarding_profiles = [
ForwardingProfile(
id = "1adaf535-1e31-4e14-983f-2270408162bf",
),
],
)
result = await graph_client.network_access.connectivity.remote_networks.post(request_body)
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Networkaccess;
var requestBody = new RemoteNetwork
{
Name = "Bellevue branch w/ device link",
Region = Region.CanadaEast,
ForwardingProfiles = new List<ForwardingProfile>
{
new ForwardingProfile
{
Id = "1adaf535-1e31-4e14-983f-2270408162bf",
},
},
DeviceLinks = new List<DeviceLink>
{
new DeviceLink
{
Name = "CPE1",
IpAddress = "52.13.21.25",
BandwidthCapacityInMbps = BandwidthCapacityInMbps.Mbps500,
DeviceVendor = DeviceVendor.BarracudaNetworks,
BgpConfiguration = new BgpConfiguration
{
LocalIpAddress = "192.168.1.2",
PeerIpAddress = "10.1.1.2",
Asn = 65533,
},
RedundancyConfiguration = new RedundancyConfiguration
{
ZoneLocalIpAddress = null,
RedundancyTier = RedundancyTier.NoRedundancy,
},
TunnelConfiguration = new TunnelConfigurationIKEv2Default
{
OdataType = "#microsoft.graph.networkaccess.tunnelConfigurationIKEv2Default",
PreSharedKey = "test123",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.NetworkAccess.Connectivity.RemoteNetworks.PostAsync(requestBody);
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelsnetworkaccess "github.com/microsoftgraph/msgraph-beta-sdk-go/models/networkaccess"
//other-imports
)
requestBody := graphmodelsnetworkaccess.NewRemoteNetwork()
name := "Bellevue branch w/ device link"
requestBody.SetName(&name)
region := graphmodels.CANADAEAST_REGION
requestBody.SetRegion(®ion)
forwardingProfile := graphmodelsnetworkaccess.NewForwardingProfile()
id := "1adaf535-1e31-4e14-983f-2270408162bf"
forwardingProfile.SetId(&id)
forwardingProfiles := []graphmodelsnetworkaccess.ForwardingProfileable {
forwardingProfile,
}
requestBody.SetForwardingProfiles(forwardingProfiles)
deviceLink := graphmodelsnetworkaccess.NewDeviceLink()
name := "CPE1"
deviceLink.SetName(&name)
ipAddress := "52.13.21.25"
deviceLink.SetIpAddress(&ipAddress)
bandwidthCapacityInMbps := graphmodels.MBPS500_BANDWIDTHCAPACITYINMBPS
deviceLink.SetBandwidthCapacityInMbps(&bandwidthCapacityInMbps)
deviceVendor := graphmodels.BARRACUDANETWORKS_DEVICEVENDOR
deviceLink.SetDeviceVendor(&deviceVendor)
bgpConfiguration := graphmodelsnetworkaccess.NewBgpConfiguration()
localIpAddress := "192.168.1.2"
bgpConfiguration.SetLocalIpAddress(&localIpAddress)
peerIpAddress := "10.1.1.2"
bgpConfiguration.SetPeerIpAddress(&peerIpAddress)
asn := int32(65533)
bgpConfiguration.SetAsn(&asn)
deviceLink.SetBgpConfiguration(bgpConfiguration)
redundancyConfiguration := graphmodelsnetworkaccess.NewRedundancyConfiguration()
zoneLocalIpAddress := null
redundancyConfiguration.SetZoneLocalIpAddress(&zoneLocalIpAddress)
redundancyTier := graphmodels.NOREDUNDANCY_REDUNDANCYTIER
redundancyConfiguration.SetRedundancyTier(&redundancyTier)
deviceLink.SetRedundancyConfiguration(redundancyConfiguration)
tunnelConfiguration := graphmodelsnetworkaccess.NewTunnelConfigurationIKEv2Default()
preSharedKey := "test123"
tunnelConfiguration.SetPreSharedKey(&preSharedKey)
deviceLink.SetTunnelConfiguration(tunnelConfiguration)
deviceLinks := []graphmodelsnetworkaccess.DeviceLinkable {
deviceLink,
}
requestBody.SetDeviceLinks(deviceLinks)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
remoteNetworks, err := graphClient.NetworkAccess().Connectivity().RemoteNetworks().Post(context.Background(), requestBody, nil)
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.networkaccess.RemoteNetwork remoteNetwork = new com.microsoft.graph.beta.models.networkaccess.RemoteNetwork();
remoteNetwork.setName("Bellevue branch w/ device link");
remoteNetwork.setRegion(com.microsoft.graph.beta.models.networkaccess.Region.CanadaEast);
LinkedList<com.microsoft.graph.beta.models.networkaccess.ForwardingProfile> forwardingProfiles = new LinkedList<com.microsoft.graph.beta.models.networkaccess.ForwardingProfile>();
com.microsoft.graph.beta.models.networkaccess.ForwardingProfile forwardingProfile = new com.microsoft.graph.beta.models.networkaccess.ForwardingProfile();
forwardingProfile.setId("1adaf535-1e31-4e14-983f-2270408162bf");
forwardingProfiles.add(forwardingProfile);
remoteNetwork.setForwardingProfiles(forwardingProfiles);
LinkedList<com.microsoft.graph.beta.models.networkaccess.DeviceLink> deviceLinks = new LinkedList<com.microsoft.graph.beta.models.networkaccess.DeviceLink>();
com.microsoft.graph.beta.models.networkaccess.DeviceLink deviceLink = new com.microsoft.graph.beta.models.networkaccess.DeviceLink();
deviceLink.setName("CPE1");
deviceLink.setIpAddress("52.13.21.25");
deviceLink.setBandwidthCapacityInMbps(com.microsoft.graph.beta.models.networkaccess.BandwidthCapacityInMbps.Mbps500);
deviceLink.setDeviceVendor(com.microsoft.graph.beta.models.networkaccess.DeviceVendor.BarracudaNetworks);
com.microsoft.graph.beta.models.networkaccess.BgpConfiguration bgpConfiguration = new com.microsoft.graph.beta.models.networkaccess.BgpConfiguration();
bgpConfiguration.setLocalIpAddress("192.168.1.2");
bgpConfiguration.setPeerIpAddress("10.1.1.2");
bgpConfiguration.setAsn(65533);
deviceLink.setBgpConfiguration(bgpConfiguration);
com.microsoft.graph.beta.models.networkaccess.RedundancyConfiguration redundancyConfiguration = new com.microsoft.graph.beta.models.networkaccess.RedundancyConfiguration();
redundancyConfiguration.setZoneLocalIpAddress(null);
redundancyConfiguration.setRedundancyTier(com.microsoft.graph.beta.models.networkaccess.RedundancyTier.NoRedundancy);
deviceLink.setRedundancyConfiguration(redundancyConfiguration);
com.microsoft.graph.beta.models.networkaccess.TunnelConfigurationIKEv2Default tunnelConfiguration = new com.microsoft.graph.beta.models.networkaccess.TunnelConfigurationIKEv2Default();
tunnelConfiguration.setOdataType("#microsoft.graph.networkaccess.tunnelConfigurationIKEv2Default");
tunnelConfiguration.setPreSharedKey("test123");
deviceLink.setTunnelConfiguration(tunnelConfiguration);
deviceLinks.add(deviceLink);
remoteNetwork.setDeviceLinks(deviceLinks);
com.microsoft.graph.models.networkaccess.RemoteNetwork result = graphClient.networkAccess().connectivity().remoteNetworks().post(remoteNetwork);
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\RemoteNetwork;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\Region;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\ForwardingProfile;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\DeviceLink;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\BandwidthCapacityInMbps;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\DeviceVendor;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\BgpConfiguration;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\RedundancyConfiguration;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\RedundancyTier;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\TunnelConfigurationIKEv2Default;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new RemoteNetwork();
$requestBody->setName('Bellevue branch w/ device link');
$requestBody->setRegion(new Region('canadaEast'));
$forwardingProfilesForwardingProfile1 = new ForwardingProfile();
$forwardingProfilesForwardingProfile1->setId('1adaf535-1e31-4e14-983f-2270408162bf');
$forwardingProfilesArray []= $forwardingProfilesForwardingProfile1;
$requestBody->setForwardingProfiles($forwardingProfilesArray);
$deviceLinksDeviceLink1 = new DeviceLink();
$deviceLinksDeviceLink1->setName('CPE1');
$deviceLinksDeviceLink1->setIpAddress('52.13.21.25');
$deviceLinksDeviceLink1->setBandwidthCapacityInMbps(new BandwidthCapacityInMbps('mbps500'));
$deviceLinksDeviceLink1->setDeviceVendor(new DeviceVendor('barracudaNetworks'));
$deviceLinksDeviceLink1BgpConfiguration = new BgpConfiguration();
$deviceLinksDeviceLink1BgpConfiguration->setLocalIpAddress('192.168.1.2');
$deviceLinksDeviceLink1BgpConfiguration->setPeerIpAddress('10.1.1.2');
$deviceLinksDeviceLink1BgpConfiguration->setAsn(65533);
$deviceLinksDeviceLink1->setBgpConfiguration($deviceLinksDeviceLink1BgpConfiguration);
$deviceLinksDeviceLink1RedundancyConfiguration = new RedundancyConfiguration();
$deviceLinksDeviceLink1RedundancyConfiguration->setZoneLocalIpAddress(null);
$deviceLinksDeviceLink1RedundancyConfiguration->setRedundancyTier(new RedundancyTier('noRedundancy'));
$deviceLinksDeviceLink1->setRedundancyConfiguration($deviceLinksDeviceLink1RedundancyConfiguration);
$deviceLinksDeviceLink1TunnelConfiguration = new TunnelConfigurationIKEv2Default();
$deviceLinksDeviceLink1TunnelConfiguration->setOdataType('#microsoft.graph.networkaccess.tunnelConfigurationIKEv2Default');
$deviceLinksDeviceLink1TunnelConfiguration->setPreSharedKey('test123');
$deviceLinksDeviceLink1->setTunnelConfiguration($deviceLinksDeviceLink1TunnelConfiguration);
$deviceLinksArray []= $deviceLinksDeviceLink1;
$requestBody->setDeviceLinks($deviceLinksArray);
$result = $graphServiceClient->networkAccess()->connectivity()->remoteNetworks()->post($requestBody)->wait();
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.networkaccess.remote_network import RemoteNetwork
from msgraph_beta.generated.models.region import Region
from msgraph_beta.generated.models.networkaccess.forwarding_profile import ForwardingProfile
from msgraph_beta.generated.models.networkaccess.device_link import DeviceLink
from msgraph_beta.generated.models.bandwidth_capacity_in_mbps import BandwidthCapacityInMbps
from msgraph_beta.generated.models.device_vendor import DeviceVendor
from msgraph_beta.generated.models.networkaccess.bgp_configuration import BgpConfiguration
from msgraph_beta.generated.models.networkaccess.redundancy_configuration import RedundancyConfiguration
from msgraph_beta.generated.models.redundancy_tier import RedundancyTier
from msgraph_beta.generated.models.networkaccess.tunnel_configuration_i_k_ev2_default import TunnelConfigurationIKEv2Default
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RemoteNetwork(
name = "Bellevue branch w/ device link",
region = Region.CanadaEast,
forwarding_profiles = [
ForwardingProfile(
id = "1adaf535-1e31-4e14-983f-2270408162bf",
),
],
device_links = [
DeviceLink(
name = "CPE1",
ip_address = "52.13.21.25",
bandwidth_capacity_in_mbps = BandwidthCapacityInMbps.Mbps500,
device_vendor = DeviceVendor.BarracudaNetworks,
bgp_configuration = BgpConfiguration(
local_ip_address = "192.168.1.2",
peer_ip_address = "10.1.1.2",
asn = 65533,
),
redundancy_configuration = RedundancyConfiguration(
zone_local_ip_address = None,
redundancy_tier = RedundancyTier.NoRedundancy,
),
tunnel_configuration = TunnelConfigurationIKEv2Default(
odata_type = "#microsoft.graph.networkaccess.tunnelConfigurationIKEv2Default",
pre_shared_key = "test123",
),
),
],
)
result = await graph_client.network_access.connectivity.remote_networks.post(request_body)
Wichtig
Die Microsoft Graph SDKs verwenden standardmäßig die Version v1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Beta-Version verfügbar sind. Einzelheiten zum Zugriff auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph SDKs mit der Beta-API.