/// <summary>
 /// Initializes a new instance of the
 /// WebHostingPlanCreateOrUpdateParameters class with required
 /// arguments.
 /// </summary>
 public WebHostingPlanCreateOrUpdateParameters(WebHostingPlan webHostingPlan)
     : this()
 {
     if (webHostingPlan == null)
     {
         throw new ArgumentNullException("webHostingPlan");
     }
     this.WebHostingPlan = webHostingPlan;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the
 /// WebHostingPlanCreateOrUpdateParameters class with required
 /// arguments.
 /// </summary>
 public WebHostingPlanCreateOrUpdateParameters(WebHostingPlan webHostingPlan)
     : this()
 {
     if (webHostingPlan == null)
     {
         throw new ArgumentNullException("webHostingPlan");
     }
     this.WebHostingPlan = webHostingPlan;
 }
        public WebHostingPlanCreateOrUpdateResponse CreateAppServicePlan(string resourceGroupName, string whpName, string location, string adminSiteName, int numberOfWorkers, SkuOptions sku, WorkerSizeOptions workerSize)
        {
            WebHostingPlanProperties webHostingPlanProperties = new WebHostingPlanProperties();
            webHostingPlanProperties.Sku = sku;
            webHostingPlanProperties.AdminSiteName = adminSiteName;
            webHostingPlanProperties.NumberOfWorkers = numberOfWorkers;
            webHostingPlanProperties.WorkerSize = workerSize;
            WebHostingPlan webHostingPlan = new WebHostingPlan();        
            WebHostingPlanCreateOrUpdateParameters webHostingPlanCreateOrUpdateParameters = new WebHostingPlanCreateOrUpdateParameters(webHostingPlan);
            webHostingPlanCreateOrUpdateParameters.WebHostingPlan.Location = location;
            webHostingPlanCreateOrUpdateParameters.WebHostingPlan.Name = whpName;
            webHostingPlanCreateOrUpdateParameters.WebHostingPlan.Properties = webHostingPlanProperties;

            var createdWHP = WrappedWebsitesClient.WebHostingPlans.CreateOrUpdate(resourceGroupName, webHostingPlanCreateOrUpdateParameters);
            //proper return type need to be discussed
            return createdWHP;
        }