Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information.
/** * 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.implementation; import com.microsoft.azure.AzureEnvironment; import com.microsoft.azure.AzureResponseBuilder; import com.microsoft.azure.credentials.AzureTokenCredentials; import com.microsoft.azure.management.apigeneration.Beta; import com.microsoft.azure.management.appservice.AppServiceCertificateOrders; import com.microsoft.azure.management.appservice.AppServiceCertificates; import com.microsoft.azure.management.appservice.AppServiceDomains; import com.microsoft.azure.management.appservice.AppServicePlans; import com.microsoft.azure.management.appservice.FunctionApps; import com.microsoft.azure.management.appservice.WebApps; import com.microsoft.azure.management.dns.implementation.DnsZoneManager; import com.microsoft.azure.management.graphrbac.implementation.GraphRbacManager; import com.microsoft.azure.management.keyvault.implementation.KeyVaultManager; 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.resources.fluentcore.utils.ProviderRegistrationInterceptor; import com.microsoft.azure.management.resources.fluentcore.utils.ResourceManagerThrottlingInterceptor; import com.microsoft.azure.management.storage.implementation.StorageManager; import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient;
Entry point to Azure storage resource management.
/** * Entry point to Azure storage resource management. */
@Beta public final class AppServiceManager extends Manager<AppServiceManager, WebSiteManagementClientImpl> { // Managers private final GraphRbacManager rbacManager; private final KeyVaultManager keyVaultManager; private final StorageManager storageManager; private final DnsZoneManager dnsZoneManager; // Collections private WebApps webApps; private AppServicePlans appServicePlans; private AppServiceCertificateOrders appServiceCertificateOrders; private AppServiceCertificates appServiceCertificates; private AppServiceDomains appServiceDomains; private FunctionApps functionApps; private RestClient restClient;
Get a Configurable instance that can be used to create StorageManager with optional configuration.
Returns:the instance allowing configurations
/** * 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.
Params:
  • credentials – the credentials to use
  • subscriptionId – the subscription UUID
Returns:the StorageManager
/** * 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(AzureTokenCredentials credentials, String subscriptionId) { return new AppServiceManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), credentials.domain(), subscriptionId); }
Creates an instance of StorageManager that exposes storage resource management API entry points.
Params:
  • restClient – the RestClient to be used for API calls.
  • tenantId – the tenant UUID
  • subscriptionId – the subscription UUID
Returns:the StorageManager
/** * Creates an instance of StorageManager that exposes storage resource management API entry points. * * @param restClient the RestClient to be used for API calls. * @param tenantId the tenant UUID * @param subscriptionId the subscription UUID * @return the StorageManager */
public static AppServiceManager authenticate(RestClient restClient, String tenantId, String subscriptionId) { return new AppServiceManager(restClient, tenantId, subscriptionId); }
The interface allowing configurations to be set.
/** * The interface allowing configurations to be set. */
public interface Configurable extends AzureConfigurable<Configurable> {
Creates an instance of StorageManager that exposes storage management API entry points.
Params:
  • credentials – the credentials to use
  • subscriptionId – the subscription UUID
Returns:the interface exposing AppService management API entry points that work across subscriptions
/** * 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 AppService management API entry points that work across subscriptions */
AppServiceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); }
The implementation for Configurable interface.
/** * The implementation for Configurable interface. */
private static final class ConfigurableImpl extends AzureConfigurableImpl<Configurable> implements Configurable { public AppServiceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return AppServiceManager.authenticate(buildRestClient(credentials), credentials.domain(), subscriptionId); } } private AppServiceManager(RestClient restClient, String tenantId, String subscriptionId) { super( restClient, subscriptionId, new WebSiteManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); keyVaultManager = KeyVaultManager.authenticate(restClient, tenantId, subscriptionId); storageManager = StorageManager.authenticate(restClient, subscriptionId); rbacManager = GraphRbacManager.authenticate(restClient, tenantId); dnsZoneManager = DnsZoneManager.authenticate(restClient, subscriptionId); this.restClient = restClient; }
Returns:the Graph RBAC manager instance.
/** * @return the Graph RBAC manager instance. */
GraphRbacManager rbacManager() { return rbacManager; }
Returns:the key vault manager instance.
/** * @return the key vault manager instance. */
KeyVaultManager keyVaultManager() { return keyVaultManager; } DnsZoneManager dnsZoneManager() { return dnsZoneManager; }
Returns:the storage manager instance.
/** * @return the storage manager instance. */
StorageManager storageManager() { return storageManager; } RestClient restClient() { return restClient; }
Returns:the web app management API entry point
/** * @return the web app management API entry point */
public WebApps webApps() { if (webApps == null) { webApps = new WebAppsImpl(this); } return webApps; }
Returns:the app service plan management API entry point
/** * @return the app service plan management API entry point */
public AppServicePlans appServicePlans() { if (appServicePlans == null) { appServicePlans = new AppServicePlansImpl(this); } return appServicePlans; }
Returns:the certificate order management API entry point
/** * @return the certificate order management API entry point */
public AppServiceCertificateOrders certificateOrders() { if (appServiceCertificateOrders == null) { appServiceCertificateOrders = new AppServiceCertificateOrdersImpl(this); } return appServiceCertificateOrders; }
Returns:the certificate management API entry point
/** * @return the certificate management API entry point */
public AppServiceCertificates certificates() { if (appServiceCertificates == null) { appServiceCertificates = new AppServiceCertificatesImpl(this); } return appServiceCertificates; }
Returns:the app service plan management API entry point
/** * @return the app service plan management API entry point */
public AppServiceDomains domains() { if (appServiceDomains == null) { appServiceDomains = new AppServiceDomainsImpl(this); } return appServiceDomains; }
Returns:the web app management API entry point
/** * @return the web app management API entry point */
public FunctionApps functionApps() { if (functionApps == null) { functionApps = new FunctionAppsImpl(this); } return functionApps; } }