-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1205 from jianghaolu/web
Adapt previous web app models to new infrastructure
- Loading branch information
Showing
23 changed files
with
2,488 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 145 additions & 0 deletions
145
azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlan.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
*/ | ||
|
||
package com.microsoft.azure.management.website; | ||
|
||
import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; | ||
import com.microsoft.azure.management.resources.fluentcore.model.Creatable; | ||
import com.microsoft.azure.management.resources.fluentcore.model.Refreshable; | ||
import com.microsoft.azure.management.resources.fluentcore.model.Updatable; | ||
import com.microsoft.azure.management.resources.fluentcore.model.Wrapper; | ||
import com.microsoft.azure.management.website.implementation.AppServicePlanInner; | ||
|
||
/** | ||
* An immutable client-side representation of an Azure Web App. | ||
*/ | ||
public interface AppServicePlan extends | ||
GroupableResource, | ||
HasName, | ||
Refreshable<AppServicePlan>, | ||
Updatable<AppServicePlan.Update>, | ||
Wrapper<AppServicePlanInner> { | ||
|
||
/** | ||
* @return target worker tier assigned to the App Service Plan. | ||
*/ | ||
String workerTierName(); | ||
|
||
/** | ||
* @return app Service Plan Status. Possible values include: 'Ready', 'Pending'. | ||
*/ | ||
StatusOptions status(); | ||
|
||
/** | ||
* @return app Service Plan Subscription. | ||
*/ | ||
String subscription(); | ||
|
||
/** | ||
* @return app Service Plan administration site. | ||
*/ | ||
String adminSiteName(); | ||
|
||
/** | ||
* @return specification for the hosting environment (App Service Environment) to | ||
* use for the App Service Plan. | ||
*/ | ||
HostingEnvironmentProfile hostingEnvironmentProfile(); | ||
|
||
/** | ||
* @return maximum number of instances that can be assigned to this App Service | ||
* Plan. | ||
*/ | ||
int maximumNumberOfWorkers(); | ||
|
||
/** | ||
* @return geographical location for the App Service Plan. | ||
*/ | ||
String geoRegion(); | ||
|
||
/** | ||
* @return if True apps assigned to this App Service Plan can be scaled | ||
* independently | ||
* If False apps assigned to this App Service Plan will scale | ||
* to all instances of the plan. | ||
*/ | ||
boolean perSiteScaling(); | ||
|
||
/** | ||
* @return number of web apps assigned to this App Service Plan. | ||
*/ | ||
int numberOfSites(); | ||
|
||
/** | ||
* @return resource group of the server farm. | ||
*/ | ||
String resourceGroup(); | ||
|
||
/** | ||
* @return the sku property. | ||
*/ | ||
SkuDescription sku(); | ||
|
||
/************************************************************** | ||
* Fluent interfaces to provision a App service plan | ||
**************************************************************/ | ||
|
||
/** | ||
* Container interface for all the definitions that need to be implemented. | ||
*/ | ||
interface Definition extends | ||
DefinitionStages.Blank, | ||
DefinitionStages.WithGroup, | ||
DefinitionStages.WithPricingTier, | ||
DefinitionStages.WithCreate { | ||
} | ||
|
||
/** | ||
* Grouping of all the site definition stages. | ||
*/ | ||
interface DefinitionStages { | ||
/** | ||
* The first stage of the app service plan definition. | ||
*/ | ||
interface Blank extends DefinitionWithRegion<WithGroup> { | ||
} | ||
|
||
/** | ||
* An app service plan definition allowing resource group to be set. | ||
*/ | ||
interface WithGroup extends GroupableResource.DefinitionStages.WithGroup<WithPricingTier> { | ||
} | ||
|
||
/** | ||
* An app service plan definition allowing pricing tier to be set. | ||
*/ | ||
interface WithPricingTier { | ||
WithCreate withPricingTier(AppServicePricingTier pricingTier); | ||
} | ||
|
||
/** | ||
* An app service plan definition with sufficient inputs to create a new | ||
* website in the cloud, but exposing additional optional inputs to | ||
* specify. | ||
*/ | ||
interface WithCreate extends Creatable<AppServicePlan> { | ||
} | ||
} | ||
|
||
/** | ||
* Grouping of all the site update stages. | ||
*/ | ||
interface UpdateStages { | ||
|
||
} | ||
|
||
/** | ||
* The template for a site update operation, containing all the settings that can be modified. | ||
*/ | ||
interface Update { | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlans.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
*/ | ||
|
||
package com.microsoft.azure.management.website; | ||
|
||
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByGroup; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByGroup; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; | ||
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; | ||
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; | ||
|
||
/** | ||
* Entry point for storage accounts management API. | ||
*/ | ||
public interface AppServicePlans extends | ||
SupportsCreating<AppServicePlan.DefinitionStages.Blank>, | ||
SupportsDeleting, | ||
SupportsListingByGroup<AppServicePlan>, | ||
SupportsGettingByGroup<AppServicePlan>, | ||
SupportsGettingById<AppServicePlan>, | ||
SupportsDeletingByGroup { | ||
} |
87 changes: 87 additions & 0 deletions
87
...t-website/src/main/java/com/microsoft/azure/management/website/AppServicePricingTier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
*/ | ||
|
||
package com.microsoft.azure.management.website; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
/** | ||
* Defines App service pricing tiers. | ||
*/ | ||
public enum AppServicePricingTier { | ||
/** Free app service plan. */ | ||
FREE_F1("Free", "F1"), | ||
|
||
/** App service plan with shared infrastructure. */ | ||
SHARED_D1("Shared", "D1"), | ||
|
||
/** Basic pricing tier with a small size. */ | ||
BASIC_B1("Basic", "B1"), | ||
|
||
/** Basic pricing tier with a medium size. */ | ||
BASIC_B2("Basic", "B2"), | ||
|
||
/** Basic pricing tier with a large size. */ | ||
BASIC_B3("Basic", "B3"), | ||
|
||
/** Standard pricing tier with a small size. */ | ||
STANDARD_S1("Standard", "S1"), | ||
|
||
/** Standard pricing tier with a medium size. */ | ||
STANDARD_S2("Standard", "S2"), | ||
|
||
/** Standard pricing tier with a large size. */ | ||
STANDARD_S3("Standard", "S3"), | ||
|
||
/** Premium pricing tier with a small size. */ | ||
PREMIUM_P1("Premium", "P1"), | ||
|
||
/** Premium pricing tier with a medium size. */ | ||
PREMIUM_P2("Premium", "P2"), | ||
|
||
/** Premium pricing tier with a large size. */ | ||
PREMIUM_P3("Premium", "P3"); | ||
|
||
/** The actual serialized value for a SiteAvailabilityState instance. */ | ||
private SkuDescription skuDescription; | ||
|
||
AppServicePricingTier(String tier, String size) { | ||
this.skuDescription = new SkuDescription() | ||
.withName(size) | ||
.withTier(tier) | ||
.withSize(size); | ||
} | ||
|
||
/** | ||
* Parses a serialized value to an AppServicePricingTier instance. | ||
* | ||
* @param skuDescription the serialized value to parse. | ||
* @return the parsed AppServicePricingTier object, or null if unable to parse. | ||
*/ | ||
public static AppServicePricingTier fromSkuDescription(SkuDescription skuDescription) { | ||
AppServicePricingTier[] items = AppServicePricingTier.values(); | ||
for (AppServicePricingTier item : items) { | ||
if (item.skuDescription.tier().equalsIgnoreCase(skuDescription.tier()) | ||
&& item.skuDescription.size().equalsIgnoreCase(skuDescription.size())) { | ||
return item; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
/** | ||
* @return the underneath sku description | ||
*/ | ||
@JsonValue | ||
public SkuDescription toSkuDescription() { | ||
return this.skuDescription; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return this.skuDescription.tier() + "_" + this.skuDescription.size(); | ||
} | ||
} |
Oops, something went wrong.