public static AppServicePlan CreateOrUpdateServerFarm(this IAppServicePlansOperations serverFarm,
                                                       string resourceGroupName,
                                                       string name,
                                                       AppServicePlan appServicePlan)
 {
     return(serverFarm.CreateOrUpdate(resourceGroupName, name, appServicePlan));
 }
 /// <summary>
 /// Get all apps associated with an App Service plan.
 /// </summary>
 /// <remarks>
 /// Get all apps associated with an App Service plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <SiteInner> > ListWebAppsNextAsync(this IAppServicePlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWebAppsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get all App Service plans for a subcription.
 /// </summary>
 /// <remarks>
 /// Get all App Service plans for a subcription.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='detailed'>
 /// Specify &lt;code&gt;true&lt;/code&gt; to return all App Service plan
 /// properties. The default is &lt;code&gt;false&lt;/code&gt;, which returns a
 /// subset of the properties.
 /// Retrieval of all properties may increase the API latency.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <AppServicePlanInner> > ListAsync(this IAppServicePlansOperations operations, bool?detailed = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(detailed, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get an App Service plan.
 /// </summary>
 /// <remarks>
 /// Get an App Service plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AppServicePlanInner> GetAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Create or update a Virtual Network route in an App Service plan.
 /// </summary>
 /// <remarks>
 /// Create or update a Virtual Network route in an App Service plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='vnetName'>
 /// Name of the Virtual Network.
 /// </param>
 /// <param name='routeName'>
 /// Name of the Virtual Network route.
 /// </param>
 /// <param name='route'>
 /// Definition of the Virtual Network route.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <VnetRouteInner> UpdateVnetRouteAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, string vnetName, string routeName, VnetRouteInner route, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateVnetRouteWithHttpMessagesAsync(resourceGroupName, name, vnetName, routeName, route, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get all apps associated with an App Service plan.
 /// </summary>
 /// <remarks>
 /// Get all apps associated with an App Service plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='skipToken'>
 /// Skip to a web app in the list of webapps associated with app service plan.
 /// If specified, the resulting list will contain web apps starting from
 /// (including) the skipToken. Otherwise, the resulting list contains web apps
 /// from the start of the list
 /// </param>
 /// <param name='filter'>
 /// Supported filter: $filter=state eq running. Returns only web apps that are
 /// currently running
 /// </param>
 /// <param name='top'>
 /// List page size. If specified, results are paged.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <SiteInner> > ListWebAppsAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, string skipToken = default(string), string filter = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWebAppsWithHttpMessagesAsync(resourceGroupName, name, skipToken, filter, top, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get metrics for an App Serice plan.
 /// </summary>
 /// <remarks>
 /// Get metrics for an App Serice plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='details'>
 /// Specify &lt;code&gt;true&lt;/code&gt; to include instance details. The
 /// default is &lt;code&gt;false&lt;/code&gt;.
 /// </param>
 /// <param name='filter'>
 /// Return only usages/metrics specified in the filter. Filter conforms to
 /// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq
 /// 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq
 /// '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ResourceMetric> > ListMetricsAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, bool?details = default(bool?), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, name, details, filter, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 public static IEnumerable <Site> GetServerFarmSites(this IAppServicePlansOperations serverFarm,
                                                     string resourceGroupName,
                                                     string name,
                                                     string skipToken = null,
                                                     string filter    = null,
                                                     string top       = null)
 {
     return(serverFarm.ListWebApps(resourceGroupName, name, skipToken, filter, top));
 }
 public static AppServicePlan GetServerFarm(this IAppServicePlansOperations serverFarm,
                                            string resourceGroupName, string name)
 {
     return(serverFarm.Get(resourceGroupName, name));
 }
 public static void DeleteServerFarm(this IAppServicePlansOperations serverFarm,
                                     string resourceGroupName, string name)
 {
     serverFarm.Delete(resourceGroupName, name);
 }
 /// <summary>
 /// Get all apps that use a Hybrid Connection in an App Service Plan.
 /// </summary>
 /// <remarks>
 /// Get all apps that use a Hybrid Connection in an App Service Plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='namespaceName'>
 /// Name of the Hybrid Connection namespace.
 /// </param>
 /// <param name='relayName'>
 /// Name of the Hybrid Connection relay.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <string> > ListWebAppsByHybridConnectionAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWebAppsByHybridConnectionWithHttpMessagesAsync(resourceGroupName, name, namespaceName, relayName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Delete a Virtual Network route in an App Service plan.
 /// </summary>
 /// <remarks>
 /// Delete a Virtual Network route in an App Service plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='vnetName'>
 /// Name of the Virtual Network.
 /// </param>
 /// <param name='routeName'>
 /// Name of the Virtual Network route.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteVnetRouteAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, string vnetName, string routeName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteVnetRouteWithHttpMessagesAsync(resourceGroupName, name, vnetName, routeName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Restart all apps in an App Service plan.
 /// </summary>
 /// <remarks>
 /// Restart all apps in an App Service plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='softRestart'>
 /// Specify &lt;code&gt;true&lt;/code&gt; to performa a soft restart, applies
 /// the configuration settings and restarts the apps if necessary. The default
 /// is &lt;code&gt;false&lt;/code&gt;, which always restarts and reprovisions
 /// the apps
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task RestartWebAppsAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, bool?softRestart = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.RestartWebAppsWithHttpMessagesAsync(resourceGroupName, name, softRestart, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Get metrics that can be queried for an App Service plan, and their
 /// definitions.
 /// </summary>
 /// <remarks>
 /// Get metrics that can be queried for an App Service plan, and their
 /// definitions.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ResourceMetricDefinition> > ListMetricDefintionsAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListMetricDefintionsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 public static IEnumerable <AppServicePlan> GetServerFarms(this IAppServicePlansOperations serverFarm,
                                                           string resourceGroupName)
 {
     return(serverFarm.ListByResourceGroup(resourceGroupName));
 }
 /// <summary>
 /// Reboot a worker machine in an App Service plan.
 /// </summary>
 /// <remarks>
 /// Reboot a worker machine in an App Service plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='workerName'>
 /// Name of worker machine, which typically starts with RD.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task RebootWorkerAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, string workerName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.RebootWorkerWithHttpMessagesAsync(resourceGroupName, name, workerName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 public static IEnumerable <ResourceMetric> GetServerFarmMetrics(this IAppServicePlansOperations serverFarm,
                                                                 string resourceGroupName, string name, bool?details = default(bool?), string filter = null)
 {
     return(serverFarm.ListMetrics(resourceGroupName, name, details, filter));
 }
 /// <summary>
 /// Delete a Hybrid Connection in use in an App Service plan.
 /// </summary>
 /// <remarks>
 /// Delete a Hybrid Connection in use in an App Service plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group to which the resource belongs.
 /// </param>
 /// <param name='name'>
 /// Name of the App Service plan.
 /// </param>
 /// <param name='namespaceName'>
 /// Name of the Service Bus namespace.
 /// </param>
 /// <param name='relayName'>
 /// Name of the Service Bus relay.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteHybridConnectionAsync(this IAppServicePlansOperations operations, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteHybridConnectionWithHttpMessagesAsync(resourceGroupName, name, namespaceName, relayName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }