public AzureWebsitesUsageClient(AzureManagementRestClient client, CertificateCloudCredentials credentials)
        {
            var azureWebsiteApiClient = new AzureWebsiteApiClient(client);

            _azureWebsitesInfoClient    = new AzureWebsitesInfoApiClient(azureWebsiteApiClient);
            _azureWebsitesMetricsClient = new AzureWebsitesMetricsApiClient(azureWebsiteApiClient);
            _metricsApiClient           = new AzureMetricsApiClient(credentials);
        }
        public static string FindWebspace(MetricsEndpointConfiguration config, string websiteName) {
            var infoClient = new AzureWebsitesInfoApiClient(new AzureWebsiteApiClient(new AzureManagementRestClient(config.GetCertificateCloudCredentials())));

            var website = infoClient.ListAzureWebsites().Result.FirstOrDefault(_=>_.Name ==  websiteName);
            if(website == null) {
                return null;
            }
            return website.Webspace;
        }
Exemple #3
0
        public static string FindWebspace(MetricsEndpointConfiguration config, string websiteName)
        {
            var infoClient = new AzureWebsitesInfoApiClient(new AzureWebsiteApiClient(new AzureManagementRestClient(config.GetCertificateCloudCredentials())));

            var website = infoClient.ListAzureWebsites().Result.FirstOrDefault(_ => _.Name == websiteName);

            if (website == null)
            {
                return(null);
            }
            return(website.Webspace);
        }
		public AzureWebsitesUsageClient(AzureManagementRestClient client, CertificateCloudCredentials credentials) {
			var azureWebsiteApiClient = new AzureWebsiteApiClient(client);
			_azureWebsitesInfoClient = new AzureWebsitesInfoApiClient(azureWebsiteApiClient);
			_azureWebsitesMetricsClient = new AzureWebsitesMetricsApiClient(azureWebsiteApiClient);
			_metricsApiClient =  new AzureMetricsApiClient(credentials);
		}
		public AzureSubscriptionInfoClient(MetricsEndpointConfiguration metricsEndpointConfiguration) {
			_subscriptionId = metricsEndpointConfiguration.SubscriptionId;
			_client = new AzureManagementRestClient(metricsEndpointConfiguration.GetCertificateCloudCredentials());
			_websiteInfoClient = new AzureWebsitesInfoApiClient(new AzureWebsiteApiClient(_client));
		}
 public AzureSubscriptionInfoClient(MetricsEndpointConfiguration metricsEndpointConfiguration)
 {
     _subscriptionId    = metricsEndpointConfiguration.SubscriptionId;
     _client            = new AzureManagementRestClient(metricsEndpointConfiguration.GetCertificateCloudCredentials());
     _websiteInfoClient = new AzureWebsitesInfoApiClient(new AzureWebsiteApiClient(_client));
 }