예제 #1
0
        internal static InfrastructureConfiguration DeserializeInfrastructureConfiguration(JsonElement element)
        {
            if (element.TryGetProperty("deploymentType", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "SingleServer": return(SingleServerConfiguration.DeserializeSingleServerConfiguration(element));

                case "ThreeTier": return(ThreeTierConfiguration.DeserializeThreeTierConfiguration(element));
                }
            }
            SapDeploymentType deploymentType   = default;
            string            appResourceGroup = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("deploymentType"))
                {
                    deploymentType = new SapDeploymentType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("appResourceGroup"))
                {
                    appResourceGroup = property.Value.GetString();
                    continue;
                }
            }
            return(new InfrastructureConfiguration(deploymentType, appResourceGroup));
        }
예제 #2
0
        internal static ThreeTierConfiguration DeserializeThreeTierConfiguration(JsonElement element)
        {
            Optional <NetworkConfiguration>          networkConfiguration   = default;
            CentralServerConfiguration               centralServer          = default;
            ApplicationServerConfiguration           applicationServer      = default;
            DatabaseConfiguration                    databaseServer         = default;
            Optional <HighAvailabilityConfiguration> highAvailabilityConfig = default;
            SapDeploymentType deploymentType   = default;
            string            appResourceGroup = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("networkConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("centralServer"))
                {
                    centralServer = CentralServerConfiguration.DeserializeCentralServerConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("applicationServer"))
                {
                    applicationServer = ApplicationServerConfiguration.DeserializeApplicationServerConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("databaseServer"))
                {
                    databaseServer = DatabaseConfiguration.DeserializeDatabaseConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("highAvailabilityConfig"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    highAvailabilityConfig = HighAvailabilityConfiguration.DeserializeHighAvailabilityConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("deploymentType"))
                {
                    deploymentType = new SapDeploymentType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("appResourceGroup"))
                {
                    appResourceGroup = property.Value.GetString();
                    continue;
                }
            }
            return(new ThreeTierConfiguration(deploymentType, appResourceGroup, networkConfiguration.Value, centralServer, applicationServer, databaseServer, highAvailabilityConfig.Value));
        }
예제 #3
0
 internal SingleServerConfiguration(SapDeploymentType deploymentType, string appResourceGroup, NetworkConfiguration networkConfiguration, SapDatabaseType?databaseType, ResourceIdentifier subnetId, VirtualMachineConfiguration virtualMachineConfiguration) : base(deploymentType, appResourceGroup)
 {
     NetworkConfiguration        = networkConfiguration;
     DatabaseType                = databaseType;
     SubnetId                    = subnetId;
     VirtualMachineConfiguration = virtualMachineConfiguration;
     DeploymentType              = deploymentType;
 }
예제 #4
0
 public SapSupportedSkusContent(AzureLocation appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, SapDatabaseType databaseType)
 {
     AppLocation    = appLocation;
     Environment    = environment;
     SapProduct     = sapProduct;
     DeploymentType = deploymentType;
     DatabaseType   = databaseType;
 }
예제 #5
0
 internal ThreeTierConfiguration(SapDeploymentType deploymentType, string appResourceGroup, NetworkConfiguration networkConfiguration, CentralServerConfiguration centralServer, ApplicationServerConfiguration applicationServer, DatabaseConfiguration databaseServer, HighAvailabilityConfiguration highAvailabilityConfig) : base(deploymentType, appResourceGroup)
 {
     NetworkConfiguration   = networkConfiguration;
     CentralServer          = centralServer;
     ApplicationServer      = applicationServer;
     DatabaseServer         = databaseServer;
     HighAvailabilityConfig = highAvailabilityConfig;
     DeploymentType         = deploymentType;
 }
예제 #6
0
 public SapSizingRecommendationContent(AzureLocation appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, long saps, long dbMemory, SapDatabaseType databaseType)
 {
     AppLocation    = appLocation;
     Environment    = environment;
     SapProduct     = sapProduct;
     DeploymentType = deploymentType;
     Saps           = saps;
     DBMemory       = dbMemory;
     DatabaseType   = databaseType;
 }
예제 #7
0
        internal static SingleServerConfiguration DeserializeSingleServerConfiguration(JsonElement element)
        {
            Optional <NetworkConfiguration> networkConfiguration = default;
            Optional <SapDatabaseType>      databaseType         = default;
            ResourceIdentifier          subnetId = default;
            VirtualMachineConfiguration virtualMachineConfiguration = default;
            SapDeploymentType           deploymentType = default;
            string appResourceGroup = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("networkConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("databaseType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    databaseType = new SapDatabaseType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("subnetId"))
                {
                    subnetId = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("virtualMachineConfiguration"))
                {
                    virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("deploymentType"))
                {
                    deploymentType = new SapDeploymentType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("appResourceGroup"))
                {
                    appResourceGroup = property.Value.GetString();
                    continue;
                }
            }
            return(new SingleServerConfiguration(deploymentType, appResourceGroup, networkConfiguration.Value, Optional.ToNullable(databaseType), subnetId, virtualMachineConfiguration));
        }
예제 #8
0
        public SapDiskConfigurationsContent(AzureLocation appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDatabaseType databaseType, SapDeploymentType deploymentType, string dbVmSku)
        {
            if (dbVmSku == null)
            {
                throw new ArgumentNullException(nameof(dbVmSku));
            }

            AppLocation    = appLocation;
            Environment    = environment;
            SapProduct     = sapProduct;
            DatabaseType   = databaseType;
            DeploymentType = deploymentType;
            DBVmSku        = dbVmSku;
        }
예제 #9
0
        internal static SingleServerRecommendationResult DeserializeSingleServerRecommendationResult(JsonElement element)
        {
            Optional <string> vmSku          = default;
            SapDeploymentType deploymentType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("vmSku"))
                {
                    vmSku = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("deploymentType"))
                {
                    deploymentType = new SapDeploymentType(property.Value.GetString());
                    continue;
                }
            }
            return(new SingleServerRecommendationResult(deploymentType, vmSku.Value));
        }
예제 #10
0
        internal static SapSizingRecommendationResult DeserializeSapSizingRecommendationResult(JsonElement element)
        {
            if (element.TryGetProperty("deploymentType", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "SingleServer": return(SingleServerRecommendationResult.DeserializeSingleServerRecommendationResult(element));

                case "ThreeTier": return(ThreeTierRecommendationResult.DeserializeThreeTierRecommendationResult(element));
                }
            }
            SapDeploymentType deploymentType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("deploymentType"))
                {
                    deploymentType = new SapDeploymentType(property.Value.GetString());
                    continue;
                }
            }
            return(new SapSizingRecommendationResult(deploymentType));
        }
예제 #11
0
 internal InfrastructureConfiguration(SapDeploymentType deploymentType, string appResourceGroup)
 {
     DeploymentType   = deploymentType;
     AppResourceGroup = appResourceGroup;
 }
예제 #12
0
        internal static ThreeTierRecommendationResult DeserializeThreeTierRecommendationResult(JsonElement element)
        {
            Optional <string> dbVmSku = default;
            Optional <long>   databaseInstanceCount          = default;
            Optional <string> centralServerVmSku             = default;
            Optional <long>   centralServerInstanceCount     = default;
            Optional <string> applicationServerVmSku         = default;
            Optional <long>   applicationServerInstanceCount = default;
            SapDeploymentType deploymentType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("dbVmSku"))
                {
                    dbVmSku = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("databaseInstanceCount"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    databaseInstanceCount = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("centralServerVmSku"))
                {
                    centralServerVmSku = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("centralServerInstanceCount"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    centralServerInstanceCount = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("applicationServerVmSku"))
                {
                    applicationServerVmSku = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("applicationServerInstanceCount"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    applicationServerInstanceCount = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("deploymentType"))
                {
                    deploymentType = new SapDeploymentType(property.Value.GetString());
                    continue;
                }
            }
            return(new ThreeTierRecommendationResult(deploymentType, dbVmSku.Value, Optional.ToNullable(databaseInstanceCount), centralServerVmSku.Value, Optional.ToNullable(centralServerInstanceCount), applicationServerVmSku.Value, Optional.ToNullable(applicationServerInstanceCount)));
        }