Пример #1
0
        public GatewayGetOperationStatusResponse ResizeGateway(string vnetName, GatewaySKU gatewaySKU)
        {
            ResizeGatewayParameters parameters = new ResizeGatewayParameters()
            {
                GatewaySKU = gatewaySKU,
            };

            return(client.Gateways.Resize(vnetName, parameters));
        }
        public override void ExecuteCmdlet()
        {
            string gatewayType = "UltraPerformance";
            string warningMsg  = string.Empty;
            string continueMsg = string.Empty;
            bool   force       = true;

            if (GatewaySKU.Trim().Replace(" ", "").Equals(gatewayType, StringComparison.InvariantCultureIgnoreCase))
            {
                warningMsg  = Resources.UltraPerformanceGatewayWarning;
                continueMsg = Resources.UltraPerformanceGatewayContinue;
                force       = false;
            }
            if (this.Force.IsPresent)
            {
                force = true;
            }

            ConfirmAction(
                force,
                warningMsg,
                continueMsg,
                GatewaySKU + " " + GatewayType,
                () =>
            {
                var gateway = Client.CreateVirtualNetworkGateway(
                    VNetName,
                    GatewayName,
                    GatewayType,
                    GatewaySKU,
                    Location,
                    VnetId,
                    Asn,
                    PeerWeight);
                WriteVerboseWithTimestamp(Resources.UltraPerformanceGatewaySucceed);
                WriteObject(gateway);
            });
        }
Пример #3
0
        public GatewayGetOperationStatusResponse CreateGateway(string vnetName, GatewayType gatewayType, GatewaySKU gatewaySKU)
        {
            GatewayCreateParameters parameters = new GatewayCreateParameters()
            {
                GatewayType = gatewayType,
                GatewaySKU  = gatewaySKU,
            };

            return(client.Gateways.Create(vnetName, parameters));
        }