// 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);
// 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)
// 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);
<?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();
# 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)
// 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);
// 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)
// 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);
# 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)
// 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);
// 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);
<?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();