private PSExpressRouteCircuit CreateExpressRouteCircuit() { base.Execute(); var circuit = new PSExpressRouteCircuit(); circuit.Name = this.Name; circuit.ResourceGroupName = this.ResourceGroupName; circuit.Location = this.Location; // Construct sku if (!string.IsNullOrEmpty(this.SkuTier)) { circuit.Sku = new PSExpressRouteCircuitSku(); circuit.Sku.Tier = this.SkuTier; circuit.Sku.Family = this.SkuFamily; circuit.Sku.Name = this.SkuTier + "_" + this.SkuFamily; } // construct the service provider properties if (!string.IsNullOrEmpty(this.ServiceProviderName)) { circuit.ServiceProviderProperties = new PSServiceProviderProperties(); circuit.ServiceProviderProperties.ServiceProviderName = this.ServiceProviderName; circuit.ServiceProviderProperties.PeeringLocation = this.PeeringLocation; circuit.ServiceProviderProperties.BandwidthInMbps = this.BandwidthInMbps; } // construct the ExpressRoutePort properties if (this.ExpressRoutePort != null) { circuit.ExpressRoutePort = this.ExpressRoutePort; circuit.BandwidthInGbps = this.BandwidthInGbps; } circuit.Peerings = this.Peering; circuit.Authorizations = this.Authorization; circuit.AllowClassicOperations = this.AllowClassicOperations; // Map to the sdk object var circuitModel = NetworkResourceManagerProfile.Mapper.Map <MNM.ExpressRouteCircuit>(circuit); circuitModel.Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true); // Execute the Create ExpressRouteCircuit call this.ExpressRouteCircuitClient.CreateOrUpdate(this.ResourceGroupName, this.Name, circuitModel); var getExpressRouteCircuit = this.GetExpressRouteCircuit(this.ResourceGroupName, this.Name); return(getExpressRouteCircuit); }
private PSExpressRouteCircuit CreateExpressRouteCircuit() { var circuit = new PSExpressRouteCircuit(); circuit.Name = this.Name; circuit.ResourceGroupName = this.ResourceGroupName; circuit.Location = this.Location; // Construct sku if (!string.IsNullOrEmpty(this.SkuTier)) { circuit.Sku = new PSExpressRouteCircuitSku(); circuit.Sku.Tier = this.SkuTier; circuit.Sku.Family = this.SkuFamily; circuit.Sku.Name = this.SkuTier + "_" + this.SkuFamily; } // construct the service provider properties if (!string.IsNullOrEmpty(this.ServiceProviderName)) { circuit.ServiceProviderProperties = new PSServiceProviderProperties(); circuit.ServiceProviderProperties.ServiceProviderName = this.ServiceProviderName; circuit.ServiceProviderProperties.PeeringLocation = this.PeeringLocation; circuit.ServiceProviderProperties.BandwidthInMbps = this.BandwidthInMbps; } circuit.Peerings = new List <PSPeering>(); circuit.Peerings = this.Peering; circuit.BillingType = this.BillingType; // Map to the sdk object var circuitModel = Mapper.Map <MNM.ExpressRouteCircuit>(circuit); circuitModel.Type = Microsoft.Azure.Commands.Network.Properties.Resources.ExpressRouteCircuitType; circuitModel.Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true); // Execute the Create ExpressRouteCircuit call this.ExpressRouteCircuitClient.CreateOrUpdate(this.ResourceGroupName, this.Name, circuitModel); var getExpressRouteCircuit = this.GetExpressRouteCircuit(this.ResourceGroupName, this.Name); getExpressRouteCircuit.BillingType = this.BillingType; return(getExpressRouteCircuit); }
private PSExpressRouteCircuit CreateExpressRouteCircuit() { var circuit = new PSExpressRouteCircuit(); circuit.Name = this.Name; circuit.ServiceKey = this.ServiceKey; circuit.ResourceGroupName = this.ResourceGroupName; circuit.Location = this.Location; // Map to the sdk object var circuitModel = Mapper.Map <MNM.ExpressRouteCircuit>(circuit); circuitModel.Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true); // Execute the Create ExpressRouteCircuit call this.ExpressRouteCircuitClient.CreateOrUpdate(this.ResourceGroupName, this.Name, circuitModel); var getExpressRouteCircuit = this.GetExpressRouteCircuit(this.ResourceGroupName, this.Name); return(getExpressRouteCircuit); }