Beispiel #1
0
 internal NodeProfile(string name, string nodeSku, OSImageProfile osImage, DiskInfo osDisk, IList <DiskInfo> dataDisks, IReadOnlyList <ResourceIdentifier> nodeResourceIds)
 {
     Name            = name;
     NodeSku         = nodeSku;
     OSImage         = osImage;
     OSDisk          = osDisk;
     DataDisks       = dataDisks;
     NodeResourceIds = nodeResourceIds;
 }
Beispiel #2
0
 public VmssNodesProfile(string nodeSku, OSImageProfile osImage, DiskInfo osDisk) : base(nodeSku, osImage, osDisk)
 {
     if (nodeSku == null)
     {
         throw new ArgumentNullException(nameof(nodeSku));
     }
     if (osImage == null)
     {
         throw new ArgumentNullException(nameof(osImage));
     }
     if (osDisk == null)
     {
         throw new ArgumentNullException(nameof(osDisk));
     }
 }
Beispiel #3
0
        public SearchProfile(string nodeSku, OSImageProfile osImage, DiskInfo osDisk, SearchType searchType) : base(nodeSku, osImage, osDisk)
        {
            if (nodeSku == null)
            {
                throw new ArgumentNullException(nameof(nodeSku));
            }
            if (osImage == null)
            {
                throw new ArgumentNullException(nameof(osImage));
            }
            if (osDisk == null)
            {
                throw new ArgumentNullException(nameof(osDisk));
            }

            SearchType = searchType;
        }
Beispiel #4
0
        public NodeProfile(string nodeSku, OSImageProfile osImage, DiskInfo osDisk)
        {
            if (nodeSku == null)
            {
                throw new ArgumentNullException(nameof(nodeSku));
            }
            if (osImage == null)
            {
                throw new ArgumentNullException(nameof(osImage));
            }
            if (osDisk == null)
            {
                throw new ArgumentNullException(nameof(osDisk));
            }

            NodeSku         = nodeSku;
            OSImage         = osImage;
            OSDisk          = osDisk;
            DataDisks       = new ChangeTrackingList <DiskInfo>();
            NodeResourceIds = new ChangeTrackingList <ResourceIdentifier>();
        }
Beispiel #5
0
        internal static NodeProfile DeserializeNodeProfile(JsonElement element)
        {
            Optional <string>            name      = default;
            string                       nodeSku   = default;
            OSImageProfile               osImage   = default;
            DiskInfo                     osDisk    = default;
            Optional <IList <DiskInfo> > dataDisks = default;
            Optional <IReadOnlyList <ResourceIdentifier> > nodeResourceIds = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("nodeSku"))
                {
                    nodeSku = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("osImage"))
                {
                    osImage = OSImageProfile.DeserializeOSImageProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("osDisk"))
                {
                    osDisk = DiskInfo.DeserializeDiskInfo(property.Value);
                    continue;
                }
                if (property.NameEquals("dataDisks"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <DiskInfo> array = new List <DiskInfo>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DiskInfo.DeserializeDiskInfo(item));
                    }
                    dataDisks = array;
                    continue;
                }
                if (property.NameEquals("nodeResourceIds"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <ResourceIdentifier> array = new List <ResourceIdentifier>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new ResourceIdentifier(item.GetString()));
                    }
                    nodeResourceIds = array;
                    continue;
                }
            }
            return(new NodeProfile(name.Value, nodeSku, osImage, osDisk, Optional.ToList(dataDisks), Optional.ToList(nodeResourceIds)));
        }
Beispiel #6
0
 internal VmssNodesProfile(string name, string nodeSku, OSImageProfile osImage, DiskInfo osDisk, IList <DiskInfo> dataDisks, IReadOnlyList <ResourceIdentifier> nodeResourceIds, int?autoScaleMinCount, int?autoScaleMaxCount) : base(name, nodeSku, osImage, osDisk, dataDisks, nodeResourceIds)
 {
     AutoScaleMinCount = autoScaleMinCount;
     AutoScaleMaxCount = autoScaleMaxCount;
 }
Beispiel #7
0
 internal SearchProfile(string name, string nodeSku, OSImageProfile osImage, DiskInfo osDisk, IList <DiskInfo> dataDisks, IReadOnlyList <ResourceIdentifier> nodeResourceIds, SearchType searchType) : base(name, nodeSku, osImage, osDisk, dataDisks, nodeResourceIds)
 {
     SearchType = searchType;
 }