/// <summary>
 /// Creates or updates a peering in the specified ExpressRouteCrossConnection.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='crossConnectionName'>
 /// The name of the ExpressRouteCrossConnection.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 /// <param name='peeringParameters'>
 /// Parameters supplied to the create or update ExpressRouteCrossConnection
 /// peering operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ExpressRouteCrossConnectionPeering> BeginCreateOrUpdateAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #2
0
        public virtual ExpressRouteCrossConnectionPeeringsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (crossConnectionName == null)
            {
                throw new ArgumentNullException(nameof(crossConnectionName));
            }
            if (peeringName == null)
            {
                throw new ArgumentNullException(nameof(peeringName));
            }
            if (peeringParameters == null)
            {
                throw new ArgumentNullException(nameof(peeringParameters));
            }

            using var scope = _clientDiagnostics.CreateScope("ExpressRouteCrossConnectionPeeringsOperations.StartCreateOrUpdate");
            scope.Start();
            try
            {
                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, cancellationToken);
                return(new ExpressRouteCrossConnectionPeeringsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, crossConnectionName, peeringName, peeringParameters).Request, originalResponse));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
 /// <summary>
 /// Creates or updates a peering in the specified ExpressRouteCrossConnection.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='crossConnectionName'>
 /// The name of the ExpressRouteCrossConnection.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 /// <param name='peeringParameters'>
 /// Parameters supplied to the create or update ExpressRouteCrossConnection
 /// peering operation.
 /// </param>
 public static ExpressRouteCrossConnectionPeering BeginCreateOrUpdate(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters)
 {
     return(operations.BeginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).GetAwaiter().GetResult());
 }