Skip to content

Commit

Permalink
Merge pull request #1915 from jianghaolu/prwork
Browse files Browse the repository at this point in the history
1.3 private -> public
  • Loading branch information
jianghaolu authored Sep 22, 2017
2 parents 9ef845e + d46907e commit 254c4e4
Show file tree
Hide file tree
Showing 417 changed files with 378,397 additions and 303,329 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ public interface FunctionApp extends
Refreshable<FunctionApp>,
Updatable<FunctionApp.Update> {

/**
* @return the entry point to deployment slot management API under the function app
*/
@Beta(Beta.SinceVersion.V1_3_0)
FunctionDeploymentSlots deploymentSlots();

/**
* @return the storage account associated with the function app
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/**
* 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.appservice;

import com.microsoft.azure.management.apigeneration.Beta;
import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.appservice.implementation.AppServiceManager;
import com.microsoft.azure.management.appservice.implementation.SiteInner;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasParent;
import com.microsoft.azure.management.resources.fluentcore.arm.models.IndependentChildResource;
import com.microsoft.azure.management.resources.fluentcore.model.Appliable;
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;

/**
* An immutable client-side representation of an Azure Function App deployment slot.
*/
@Fluent(ContainerName = "/Microsoft.Azure.Management.AppService.Fluent")
@Beta(Beta.SinceVersion.V1_3_0)
public interface FunctionDeploymentSlot extends
IndependentChildResource<AppServiceManager, SiteInner>,
WebAppBase,
Refreshable<FunctionDeploymentSlot>,
Updatable<FunctionDeploymentSlot.Update>,
HasParent<FunctionApp> {

/**************************************************************
* Fluent interfaces to provision a function deployment slot
**************************************************************/

/**
* Container interface for all the definitions that need to be implemented.
*/
interface Definition extends
DefinitionStages.Blank,
DefinitionStages.WithConfiguration,
DefinitionStages.WithCreate {
}

/**
* Grouping of all the function deployment slot definition stages.
*/
interface DefinitionStages {
/**
* The first stage of the function deployment slot definition.
*/
interface Blank extends WithConfiguration {
}

/**
* A function deployment slot definition allowing the configuration to clone from to be specified.
*/
interface WithConfiguration {
/**
* Creates the function deployment slot with brand new site configurations.
*
* @return the next stage of the definition
*/
WithCreate withBrandNewConfiguration();

/**
* Copies the site configurations from the web app the function deployment slot belongs to.
*
* @return the next stage of the definition
*/
WithCreate withConfigurationFromParent();

/**
* Copies the site configurations from a given web app.
*
* @param app the function app to copy the configurations from
* @return the next stage of the definition
*/
WithCreate withConfigurationFromWebApp(FunctionApp app);

/**
* Copies the site configurations from a givenfunction deployment slot.
*
* @param deploymentSlot the function deployment slot to copy the configurations from
* @return the next stage of the definition
*/
WithCreate withConfigurationFromDeploymentSlot(FunctionDeploymentSlot deploymentSlot);
}

/**
* A site definition with sufficient inputs to create a new web app /
* deployments slot in the cloud, but exposing additional optional
* inputs to specify.
*/
interface WithCreate extends
Creatable<FunctionDeploymentSlot>,
WebAppBase.DefinitionStages.WithCreate<FunctionDeploymentSlot> {
}
}

/**
* The template for a web app update operation, containing all the settings that can be modified.
*/
interface Update extends
Appliable<FunctionDeploymentSlot>,
WebAppBase.Update<FunctionDeploymentSlot> {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* 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.appservice;

import com.microsoft.azure.management.apigeneration.Beta;
import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.appservice.implementation.AppServiceManager;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByName;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasManager;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasParent;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingByName;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing;

/**
* Entry point for Azure function app deployment slot management API.
*/
@Fluent(ContainerName = "/Microsoft.Azure.Management.AppService.Fluent")
@Beta(Beta.SinceVersion.V1_3_0)
public interface FunctionDeploymentSlots extends
SupportsCreating<FunctionDeploymentSlot.DefinitionStages.Blank>,
SupportsListing<FunctionDeploymentSlot>,
SupportsGettingByName<FunctionDeploymentSlot>,
SupportsGettingById<FunctionDeploymentSlot>,
SupportsDeletingById,
SupportsDeletingByName,
HasManager<AppServiceManager>,
HasParent<FunctionApp> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.microsoft.azure.management.appservice.OperatingSystem;
import com.microsoft.azure.management.appservice.PricingTier;
import com.microsoft.azure.management.appservice.SkuDescription;
import com.microsoft.azure.management.appservice.FunctionDeploymentSlots;
import com.microsoft.azure.management.resources.fluentcore.model.Creatable;
import com.microsoft.azure.management.resources.fluentcore.model.Indexable;
import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext;
Expand Down Expand Up @@ -62,6 +63,7 @@ class FunctionAppImpl
private StorageAccount currentStorageAccount;
private final FunctionAppKeyService functionAppKeyService;
private final FunctionKuduService functionKuduService;
private FunctionDeploymentSlots deploymentSlots;

FunctionAppImpl(final String name, SiteInner innerObject, SiteConfigResourceInner configObject, AppServiceManager manager) {
super(name, innerObject, configObject, manager);
Expand All @@ -74,6 +76,14 @@ class FunctionAppImpl
.retrofit().create(FunctionKuduService.class);
}

@Override
public FunctionDeploymentSlots deploymentSlots() {
if (deploymentSlots == null) {
deploymentSlots = new FunctionDeploymentSlotsImpl(this);
}
return deploymentSlots;
}

@Override
public FunctionAppImpl withNewConsumptionPlan() {
return withNewAppServicePlan(OperatingSystem.WINDOWS, new PricingTier("Dynamic", "Y1"));
Expand Down
Loading

0 comments on commit 254c4e4

Please sign in to comment.