From 0e413ad8a4ed8f30371dc2e1da8eaef9ab48678c Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Tue, 18 Oct 2016 16:36:49 -0700 Subject: [PATCH] Adapt previous web app models to new infrastructure --- azure-mgmt-website/pom.xml | 1 - .../management/website/AppServicePlan.java | 145 ++++++++ .../management/website/AppServicePlans.java | 26 ++ .../website/AppServicePricingTier.java | 87 +++++ .../azure/management/website/Certificate.java | 159 +++++++++ .../website/CertificateDetails.java | 62 ++++ .../management/website/CertificateOrder.java | 174 ++++++++++ .../management/website/CertificateOrders.java | 26 ++ .../management/website/Certificates.java | 26 ++ .../management/website/HostNameBinding.java | 89 +++++ .../azure/management/website/WebApp.java | 304 ++++++++++++++++ .../azure/management/website/WebApps.java | 26 ++ .../implementation/AppServiceManager.java | 133 +++++++ .../implementation/AppServicePlanImpl.java | 111 ++++++ .../implementation/AppServicePlansImpl.java | 67 ++++ .../CertificateDetailsImpl.java | 72 ++++ .../implementation/CertificateImpl.java | 136 ++++++++ .../implementation/CertificateOrderImpl.java | 152 ++++++++ .../implementation/CertificateOrdersImpl.java | 68 ++++ .../implementation/CertificatesImpl.java | 68 ++++ .../implementation/HostNameBindingImpl.java | 162 +++++++++ .../website/implementation/WebAppImpl.java | 328 ++++++++++++++++++ .../website/implementation/WebAppsImpl.java | 67 ++++ 23 files changed, 2488 insertions(+), 1 deletion(-) create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlan.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlans.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePricingTier.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificate.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateDetails.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrder.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrders.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificates.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostNameBinding.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApp.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApps.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServiceManager.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlanImpl.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateDetailsImpl.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateImpl.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrderImpl.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/HostNameBindingImpl.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppImpl.java create mode 100644 azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java diff --git a/azure-mgmt-website/pom.xml b/azure-mgmt-website/pom.xml index b2e76d14f6f71..9e151ddc608b5 100644 --- a/azure-mgmt-website/pom.xml +++ b/azure-mgmt-website/pom.xml @@ -55,7 +55,6 @@ com.microsoft.azure azure-mgmt-resources 1.0.0-beta4-SNAPSHOT - test junit diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlan.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlan.java new file mode 100644 index 0000000000000..7bc73009adf9c --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlan.java @@ -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, + Updatable, + Wrapper { + + /** + * @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 { + } + + /** + * An app service plan definition allowing resource group to be set. + */ + interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { + } + + /** + * 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 { + } + } + + /** + * 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 { + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlans.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlans.java new file mode 100644 index 0000000000000..ad6769e33cf76 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlans.java @@ -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, + SupportsDeleting, + SupportsListingByGroup, + SupportsGettingByGroup, + SupportsGettingById, + SupportsDeletingByGroup { +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePricingTier.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePricingTier.java new file mode 100644 index 0000000000000..93c5b91585d58 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePricingTier.java @@ -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(); + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificate.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificate.java new file mode 100644 index 0000000000000..cd9f1725c2f3b --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificate.java @@ -0,0 +1,159 @@ +/** + * 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.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.CertificateInner; +import org.joda.time.DateTime; + +import java.util.List; + +/** + * An immutable client-side representation of an Azure Web App. + */ +public interface Certificate extends + GroupableResource, + Refreshable, + Updatable, + Wrapper { + /** + * @return Friendly name of the certificate. + */ + String friendlyName(); + + /** + * @return Subject name of the certificate. + */ + String subjectName(); + + /** + * @return Host names the certificate applies to. + */ + List hostNames(); + + /** + * @return Pfx blob. + */ + String pfxBlob(); + + /** + * @return App name. + */ + String siteName(); + + /** + * @return Self link. + */ + String selfLink(); + + /** + * @return Certificate issuer. + */ + String issuer(); + + /** + * @return Certificate issue Date. + */ + DateTime issueDate(); + + /** + * @return Certificate expriration date. + */ + DateTime expirationDate(); + + /** + * @return Certificate password. + */ + String password(); + + /** + * @return Certificate thumbprint. + */ + String thumbprint(); + + /** + * @return Is the certificate valid?. + */ + Boolean valid(); + + /** + * @return Raw bytes of .cer file. + */ + String cerBlob(); + + /** + * @return Public key hash. + */ + String publicKeyHash(); + + /** + * @return Specification for the hosting environment (App Service Environment) to + * use for the certificate. + */ + HostingEnvironmentProfile hostingEnvironmentProfile(); + + + /************************************************************** + * 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.WithHostName, + DefinitionStages.WithCreate { + } + + /** + * Grouping of all the site definition stages. + */ + interface DefinitionStages { + /** + * An app service plan definition allowing resource group to be set. + */ + interface Blank extends GroupableResource.DefinitionWithRegion { + } + + interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { + } + + /** + * An app service plan definition allowing pricing tier to be set. + */ + interface WithHostName { + WithCreate withHostName(String hostName); + } + + /** + * 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, WithHostName { + } + } + + /** + * 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 { + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateDetails.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateDetails.java new file mode 100644 index 0000000000000..382dec3659c44 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateDetails.java @@ -0,0 +1,62 @@ +/** + * 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.model.Wrapper; +import com.microsoft.azure.management.website.implementation.CertificateDetailsInner; +import org.joda.time.DateTime; + +/** + * An immutable client-side representation of an Azure Web App. + */ +public interface CertificateDetails extends + Wrapper { + /** + * @return Version. + */ + Integer version(); + + /** + * @return Serial Number. + */ + String serialNumber(); + + /** + * @return Thumbprint. + */ + String thumbprint(); + + /** + * @return Subject. + */ + String subject(); + + /** + * @return Valid from. + */ + DateTime notBefore(); + + /** + * @return Valid to. + */ + DateTime notAfter(); + + /** + * @return Signature Algorithm. + */ + String signatureAlgorithm(); + + /** + * @return Issuer. + */ + String issuer(); + + /** + * @return Raw certificate data. + */ + String rawData(); +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrder.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrder.java new file mode 100644 index 0000000000000..cfdb838f2a2c0 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrder.java @@ -0,0 +1,174 @@ +/** + * 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.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.AppServiceCertificateInner; +import com.microsoft.azure.management.website.implementation.AppServiceCertificateOrderInner; +import org.joda.time.DateTime; + +import java.util.Map; + +/** + * An immutable client-side representation of an Azure Web App. + */ +public interface CertificateOrder extends + GroupableResource, + Refreshable, + Updatable, + Wrapper { + + /** + * @return State of the Key Vault secret. + */ + Map certificates(); + + /** + * @return Certificate distinguished name. + */ + String distinguishedName(); + + /** + * @return Domain Verification Token. + */ + String domainVerificationToken(); + + /** + * @return Duration in years (must be between 1 and 3). + */ + int validityInYears(); + + /** + * @return Certificate Key Size. + */ + int keySize(); + + /** + * @return Certificate product type. Possible values include: + * 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl'. + */ + CertificateProductType productType(); + + /** + * @return Auto renew. + */ + boolean autoRenew(); + + /** + * @return Status of certificate order. Possible values include: 'Succeeded', + * 'Failed', 'Canceled', 'InProgress', 'Deleting'. + */ + ProvisioningState provisioningState(); + + /** + * @return Current order status. Possible values include: 'Pendingissuance', + * 'Issued', 'Revoked', 'Canceled', 'Denied', 'Pendingrevocation', + * 'PendingRekey', 'Unused', 'Expired', 'NotSubmitted'. + */ + CertificateOrderStatus status(); + + /** + * @return Signed certificate. + */ + CertificateDetails signedCertificate(); + + /** + * @return Last CSR that was created for this order. + */ + String csr(); + + /** + * @return Intermediate certificate. + */ + CertificateDetails intermediate(); + + /** + * @return Root certificate. + */ + CertificateDetails root(); + + /** + * @return Current serial number of the certificate. + */ + String serialNumber(); + + /** + * @return Certificate last issuance time. + */ + DateTime lastCertificateIssuanceTime(); + + /** + * @return Certificate expiration time. + */ + DateTime expirationTime(); + + /************************************************************** + * 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.WithHostName, + DefinitionStages.WithCertificateSku, + DefinitionStages.WithValidYears, + DefinitionStages.WithCreate { + } + + /** + * Grouping of all the site definition stages. + */ + interface DefinitionStages { + /** + * An app service plan definition allowing resource group to be set. + */ + interface Blank extends GroupableResource.DefinitionStages.WithGroup { + } + + /** + * An app service plan definition allowing pricing tier to be set. + */ + interface WithHostName { + WithCertificateSku withHostName(String hostName); + } + + interface WithCertificateSku { + WithValidYears withSku(CertificateProductType sku); + } + + interface WithValidYears { + WithCreate withValidYears(int years); + } + + /** + * 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 { + } + } + + /** + * 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 { + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrders.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrders.java new file mode 100644 index 0000000000000..d661ac834a80f --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrders.java @@ -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 CertificateOrders extends + SupportsCreating, + SupportsDeleting, + SupportsListingByGroup, + SupportsGettingByGroup, + SupportsGettingById, + SupportsDeletingByGroup { +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificates.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificates.java new file mode 100644 index 0000000000000..809627a7ad733 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificates.java @@ -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 Certificates extends + SupportsCreating, + SupportsDeleting, + SupportsListingByGroup, + SupportsGettingByGroup, + SupportsGettingById, + SupportsDeletingByGroup { +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostNameBinding.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostNameBinding.java new file mode 100644 index 0000000000000..a6c1eee0b4225 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostNameBinding.java @@ -0,0 +1,89 @@ +/** + * 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.ExternalChildResource; +import com.microsoft.azure.management.resources.fluentcore.arm.models.Resource; +import com.microsoft.azure.management.resources.fluentcore.model.Attachable; +import com.microsoft.azure.management.resources.fluentcore.model.Wrapper; +import com.microsoft.azure.management.website.implementation.HostNameBindingInner; + +/** + * A host name binding object. + */ +public interface HostNameBinding + extends + Wrapper, + ExternalChildResource, Resource { + /** + * @return Hostname. + */ + String hostNameBindingName(); + + /** + * @return Web app name. + */ + String siteName(); + + /** + * @return Fully qualified ARM domain resource URI. + */ + String domainId(); + + /** + * @return Azure resource name. + */ + String azureResourceName(); + + /** + * @return Azure resource type. Possible values include: 'Website', + * 'TrafficManager'. + */ + AzureResourceType azureResourceType(); + + /** + * @return Custom DNS record type. Possible values include: 'CName', 'A'. + */ + CustomHostNameDnsRecordType customHostNameDnsRecordType(); + + /** + * @return Host name type. Possible values include: 'Verified', 'Managed'. + */ + HostNameType hostNameType(); + + interface Definition extends + DefinitionStages.Blank, + DefinitionStages.WithHostNameType, + DefinitionStages.WithHostNameDnsRecordType, + DefinitionStages.WithAttach { + } + + /** + * Grouping of security rule definition stages applicable as part of a network security group creation. + */ + interface DefinitionStages { + /** + * The first stage of a host name binding definition. + * + * @param the return type of the final {@link WithAttach#attach()} + */ + interface Blank extends WithHostNameType { + } + + interface WithHostNameType { + WithHostNameDnsRecordType withHostNameType(HostNameType hostNameType); + } + + interface WithHostNameDnsRecordType { + WithAttach withHostNameDnsRecordType(CustomHostNameDnsRecordType hostNameDnsRecordType); + } + + interface WithAttach extends + Attachable.InDefinition { + } + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApp.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApp.java new file mode 100644 index 0000000000000..45c5c5d226ca1 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApp.java @@ -0,0 +1,304 @@ +/** + * 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.CloudException; +import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; +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; +import com.microsoft.azure.management.resources.fluentcore.model.Wrapper; +import com.microsoft.azure.management.website.implementation.SiteConfigInner; +import com.microsoft.azure.management.website.implementation.SiteInner; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.util.List; + +/** + * An immutable client-side representation of an Azure Web App. + */ +public interface WebApp extends + GroupableResource, + Refreshable, + Updatable, + Wrapper { + + /** + * @return name of web app + */ + String siteName(); + + /** + * @return state of the web app + */ + String state(); + + /** + * @return hostnames associated with web app + */ + List hostNames(); + + /** + * @return name of repository site + */ + String repositorySiteName(); + + /** + * @return state indicating whether web app has exceeded its quota usage. Possible + * values include: 'Normal', 'Exceeded'. + */ + UsageState usageState(); + + /** + * @return true if the site is enabled; otherwise, false. Setting this value to + * false disables the site (takes the site off line). + */ + boolean enabled(); + + /** + * @return hostnames for the web app that are enabled. Hostnames need to be + * assigned and enabled. If some hostnames are assigned but not enabled + * the app is not served on those hostnames. + */ + List enabledHostNames(); + + /** + * @return management information availability state for the web app. Possible + * values are Normal or Limited. + * Normal means that the site is running correctly and that + * management information for the site is available. + * Limited means that only partial management information for + * the site is available and that detailed site information is + * unavailable. Possible values include: 'Normal', 'Limited', + * 'DisasterRecoveryMode'. + */ + SiteAvailabilityState availabilityState(); + + /** + * @return list of SSL states used to manage the SSL bindings for site's hostnames + */ + List hostNameSslStates(); + + /** + * @return The serverFarmId property + */ + String serverFarmId(); + + /** + * @return Last time web app was modified in UTC + */ + DateTime lastModifiedTimeUtc(); + + /** + * @return Configuration of web app + */ + SiteConfigInner siteConfig(); + + /** + * @return list of Azure Traffic manager host names associated with web + * app + */ + List trafficManagerHostNames(); + + /** + * @return whether web app is deployed as a premium app + */ + boolean premiumAppDeployed(); + + /** + * @return whether to stop SCM (KUDU) site when the web app is + * stopped. Default is false. + */ + boolean scmSiteAlsoStopped(); + + /** + * @return which slot this app will swap into + */ + String targetSwapSlot(); + + /** + * @return specification for the hosting environment (App Service Environment) to + * use for the web app + */ + HostingEnvironmentProfile hostingEnvironmentProfile(); + + /** + * @return the micro-service name + */ + String microService(); + + /** + * @return name of gateway app associated with web app + */ + String gatewaySiteName(); + + /** + * @return if the client affinity is enabled when load balancing http + * request for multiple instances of the web app + */ + boolean clientAffinityEnabled(); + + /** + * @return if the client certificate is enabled for the web app + */ + boolean clientCertEnabled(); + + /** + * @return if the public hostnames are disabled the web app. + * If set to true the app is only accessible via API + * Management process. + */ + boolean hostNamesDisabled(); + + /** + * @return list of comma separated IP addresses that this web app uses for + * outbound connections. Those can be used when configuring firewall + * rules for databases accessed by this web app. + */ + String outboundIpAddresses(); + + /** + * @return size of a function container + */ + int containerSize(); + + /** + * @return maximum number of workers + * This only applies to function container. + */ + int maxNumberOfWorkers(); + + /** + * @return information about whether the web app is cloned from another + */ + CloningInfo cloningInfo(); + + /** + * @return resource group web app belongs to + */ + String resourceGroup(); + + /** + * @return site is a default container + */ + boolean isDefaultContainer(); + + /** + * @return default hostname of the web app + */ + String defaultHostName(); + + List hostNameBindings() throws CloudException, IOException; + + /************************************************************** + * Fluent interfaces to provision a Web App + **************************************************************/ + + /** + * Container interface for all the definitions that need to be implemented. + */ + interface Definition extends + DefinitionStages.Blank, + DefinitionStages.WithGroup, + DefinitionStages.WithAppServicePlan, + DefinitionStages.WithCreate { + } + + /** + * Grouping of all the site definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the site definition. + */ + interface Blank extends GroupableResource.DefinitionWithRegion { + } + + /** + * A site definition allowing resource group to be set. + */ + interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { + } + + /** + * A site definition allowing server farm to be set. + */ + interface WithAppServicePlan { + WithCreate withNewAppServicePlan(); + WithCreate withNewAppServicePlan(String name, AppServicePricingTier pricingTier); + WithCreate withExistingAppServicePlan(String appServicePlanName); + } + + interface WithHostNameSslStates { + WithCreate disableSsl(String hostName); + WithCreate enableSniSsl(String hostName, String thumbprint); + WithCreate enableIpBasedSsl(String hostName, String thumbprint, String virtualIp); + } + + interface WithSiteEnabled { + WithCreate siteEnabled(boolean enabled); + } + + interface WithScmSiteAlsoStopped { + WithCreate alsoStopScmSiteWhenStopped(boolean scmSiteAlsoStopped); + } + + interface WithClientAffinityEnabled { + WithCreate clientAffinityEnabled(boolean enabled); + } + + interface WithClientCertEnabled { + WithCreate clientCertEnabled(boolean enabled); + } + + /** + * A site definition with sufficient inputs to create a new + * website in the cloud, but exposing additional optional inputs to + * specify. + */ + interface WithCreate extends + Creatable, + DefinitionStages.WithHostNameSslStates { + } + } + + /** + * Grouping of all the site update stages. + */ + interface UpdateStages { + /** + * A site definition allowing server farm to be set. + */ + interface WithAppServicePlan { + Update withNewAppServicePlan(); + Update withNewAppServicePlan(String name, AppServicePricingTier pricingTier); + Update withExistingAppServicePlan(String appServicePlanName); + } + + interface WithHostNameSslStates { + Update disableSsl(String hostName); + Update enableSniSsl(String hostName, String thumbprint); + Update enableIpBasedSsl(String hostName, String thumbprint, String virtualIp); + } + + interface WithHostNameBinding { + HostNameBinding.DefinitionStages.Blank defineHostNameBinding(String name); + } + } + + /** + * The template for a site update operation, containing all the settings that can be modified. + */ + interface Update extends + Appliable, + UpdateStages.WithAppServicePlan, + UpdateStages.WithHostNameSslStates, + UpdateStages.WithHostNameBinding { + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApps.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApps.java new file mode 100644 index 0000000000000..5b32e48df08f2 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApps.java @@ -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 WebApps extends + SupportsCreating, + SupportsDeleting, + SupportsListingByGroup, + SupportsGettingByGroup, + SupportsGettingById, + SupportsDeletingByGroup { +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServiceManager.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServiceManager.java new file mode 100644 index 0000000000000..a0d9e72c102a1 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServiceManager.java @@ -0,0 +1,133 @@ +/** + * 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.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.RestClient; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.resources.fluentcore.arm.AzureConfigurable; +import com.microsoft.azure.management.resources.fluentcore.arm.implementation.AzureConfigurableImpl; +import com.microsoft.azure.management.resources.fluentcore.arm.implementation.Manager; +import com.microsoft.azure.management.website.AppServicePlans; +import com.microsoft.azure.management.website.CertificateOrders; +import com.microsoft.azure.management.website.Certificates; +import com.microsoft.azure.management.website.WebApps; +import com.microsoft.rest.credentials.ServiceClientCredentials; + +/** + * Entry point to Azure storage resource management. + */ +public final class AppServiceManager extends Manager { + // Collections + private WebApps webApps; + private AppServicePlans appServicePlans; + private CertificateOrders certificateOrders; + private Certificates certificates; + + /** + * Get a Configurable instance that can be used to create StorageManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new AppServiceManager.ConfigurableImpl(); + } + + /** + * Creates an instance of StorageManager that exposes storage resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the StorageManager + */ + public static AppServiceManager authenticate(ServiceClientCredentials credentials, String subscriptionId) { + return new AppServiceManager(AzureEnvironment.AZURE.newRestClientBuilder() + .withCredentials(credentials) + .build(), subscriptionId); + } + + /** + * Creates an instance of StorageManager that exposes storage resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the StorageManager + */ + public static AppServiceManager authenticate(RestClient restClient, String subscriptionId) { + return new AppServiceManager(restClient, subscriptionId); + } + + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of StorageManager that exposes storage management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing storage management API entry points that work across subscriptions + */ + AppServiceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { + public AppServiceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return AppServiceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + + private AppServiceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new WebSiteManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } + + /** + * @return the web app management API entry point + */ + public WebApps sites() { + if (webApps == null) { + webApps = new WebAppsImpl(innerManagementClient.webApps(), this); + } + return webApps; + } + + /** + * @return the app service plan management API entry point + */ + public AppServicePlans appServicePlans() { + if (appServicePlans == null) { + appServicePlans = new AppServicePlansImpl(innerManagementClient.appServicePlans(), this); + } + return appServicePlans; + } + + /** + * @return the certificate order management API entry point + */ + public CertificateOrders certificateOrders() { + if (certificateOrders == null) { + certificateOrders = new CertificateOrdersImpl(innerManagementClient.appServiceCertificateOrders(), this); + } + return certificateOrders; + } + + /** + * @return the certificate management API entry point + */ + public Certificates certificates() { + if (certificates == null) { + certificates = new CertificatesImpl(innerManagementClient.certificates(), this); + } + return certificates; + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlanImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlanImpl.java new file mode 100644 index 0000000000000..00146f8171e23 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlanImpl.java @@ -0,0 +1,111 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; +import com.microsoft.azure.management.website.AppServicePlan; +import com.microsoft.azure.management.website.AppServicePricingTier; +import com.microsoft.azure.management.website.HostingEnvironmentProfile; +import com.microsoft.azure.management.website.SkuDescription; +import com.microsoft.azure.management.website.StatusOptions; +import rx.Observable; + +/** + * The implementation for {@link AppServicePlan}. + */ +class AppServicePlanImpl + extends + GroupableResourceImpl< + AppServicePlan, + AppServicePlanInner, + AppServicePlanImpl, + AppServiceManager> + implements + AppServicePlan, + AppServicePlan.Definition, + AppServicePlan.Update { + + private final AppServicePlansInner client; + + AppServicePlanImpl(String name, AppServicePlanInner innerObject, final AppServicePlansInner client, AppServiceManager manager) { + super(name, innerObject, manager); + this.client = client; + } + + @Override + public Observable createResourceAsync() { + return client.createOrUpdateAsync(resourceGroupName(), name(), inner()) + .map(innerToFluentMap(this)); + } + + @Override + public AppServicePlan refresh() { + this.setInner(client.get(resourceGroupName(), name())); + return this; + } + + @Override + public String workerTierName() { + return inner().workerTierName(); + } + + @Override + public StatusOptions status() { + return inner().status(); + } + + @Override + public String subscription() { + return inner().subscription(); + } + + @Override + public String adminSiteName() { + return inner().adminSiteName(); + } + + @Override + public HostingEnvironmentProfile hostingEnvironmentProfile() { + return inner().hostingEnvironmentProfile(); + } + + @Override + public int maximumNumberOfWorkers() { + return inner().maximumNumberOfWorkers(); + } + + @Override + public String geoRegion() { + return inner().geoRegion(); + } + + @Override + public boolean perSiteScaling() { + return inner().perSiteScaling(); + } + + @Override + public int numberOfSites() { + return inner().numberOfSites(); + } + + @Override + public String resourceGroup() { + return inner().resourceGroup(); + } + + @Override + public SkuDescription sku() { + return inner().sku(); + } + + @Override + public AppServicePlanImpl withPricingTier(AppServicePricingTier pricingTier) { + inner().withSku(pricingTier.toSkuDescription()); + return this; + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java new file mode 100644 index 0000000000000..3cf5c70b12582 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java @@ -0,0 +1,67 @@ +/** + * 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.implementation; + +import com.microsoft.azure.PagedList; +import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import com.microsoft.azure.management.website.AppServicePlan; +import com.microsoft.azure.management.website.AppServicePlans; +import rx.Observable; +import rx.functions.Func1; + +/** + * The implementation for {@link AppServicePlans}. + */ +class AppServicePlansImpl + extends GroupableResourcesImpl< + AppServicePlan, + AppServicePlanImpl, + AppServicePlanInner, + AppServicePlansInner, + AppServiceManager> + implements AppServicePlans { + + AppServicePlansImpl(AppServicePlansInner innerCollection, AppServiceManager manager) { + super(innerCollection, manager); + } + + @Override + public AppServicePlan getByGroup(String groupName, String name) { + return wrapModel(innerCollection.get(groupName, name)); + } + + @Override + public Observable deleteAsync(String groupName, String name) { + return innerCollection.deleteAsync(groupName, name) + .map(new Func1() { + @Override + public Void call(Object o) { + return null; + } + }); + } + + @Override + public PagedList listByGroup(String resourceGroupName) { + return wrapList(innerCollection.listByResourceGroup(resourceGroupName)); + } + + @Override + protected AppServicePlanImpl wrapModel(String name) { + return new AppServicePlanImpl(name, new AppServicePlanInner(), innerCollection, myManager); + } + + @Override + protected AppServicePlanImpl wrapModel(AppServicePlanInner inner) { + return new AppServicePlanImpl(inner.name(), inner, innerCollection, myManager); + } + + @Override + public AppServicePlanImpl define(String name) { + return wrapModel(name); + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateDetailsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateDetailsImpl.java new file mode 100644 index 0000000000000..cc25867095b52 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateDetailsImpl.java @@ -0,0 +1,72 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.resources.fluentcore.model.implementation.IndexableWrapperImpl; +import com.microsoft.azure.management.website.AppServicePlan; +import com.microsoft.azure.management.website.CertificateDetails; +import org.joda.time.DateTime; + +/** + * The implementation for {@link AppServicePlan}. + */ +class CertificateDetailsImpl + extends + IndexableWrapperImpl< + CertificateDetailsInner> + implements + CertificateDetails { + + CertificateDetailsImpl(CertificateDetailsInner innerObject) { + super(innerObject); + } + + @Override + public Integer version() { + return inner().version(); + } + + @Override + public String serialNumber() { + return inner().serialNumber(); + } + + @Override + public String thumbprint() { + return inner().thumbprint(); + } + + @Override + public String subject() { + return inner().subject(); + } + + @Override + public DateTime notBefore() { + return inner().notBefore(); + } + + @Override + public DateTime notAfter() { + return inner().notAfter(); + } + + @Override + public String signatureAlgorithm() { + return inner().signatureAlgorithm(); + } + + @Override + public String issuer() { + return inner().issuer(); + } + + @Override + public String rawData() { + return inner().rawData(); + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateImpl.java new file mode 100644 index 0000000000000..063a620428582 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateImpl.java @@ -0,0 +1,136 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; +import com.microsoft.azure.management.website.AppServicePlan; +import com.microsoft.azure.management.website.Certificate; +import com.microsoft.azure.management.website.HostingEnvironmentProfile; +import org.joda.time.DateTime; +import rx.Observable; + +import java.util.ArrayList; +import java.util.List; + +/** + * The implementation for {@link AppServicePlan}. + */ +class CertificateImpl + extends + GroupableResourceImpl< + Certificate, + CertificateInner, + CertificateImpl, + AppServiceManager> + implements + Certificate, + Certificate.Definition, + Certificate.Update { + + private final CertificatesInner client; + + CertificateImpl(String key, CertificateInner innerObject, final CertificatesInner client, AppServiceManager manager) { + super(key, innerObject, manager); + this.client = client; + } + + @Override + public String friendlyName() { + return inner().friendlyName(); + } + + @Override + public String subjectName() { + return inner().subjectName(); + } + + @Override + public List hostNames() { + return inner().hostNames(); + } + + @Override + public String pfxBlob() { + return inner().pfxBlob(); + } + + @Override + public String siteName() { + return inner().siteName(); + } + + @Override + public String selfLink() { + return inner().selfLink(); + } + + @Override + public String issuer() { + return inner().issuer(); + } + + @Override + public DateTime issueDate() { + return inner().issueDate(); + } + + @Override + public DateTime expirationDate() { + return inner().expirationDate(); + } + + @Override + public String password() { + return inner().password(); + } + + @Override + public String thumbprint() { + return inner().thumbprint(); + } + + @Override + public Boolean valid() { + return inner().valid(); + } + + @Override + public String cerBlob() { + return inner().cerBlob(); + } + + @Override + public String publicKeyHash() { + return inner().publicKeyHash(); + } + + @Override + public HostingEnvironmentProfile hostingEnvironmentProfile() { + return inner().hostingEnvironmentProfile(); + } + + @Override + public Certificate refresh() { + this.setInner(client.get(resourceGroupName(), name())); + return this; + } + + @Override + public CertificateImpl withHostName(String hostName) { + if (inner().hostNames() == null) { + inner().withHostNames(new ArrayList()); + } + inner().hostNames().add(hostName); + return this; + } + + @Override + public Observable createResourceAsync() { + return client.createOrUpdateAsync(resourceGroupName(), name(), inner()) + .map(innerToFluentMap(this)); + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrderImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrderImpl.java new file mode 100644 index 0000000000000..42e6588d9ce42 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrderImpl.java @@ -0,0 +1,152 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; +import com.microsoft.azure.management.website.AppServicePlan; +import com.microsoft.azure.management.website.CertificateOrder; +import com.microsoft.azure.management.website.CertificateOrderStatus; +import com.microsoft.azure.management.website.CertificateProductType; +import com.microsoft.azure.management.website.ProvisioningState; +import org.joda.time.DateTime; +import rx.Observable; + +import java.util.Map; + +/** + * The implementation for {@link AppServicePlan}. + */ +class CertificateOrderImpl + extends + GroupableResourceImpl< + CertificateOrder, + AppServiceCertificateOrderInner, + CertificateOrderImpl, + AppServiceManager> + implements + CertificateOrder, + CertificateOrder.Definition, + CertificateOrder.Update { + + private final AppServiceCertificateOrdersInner client; + + CertificateOrderImpl(String key, AppServiceCertificateOrderInner innerObject, final AppServiceCertificateOrdersInner client, AppServiceManager manager) { + super(key, innerObject, manager); + this.client = client; + this.withRegion("global"); + } + + @Override + public CertificateOrder refresh() { + this.setInner(client.get(resourceGroupName(), name())); + return this; + } + + @Override + public Map certificates() { + return inner().certificates(); + } + + @Override + public String distinguishedName() { + return inner().distinguishedName(); + } + + @Override + public String domainVerificationToken() { + return inner().domainVerificationToken(); + } + + @Override + public int validityInYears() { + return inner().validityInYears(); + } + + @Override + public int keySize() { + return inner().keySize(); + } + + @Override + public CertificateProductType productType() { + return inner().productType(); + } + + @Override + public boolean autoRenew() { + return inner().autoRenew(); + } + + @Override + public ProvisioningState provisioningState() { + return inner().provisioningState(); + } + + @Override + public CertificateOrderStatus status() { + return inner().status(); + } + + @Override + public CertificateDetailsImpl signedCertificate() { + return new CertificateDetailsImpl(inner().signedCertificate()); + } + + @Override + public String csr() { + return inner().csr(); + } + + @Override + public CertificateDetailsImpl intermediate() { + return new CertificateDetailsImpl(inner().intermediate()); + } + + @Override + public CertificateDetailsImpl root() { + return new CertificateDetailsImpl(inner().root()); + } + + @Override + public String serialNumber() { + return null; + } + + @Override + public DateTime lastCertificateIssuanceTime() { + return null; + } + + @Override + public DateTime expirationTime() { + return null; + } + + @Override + public CertificateOrderImpl withHostName(String hostName) { + inner().withDistinguishedName("CN=" + hostName); + return this; + } + + @Override + public CertificateOrderImpl withSku(CertificateProductType sku) { + inner().withProductType(sku); + return this; + } + + @Override + public CertificateOrderImpl withValidYears(int years) { + inner().withValidityInYears(years); + return this; + } + + @Override + public Observable createResourceAsync() { + return client.createOrUpdateAsync(resourceGroupName(), name(), inner()) + .map(innerToFluentMap(this)); + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java new file mode 100644 index 0000000000000..f3b59d15ab823 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java @@ -0,0 +1,68 @@ +/** + * 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.implementation; + +import com.microsoft.azure.PagedList; +import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import com.microsoft.azure.management.website.AppServicePlans; +import com.microsoft.azure.management.website.CertificateOrder; +import com.microsoft.azure.management.website.CertificateOrders; +import rx.Observable; +import rx.functions.Func1; + +/** + * The implementation for {@link AppServicePlans}. + */ +class CertificateOrdersImpl + extends GroupableResourcesImpl< + CertificateOrder, + CertificateOrderImpl, + AppServiceCertificateOrderInner, + AppServiceCertificateOrdersInner, + AppServiceManager> + implements CertificateOrders { + + CertificateOrdersImpl(AppServiceCertificateOrdersInner innerCollection, AppServiceManager manager) { + super(innerCollection, manager); + } + + @Override + public CertificateOrder getByGroup(String groupName, String name) { + return wrapModel(innerCollection.get(groupName, name)); + } + + @Override + public Observable deleteAsync(String groupName, String name) { + return innerCollection.deleteCertificateOrderAsync(groupName, name) + .map(new Func1() { + @Override + public Void call(Object o) { + return null; + } + }); + } + + @Override + public PagedList listByGroup(String resourceGroupName) { + return wrapList(innerCollection.listByResourceGroup(resourceGroupName)); + } + + @Override + protected CertificateOrderImpl wrapModel(String name) { + return new CertificateOrderImpl(name, new AppServiceCertificateOrderInner(), innerCollection, myManager); + } + + @Override + protected CertificateOrderImpl wrapModel(AppServiceCertificateOrderInner inner) { + return new CertificateOrderImpl(inner.name(), inner, innerCollection, myManager); + } + + @Override + public CertificateOrderImpl define(String name) { + return wrapModel(name); + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java new file mode 100644 index 0000000000000..5c6f282db6784 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java @@ -0,0 +1,68 @@ +/** + * 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.implementation; + +import com.microsoft.azure.PagedList; +import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import com.microsoft.azure.management.website.AppServicePlans; +import com.microsoft.azure.management.website.Certificate; +import com.microsoft.azure.management.website.Certificates; +import rx.Observable; +import rx.functions.Func1; + +/** + * The implementation for {@link AppServicePlans}. + */ +class CertificatesImpl + extends GroupableResourcesImpl< + Certificate, + CertificateImpl, + CertificateInner, + CertificatesInner, + AppServiceManager> + implements Certificates { + + CertificatesImpl(CertificatesInner innerCollection, AppServiceManager manager) { + super(innerCollection, manager); + } + + @Override + public Certificate getByGroup(String groupName, String name) { + return wrapModel(innerCollection.get(groupName, name)); + } + + @Override + public PagedList listByGroup(String resourceGroupName) { + return wrapList(innerCollection.listByResourceGroup(resourceGroupName)); + } + + @Override + protected CertificateImpl wrapModel(String name) { + return new CertificateImpl(name, new CertificateInner(), innerCollection, myManager); + } + + @Override + protected CertificateImpl wrapModel(CertificateInner inner) { + return new CertificateImpl(inner.name(), inner, innerCollection, myManager); + } + + @Override + public CertificateImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable deleteAsync(String groupName, String name) { + return innerCollection.deleteAsync(groupName, name) + .map(new Func1() { + @Override + public Void call(Object o) { + return null; + } + }); + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/HostNameBindingImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/HostNameBindingImpl.java new file mode 100644 index 0000000000000..3806f029da0e5 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/HostNameBindingImpl.java @@ -0,0 +1,162 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.resources.fluentcore.arm.Region; +import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; +import com.microsoft.azure.management.resources.fluentcore.model.Creatable; +import com.microsoft.azure.management.website.AzureResourceType; +import com.microsoft.azure.management.website.CustomHostNameDnsRecordType; +import com.microsoft.azure.management.website.HostNameBinding; +import com.microsoft.azure.management.website.HostNameType; +import com.microsoft.azure.management.website.WebApp; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import rx.Observable; +import rx.functions.Func1; + +import java.util.Map; + +/** + * A host name binding object. + */ +class HostNameBindingImpl + extends ExternalChildResourceImpl + implements + Creatable, + HostNameBinding, + HostNameBinding.Definition { + private WebAppsInner client; + HostNameBindingImpl(String name, HostNameBindingInner innerObject, WebAppImpl parent, WebAppsInner client) { + super(name, parent, innerObject); + this.client = client; + } + + @Override + public String id() { + return inner().id(); + } + + @Override + public String type() { + return inner().type(); + } + + @Override + public String regionName() { + return inner().location(); + } + + @Override + public Region region() { + return Region.fromName(inner().location()); + } + + @Override + public Map tags() { + return inner().getTags(); + } + + @Override + public String hostNameBindingName() { + return inner().hostNameBindingName(); + } + + @Override + public String siteName() { + return inner().siteName(); + } + + @Override + public String domainId() { + return inner().domainId(); + } + + @Override + public String azureResourceName() { + return inner().azureResourceName(); + } + + @Override + public AzureResourceType azureResourceType() { + return inner().azureResourceType(); + } + + @Override + public CustomHostNameDnsRecordType customHostNameDnsRecordType() { + return inner().customHostNameDnsRecordType(); + } + + @Override + public HostNameType hostNameType() { + return inner().hostNameType(); + } + + @Override + public WebAppImpl attach() { + parent().withHostNameBinding(this); + return parent(); + } + + @Override + public HostNameBindingImpl withHostNameType(HostNameType hostNameType) { + inner().withHostNameType(hostNameType); + return this; + } + + @Override + public HostNameBindingImpl withHostNameDnsRecordType(CustomHostNameDnsRecordType hostNameDnsRecordType) { + inner().withCustomHostNameDnsRecordType(hostNameDnsRecordType); + return this; + } + + @Override + public HostNameBindingImpl refresh() { + this.setInner(client.getHostNameBinding(parent().resourceGroupName(), parent().name(), name())); + return this; + } + + @Override + public HostNameBinding create() { + createAsync().toBlocking().subscribe(); + return this; + } + + @Override + public ServiceCall createAsync(ServiceCallback callback) { + return ServiceCall.create(createAsync().map(new Func1>() { + @Override + public ServiceResponse call(HostNameBinding hostNameBinding) { + return new ServiceResponse<>(hostNameBinding, null); + } + }), callback); + } + + @Override + public Observable createAsync() { + final HostNameBinding self = this; + return client.createOrUpdateHostNameBindingAsync(parent().resourceGroupName(), parent().name(), name(), inner()) + .map(new Func1() { + @Override + public HostNameBinding call(HostNameBindingInner hostNameBindingInner) { + setInner(hostNameBindingInner); + return self; + } + }); + } + + @Override + public Observable updateAsync() { + return null; + } + + @Override + public Observable deleteAsync() { + return null; + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppImpl.java new file mode 100644 index 0000000000000..60544baec6b93 --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppImpl.java @@ -0,0 +1,328 @@ +/** + * 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.implementation; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; +import com.microsoft.azure.management.resources.fluentcore.utils.ResourceNamer; +import com.microsoft.azure.management.website.AppServicePlan; +import com.microsoft.azure.management.website.AppServicePricingTier; +import com.microsoft.azure.management.website.AzureResourceType; +import com.microsoft.azure.management.website.CloningInfo; +import com.microsoft.azure.management.website.HostNameBinding; +import com.microsoft.azure.management.website.HostNameSslState; +import com.microsoft.azure.management.website.HostingEnvironmentProfile; +import com.microsoft.azure.management.website.SiteAvailabilityState; +import com.microsoft.azure.management.website.SslState; +import com.microsoft.azure.management.website.UsageState; +import com.microsoft.azure.management.website.WebApp; +import org.joda.time.DateTime; +import rx.Observable; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * The implementation for {@link WebApp}. + */ +class WebAppImpl + extends GroupableResourceImpl< + WebApp, + SiteInner, + WebAppImpl, + AppServiceManager> + implements + WebApp, + WebApp.Definition, + WebApp.Update { + + private final WebAppsInner client; + private Map hostNameSslStateMap; + + WebAppImpl(String key, SiteInner innerObject, final WebAppsInner client, AppServiceManager manager) { + super(key, innerObject, manager); + this.client = client; + this.hostNameSslStateMap = new HashMap<>(); + if (innerObject.hostNameSslStates() != null) { + for (HostNameSslState hostNameSslState : innerObject.hostNameSslStates()) { + hostNameSslStateMap.put(hostNameSslState.name(), hostNameSslState); + } + } + } + + @Override + public String siteName() { + return inner().name(); + } + + @Override + public String state() { + return inner().state(); + } + + @Override + public List hostNames() { + return inner().hostNames(); + } + + @Override + public String repositorySiteName() { + return inner().repositorySiteName(); + } + + @Override + public UsageState usageState() { + return inner().usageState(); + } + + @Override + public boolean enabled() { + return inner().enabled(); + } + + @Override + public List enabledHostNames() { + return inner().enabledHostNames(); + } + + @Override + public SiteAvailabilityState availabilityState() { + return inner().availabilityState(); + } + + @Override + public List hostNameSslStates() { + return inner().hostNameSslStates(); + } + + @Override + public String serverFarmId() { + return inner().serverFarmId(); + } + + @Override + public DateTime lastModifiedTimeUtc() { + return inner().lastModifiedTimeUtc(); + } + + @Override + public SiteConfigInner siteConfig() { + return inner().siteConfig(); + } + + @Override + public List trafficManagerHostNames() { + return inner().trafficManagerHostNames(); + } + + @Override + public boolean premiumAppDeployed() { + return inner().premiumAppDeployed(); + } + + @Override + public boolean scmSiteAlsoStopped() { + return inner().scmSiteAlsoStopped(); + } + + @Override + public String targetSwapSlot() { + return inner().targetSwapSlot(); + } + + @Override + public HostingEnvironmentProfile hostingEnvironmentProfile() { + return inner().hostingEnvironmentProfile(); + } + + @Override + public String microService() { + return inner().microService(); + } + + @Override + public String gatewaySiteName() { + return inner().gatewaySiteName(); + } + + @Override + public boolean clientAffinityEnabled() { + return inner().clientAffinityEnabled(); + } + + @Override + public boolean clientCertEnabled() { + return inner().clientCertEnabled(); + } + + @Override + public boolean hostNamesDisabled() { + return false; + } + + @Override + public String outboundIpAddresses() { + return inner().outboundIpAddresses(); + } + + @Override + public int containerSize() { + return inner().containerSize(); + } + + @Override + public int maxNumberOfWorkers() { + return inner().maxNumberOfWorkers(); + } + + @Override + public CloningInfo cloningInfo() { + return inner().cloningInfo(); + } + + @Override + public String resourceGroup() { + return inner().resourceGroup(); + } + + @Override + public boolean isDefaultContainer() { + return inner().isDefaultContainer(); + } + + @Override + public String defaultHostName() { + return inner().defaultHostName(); + } + + @Override + public List hostNameBindings() throws CloudException, IOException { + //TODO: Use wrapList() + List collectionInner = client.listHostNameBindings(resourceGroupName(), name()); + List hostNameBindings = new ArrayList<>(); + for (HostNameBindingInner inner : collectionInner) { + hostNameBindings.add(new HostNameBindingImpl(inner.name(), inner, this, client)); + } + return hostNameBindings; + } + + @Override + public WebAppImpl refresh() { + this.setInner(client.get(resourceGroupName(), name())); + return this; + } + + @Override + public WebAppImpl withNewAppServicePlan() { + String appServicePlanName = ResourceNamer.randomResourceName(name(), 10); + AppServicePlan.DefinitionStages.WithCreate creatable = myManager.appServicePlans().define(appServicePlanName) + .withRegion(region()) + .withNewResourceGroup(resourceGroupName()) + .withPricingTier(AppServicePricingTier.FREE_F1); + addCreatableDependency(creatable); + inner().withServerFarmId(appServicePlanName); + return this; + } + + @Override + public WebAppImpl withNewAppServicePlan(String name, AppServicePricingTier pricingTier) { + AppServicePlan.DefinitionStages.WithCreate creatable = myManager.appServicePlans().define(name) + .withRegion(region()) + .withNewResourceGroup(resourceGroupName()) + .withPricingTier(pricingTier); + addCreatableDependency(creatable); + inner().withServerFarmId(name); + return this; + } + + @Override + public WebAppImpl withExistingAppServicePlan(String appServicePlanName) { + inner().withServerFarmId(appServicePlanName); + return this; + } + + private boolean isUpdateSsl(String hostName) { + boolean update = false; + if (hostNameSslStates() != null) { + for (HostNameSslState hostNameSslState : hostNameSslStates()) { + if (hostName.equals(hostNameSslState.name())) { + update = true; + } + } + } + return update; + } + + @Override + public WebAppImpl disableSsl(String hostName) { + if (hostName == null) { + throw new IllegalArgumentException("Null host name"); + } + hostNameSslStateMap.put(hostName, new HostNameSslState() + .withName(hostName) + .withSslState(SslState.DISABLED) + .withToUpdate(isUpdateSsl(hostName))); + return this; + } + + @Override + public WebAppImpl enableSniSsl(String hostName, String thumbprint) { + if (hostName == null) { + throw new IllegalArgumentException("Null host name"); + } + hostNameSslStateMap.put(hostName, new HostNameSslState() + .withName(hostName) + .withSslState(SslState.SNI_ENABLED) + .withThumbprint(thumbprint) + .withToUpdate(isUpdateSsl(hostName))); + return this; + } + + @Override + public WebAppImpl enableIpBasedSsl(String hostName, String thumbprint, String virtualIp) { + if (hostName == null) { + throw new IllegalArgumentException("Null host name"); + } + hostNameSslStateMap.put(hostName, new HostNameSslState() + .withName(hostName) + .withSslState(SslState.SNI_ENABLED) + .withThumbprint(thumbprint) + .withVirtualIP(virtualIp) + .withToUpdate(isUpdateSsl(hostName))); + return this; + } + + @Override + public HostNameBinding.DefinitionStages.Blank defineHostNameBinding(String name) { + HostNameBindingInner inner = new HostNameBindingInner(); + inner.withSiteName(name()); + inner.withLocation(regionName()); + inner.withAzureResourceType(AzureResourceType.WEBSITE); + return new HostNameBindingImpl(name, inner, this, client); + } + + WebAppImpl withHostNameBinding(HostNameBindingImpl hostNameBinding) { + addCreatableDependency(hostNameBinding); + return this; + } + + AppServiceManager myManager() { + return super.myManager; + } + + @Override + public Observable createResourceAsync() { + if (hostNameSslStateMap.size() > 0) { + inner().withHostNameSslStates(new ArrayList<>(hostNameSslStateMap.values())); + } + return client.createOrUpdateAsync(resourceGroupName(), name(), inner()) + .map(innerToFluentMap(this)); + } +} \ No newline at end of file diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java new file mode 100644 index 0000000000000..0656ad6b1d31a --- /dev/null +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java @@ -0,0 +1,67 @@ +/** + * 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.implementation; + +import com.microsoft.azure.PagedList; +import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import com.microsoft.azure.management.website.WebApp; +import com.microsoft.azure.management.website.WebApps; +import rx.Observable; +import rx.functions.Func1; + +/** + * The implementation for {@link WebApps}. + */ +class WebAppsImpl + extends GroupableResourcesImpl< + WebApp, + WebAppImpl, + SiteInner, + WebAppsInner, + AppServiceManager> + implements WebApps { + + WebAppsImpl(WebAppsInner innerCollection, AppServiceManager manager) { + super(innerCollection, manager); + } + + @Override + public PagedList listByGroup(String resourceGroupName) { + return wrapList(innerCollection.listByResourceGroup(resourceGroupName)); + } + + @Override + public WebApp getByGroup(String groupName, String name) { + return wrapModel(innerCollection.get(groupName, name)); + } + + @Override + protected WebAppImpl wrapModel(String name) { + return new WebAppImpl(name, new SiteInner(), innerCollection, super.myManager); + } + + @Override + protected WebAppImpl wrapModel(SiteInner inner) { + return new WebAppImpl(inner.name(), inner, innerCollection, super.myManager); + } + + @Override + public WebAppImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable deleteAsync(String groupName, String name) { + return innerCollection.deleteAsync(groupName, name) + .map(new Func1() { + @Override + public Void call(Object o) { + return null; + } + }); + } +} \ No newline at end of file