public override void ExecuteCmdlet()
 {
     ConfirmAction(
         Force.IsPresent,
         string.Format(Resources.NewAzureCrossConnectionWarning, ServiceKey),
         string.Format(Resources.NewAzureCrossConnectionMessage, ServiceKey),
         ServiceKey.ToString(),
         () =>
     {
         var crossConnection = ExpressRouteClient.NewAzureCrossConnection(ServiceKey);
         WriteVerboseWithTimestamp(Resources.NewAzureCrossConnectionSucceeded);
         WriteObject(crossConnection);
     });
 }
        public override void ExecuteCmdlet()
        {
            ConfirmAction(
                Force.IsPresent,
                string.Format(Resources.SetAzureDedicatedCircuitBandwidthWarning, ServiceKey, Bandwidth, Sku, BillingType),
                Resources.SetAzureDedicatedCircuitBandwidthMessage,
                ServiceKey.ToString(),
                () =>
            {
                var circuit = ExpressRouteClient.SetAzureDedicatedCircuitProperties(ServiceKey, Bandwidth, Sku, BillingType);

                WriteObject(circuit);
            });
        }
 public override void ExecuteCmdlet()
 {
     ConfirmAction(
         Force.IsPresent,
         string.Format(Resources.RemoveAzureBGPPeeringWarning, ServiceKey),
         Resources.RemoveAzureBGPPeeringMessage,
         ServiceKey.ToString(),
         () =>
     {
         if (PeerAddressType == BgpPeerAddressType.All || AccessType != BgpPeeringAccessType.Microsoft)
         {
             if (!ExpressRouteClient.RemoveAzureBGPPeering(ServiceKey, AccessType, BgpPeerAddressType.All))
             {
                 throw new Exception(Resources.RemoveAzureBGPPeeringFailed);
             }
             else
             {
                 WriteVerboseWithTimestamp(Resources.RemoveAzureBGPPeeringSucceeded, ServiceKey);
                 if (PassThru.IsPresent)
                 {
                     WriteObject(true);
                 }
             }
         }
         else
         {
             if (!ExpressRouteClient.RemoveAzureBGPPeering(ServiceKey, AccessType, (BgpPeerAddressType)PeerAddressType))
             {
                 throw new Exception(Resources.RemoveAzureBGPPeeringFailed);
             }
             else
             {
                 WriteVerboseWithTimestamp(Resources.RemoveAzureBGPPeeringFailed, ServiceKey);
                 if (PassThru.IsPresent)
                 {
                     WriteObject(true);
                 }
             }
         }
     });
 }
Ejemplo n.º 4
0
 public override void ExecuteCmdlet()
 {
     ConfirmAction(
         Force.IsPresent,
         string.Format(Resources.RemoveAzureDedicatdCircuitWarning, ServiceKey),
         Resources.RemoveAzureDedicatedCircuitMessage,
         ServiceKey.ToString(),
         () =>
     {
         if (!ExpressRouteClient.RemoveAzureDedicatedCircuit(ServiceKey))
         {
             throw new Exception(Resources.RemoveAzureDedicatedCircuitFailed);
         }
         else
         {
             WriteVerboseWithTimestamp(Resources.RemoveAzureDedicatedCircuitSucceeded, ServiceKey);
             if (PassThru.IsPresent)
             {
                 WriteObject(true);
             }
         }
     });
 }