FromResourceSku() static private method

static private FromResourceSku ( ResourceSku resourceSku ) : ServerSku
resourceSku ResourceSku
return ServerSku
Ejemplo n.º 1
0
        internal static AzureAnalysisServicesServer FromAnalysisServicesServer(AnalysisServicesServer server)
        {
            if (server == null)
            {
                return(null);
            }

            PsAzureAnalysisServicesFirewallConfig config = null;

            if (server.IpV4FirewallSettings != null)
            {
                List <PsAzureAnalysisServicesFirewallRule> rules = null;
                bool enablePowerBIService = false;
                if (server.IpV4FirewallSettings.FirewallRules != null)
                {
                    rules = new List <PsAzureAnalysisServicesFirewallRule>();
                    foreach (var rule in server.IpV4FirewallSettings.FirewallRules)
                    {
                        rules.Add(new PsAzureAnalysisServicesFirewallRule(rule.FirewallRuleName, rule.RangeStart, rule.RangeEnd));
                    }
                }

                if (server.IpV4FirewallSettings.EnablePowerBIService != null)
                {
                    enablePowerBIService = Convert.ToBoolean(server.IpV4FirewallSettings.EnablePowerBIService);
                }

                config = new PsAzureAnalysisServicesFirewallConfig(enablePowerBIService, rules);
            }

            ResourceIdentifier resourceIdentifier = new ResourceIdentifier(server.Id);

            return(new AzureAnalysisServicesServer()
            {
                AsAdministrators = server.AsAdministrators == null
                    ? new List <string>()
                    : new List <string>(server.AsAdministrators.Members),
                Location = server.Location,
                Name = server.Name,
                Type = server.Type,
                State = server.State,
                ProvisioningState = server.ProvisioningState,
                Id = server.Id,
                ServerFullName = server.ServerFullName,
                Sku = server.Sku != null?ServerSku.FromResourceSku(server.Sku) : new ServerSku(),
                          Tag = server.Tags != null ? new Dictionary <string, string>(server.Tags) : new Dictionary <string, string>(),
                          BackupBlobContainerUri = server.BackupBlobContainerUri == null ? String.Empty : server.BackupBlobContainerUri,
                          ResourceGroupName = resourceIdentifier.ResourceGroupName,
                          DefaultConnectionMode = server.QuerypoolConnectionMode.ToString(),
                          FirewallConfig = config,
                          GatewayInfo = server.GatewayDetails != null?ServerGateway.FromResourceGateway(server.GatewayDetails) : null
            });
        }
Ejemplo n.º 2
0
        internal static AzureAnalysisServicesServer FromAnalysisServicesServer(AnalysisServicesServer server)
        {
            if (server == null)
            {
                return(null);
            }

            return(new AzureAnalysisServicesServer()
            {
                AsAdministrators = server.AsAdministrators == null
                    ? new List <string>()
                    : new List <string>(server.AsAdministrators.Members),
                Location = server.Location,
                Name = server.Name,
                Type = server.Type,
                ProvisioningState = server.ProvisioningState,
                Id = server.Id,
                Sku = ServerSku.FromResourceSku(server.Sku),
                Tag = new Dictionary <string, string>(server.Tags)
            });
        }
Ejemplo n.º 3
0
        internal static AzureAnalysisServicesServerDetail FromAnalysisServicesServer(AnalysisServicesServer server)
        {
            if (server == null)
            {
                return(null);
            }

            return(new AzureAnalysisServicesServerDetail()
            {
                AsAdministrators = server.AsAdministrators == null
                    ? new List <string>()
                    : new List <string>(server.AsAdministrators.Members),
                Location = server.Location,
                Name = server.Name,
                Type = server.Type,
                State = server.State,
                ProvisioningState = server.ProvisioningState,
                Id = server.Id,
                ServerFullName = server.ServerFullName,
                Sku = server.Sku != null?ServerSku.FromResourceSku(server.Sku) : new Dictionary <string, string>(),
                          Tag = server.Tags != null ? new Dictionary <string, string>(server.Tags) : new Dictionary <string, string>(),
                          BackupBlobContainerUri = server.BackupBlobContainerUri == null ? String.Empty : server.BackupBlobContainerUri
            });
        }