Exemple #1
0
        internal static ApplicationServerConfiguration DeserializeApplicationServerConfiguration(JsonElement element)
        {
            ResourceIdentifier          subnetId = default;
            VirtualMachineConfiguration virtualMachineConfiguration = default;
            long instanceCount = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("subnetId"))
                {
                    subnetId = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("virtualMachineConfiguration"))
                {
                    virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("instanceCount"))
                {
                    instanceCount = property.Value.GetInt64();
                    continue;
                }
            }
            return(new ApplicationServerConfiguration(subnetId, virtualMachineConfiguration, instanceCount));
        }
Exemple #2
0
 internal DatabaseConfiguration(SapDatabaseType?databaseType, ResourceIdentifier subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount)
 {
     DatabaseType = databaseType;
     SubnetId     = subnetId;
     VirtualMachineConfiguration = virtualMachineConfiguration;
     InstanceCount = instanceCount;
 }
Exemple #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;
 }
Exemple #4
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));
        }
Exemple #5
0
        public ApplicationServerConfiguration(ResourceIdentifier subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount)
        {
            if (subnetId == null)
            {
                throw new ArgumentNullException(nameof(subnetId));
            }
            if (virtualMachineConfiguration == null)
            {
                throw new ArgumentNullException(nameof(virtualMachineConfiguration));
            }

            SubnetId = subnetId;
            VirtualMachineConfiguration = virtualMachineConfiguration;
            InstanceCount = instanceCount;
        }
Exemple #6
0
        public SingleServerConfiguration(string appResourceGroup, ResourceIdentifier subnetId, VirtualMachineConfiguration virtualMachineConfiguration) : base(appResourceGroup)
        {
            if (appResourceGroup == null)
            {
                throw new ArgumentNullException(nameof(appResourceGroup));
            }
            if (subnetId == null)
            {
                throw new ArgumentNullException(nameof(subnetId));
            }
            if (virtualMachineConfiguration == null)
            {
                throw new ArgumentNullException(nameof(virtualMachineConfiguration));
            }

            SubnetId = subnetId;
            VirtualMachineConfiguration = virtualMachineConfiguration;
            DeploymentType = SapDeploymentType.SingleServer;
        }
Exemple #7
0
        internal static DatabaseConfiguration DeserializeDatabaseConfiguration(JsonElement element)
        {
            Optional <SapDatabaseType>  databaseType = default;
            ResourceIdentifier          subnetId     = default;
            VirtualMachineConfiguration virtualMachineConfiguration = default;
            long instanceCount = default;

            foreach (var property in element.EnumerateObject())
            {
                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("instanceCount"))
                {
                    instanceCount = property.Value.GetInt64();
                    continue;
                }
            }
            return(new DatabaseConfiguration(Optional.ToNullable(databaseType), subnetId, virtualMachineConfiguration, instanceCount));
        }