Esempio n. 1
0
        public WebSiteGetHistoricalUsageMetricsResponse GetWebAppUsageMetrics(string resourceGroupName, string webSiteName, string slotName, IList <string> metricNames,
                                                                              DateTime?startTime, DateTime?endTime, string timeGrain, bool instanceDetails)
        {
            WebSiteGetHistoricalUsageMetricsParameters parameters = new WebSiteGetHistoricalUsageMetricsParameters();

            parameters.MetricNames = metricNames;
            parameters.IncludeInstanceBreakdown = instanceDetails;
            parameters.EndTime   = endTime;
            parameters.StartTime = startTime;
            parameters.TimeGrain = timeGrain;
            var usageMetrics = WrappedWebsitesClient.WebSites.GetHistoricalUsageMetrics(resourceGroupName, webSiteName, slotName, parameters);

            return(usageMetrics);
        }
Esempio n. 2
0
 /// <summary>
 /// You can retrieve historical usage metrics for a site by issuing an
 /// HTTP GET request.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations.
 /// </param>
 /// <param name='webSpaceName'>
 /// The name of the web space.
 /// </param>
 /// <param name='webSiteName'>
 /// The name of the web site.
 /// </param>
 /// <param name='parameters'>
 /// The Get Web Site Historical Usage Metrics parameters.
 /// </param>
 /// <returns>
 /// The Get Web Site Historical Usage Metrics operation response.
 /// </returns>
 public static WebSiteGetHistoricalUsageMetricsResponse GetHistoricalUsageMetrics(this IWebSiteOperations operations, string webSpaceName, string webSiteName, WebSiteGetHistoricalUsageMetricsParameters parameters)
 {
     try
     {
         return(operations.GetHistoricalUsageMetricsAsync(webSpaceName, webSiteName, parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// You can retrieve historical usage metrics for a site by issuing an
 /// HTTP GET request.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations.
 /// </param>
 /// <param name='webSpaceName'>
 /// The name of the web space.
 /// </param>
 /// <param name='webSiteName'>
 /// The name of the web site.
 /// </param>
 /// <param name='parameters'>
 /// The Get Web Site Historical Usage Metrics parameters.
 /// </param>
 /// <returns>
 /// The Get Web Site Historical Usage Metrics operation response.
 /// </returns>
 public static Task <WebSiteGetHistoricalUsageMetricsResponse> GetHistoricalUsageMetricsAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName, WebSiteGetHistoricalUsageMetricsParameters parameters)
 {
     return(operations.GetHistoricalUsageMetricsAsync(webSpaceName, webSiteName, parameters, CancellationToken.None));
 }
Esempio n. 4
0
 /// <summary>
 /// You can retrieve historical usage metrics for a site by issuing an
 /// HTTP GET request.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations.
 /// </param>
 /// <param name='webSpaceName'>
 /// Required. The name of the web space.
 /// </param>
 /// <param name='webSiteName'>
 /// Required. The name of the web site.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Get Historical Usage Metrics
 /// Web Site operation.
 /// </param>
 /// <returns>
 /// The Get Historical Usage Metrics Web Site operation response.
 /// </returns>
 public static WebSiteGetHistoricalUsageMetricsResponse GetHistoricalUsageMetrics(this IWebSiteOperations operations, string webSpaceName, string webSiteName, WebSiteGetHistoricalUsageMetricsParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IWebSiteOperations)s).GetHistoricalUsageMetricsAsync(webSpaceName, webSiteName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }