Esempio n. 1
0
 internal VirtualMachineData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, Models.Plan plan, IReadOnlyList <VirtualMachineExtensionData> resources, ManagedServiceIdentity identity, IList <string> zones, Models.ExtendedLocation extendedLocation, HardwareProfile hardwareProfile, StorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, OSProfile osProfile, NetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, WritableSubResource availabilitySet, WritableSubResource virtualMachineScaleSet, WritableSubResource proximityPlacementGroup, VirtualMachinePriorityTypes?priority, VirtualMachineEvictionPolicyTypes?evictionPolicy, BillingProfile billingProfile, WritableSubResource host, WritableSubResource hostGroup, string provisioningState, VirtualMachineInstanceView instanceView, string licenseType, string vmId, string extensionsTimeBudget, int?platformFaultDomain, ScheduledEventsProfile scheduledEventsProfile, string userData, CapacityReservationProfile capacityReservation, ApplicationProfile applicationProfile) : base(id, name, type, systemData, tags, location)
 {
     Plan                    = plan;
     Resources               = resources;
     Identity                = identity;
     Zones                   = zones;
     ExtendedLocation        = extendedLocation;
     HardwareProfile         = hardwareProfile;
     StorageProfile          = storageProfile;
     AdditionalCapabilities  = additionalCapabilities;
     OSProfile               = osProfile;
     NetworkProfile          = networkProfile;
     SecurityProfile         = securityProfile;
     DiagnosticsProfile      = diagnosticsProfile;
     AvailabilitySet         = availabilitySet;
     VirtualMachineScaleSet  = virtualMachineScaleSet;
     ProximityPlacementGroup = proximityPlacementGroup;
     Priority                = priority;
     EvictionPolicy          = evictionPolicy;
     BillingProfile          = billingProfile;
     Host                    = host;
     HostGroup               = hostGroup;
     ProvisioningState       = provisioningState;
     InstanceView            = instanceView;
     LicenseType             = licenseType;
     VmId                    = vmId;
     ExtensionsTimeBudget    = extensionsTimeBudget;
     PlatformFaultDomain     = platformFaultDomain;
     ScheduledEventsProfile  = scheduledEventsProfile;
     UserData                = userData;
     CapacityReservation     = capacityReservation;
     ApplicationProfile      = applicationProfile;
 }
Esempio n. 2
0
 internal VirtualMachineScaleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IList <string> zones, Models.ExtendedLocation extendedLocation, UpgradePolicy upgradePolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool?overprovision, bool?doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool?singlePlacementGroup, bool?zoneBalance, int?platformFaultDomainCount, WritableSubResource proximityPlacementGroup, WritableSubResource hostGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, OrchestrationMode?orchestrationMode, SpotRestorePolicy spotRestorePolicy, DateTimeOffset?timeCreated) : base(id, name, resourceType, systemData, tags, location)
 {
     Sku                    = sku;
     Plan                   = plan;
     Identity               = identity;
     Zones                  = zones;
     ExtendedLocation       = extendedLocation;
     UpgradePolicy          = upgradePolicy;
     AutomaticRepairsPolicy = automaticRepairsPolicy;
     VirtualMachineProfile  = virtualMachineProfile;
     ProvisioningState      = provisioningState;
     Overprovision          = overprovision;
     DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVms;
     UniqueId                 = uniqueId;
     SinglePlacementGroup     = singlePlacementGroup;
     ZoneBalance              = zoneBalance;
     PlatformFaultDomainCount = platformFaultDomainCount;
     ProximityPlacementGroup  = proximityPlacementGroup;
     HostGroup                = hostGroup;
     AdditionalCapabilities   = additionalCapabilities;
     ScaleInPolicy            = scaleInPolicy;
     OrchestrationMode        = orchestrationMode;
     SpotRestorePolicy        = spotRestorePolicy;
     TimeCreated              = timeCreated;
 }
Esempio n. 3
0
 internal ImageData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, Models.ExtendedLocation extendedLocation, WritableSubResource sourceVirtualMachine, ImageStorageProfile storageProfile, string provisioningState, HyperVGenerationTypes?hyperVGeneration) : base(id, name, type, systemData, tags, location)
 {
     ExtendedLocation     = extendedLocation;
     SourceVirtualMachine = sourceVirtualMachine;
     StorageProfile       = storageProfile;
     ProvisioningState    = provisioningState;
     HyperVGeneration     = hyperVGeneration;
 }
Esempio n. 4
0
        internal static VirtualMachineImage DeserializeVirtualMachineImage(JsonElement element)
        {
            string        name     = default;
            AzureLocation location = default;
            Optional <IDictionary <string, string> > tags = default;
            Optional <ExtendedLocation>                    extendedLocation = default;
            Optional <ResourceIdentifier>                  id             = default;
            Optional <PurchasePlan>                        plan           = default;
            Optional <OSDiskImage>                         osDiskImage    = default;
            Optional <IList <DataDiskImage> >              dataDiskImages = default;
            Optional <AutomaticOSUpgradeProperties>        automaticOSUpgradeProperties = default;
            Optional <HyperVGenerationTypes>               hyperVGeneration             = default;
            Optional <DisallowedConfiguration>             disallowed   = default;
            Optional <IList <VirtualMachineImageFeature> > features     = default;
            Optional <ArchitectureTypes>                   architecture = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = new AzureLocation(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("extendedLocation"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("plan"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            plan = PurchasePlan.DeserializePurchasePlan(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("osDiskImage"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            osDiskImage = OSDiskImage.DeserializeOSDiskImage(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("dataDiskImages"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <DataDiskImage> array = new List <DataDiskImage>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(DataDiskImage.DeserializeDataDiskImage(item));
                            }
                            dataDiskImages = array;
                            continue;
                        }
                        if (property0.NameEquals("automaticOSUpgradeProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            automaticOSUpgradeProperties = AutomaticOSUpgradeProperties.DeserializeAutomaticOSUpgradeProperties(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("hyperVGeneration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            hyperVGeneration = new HyperVGenerationTypes(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("disallowed"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            disallowed = DisallowedConfiguration.DeserializeDisallowedConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("features"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <VirtualMachineImageFeature> array = new List <VirtualMachineImageFeature>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(VirtualMachineImageFeature.DeserializeVirtualMachineImageFeature(item));
                            }
                            features = array;
                            continue;
                        }
                        if (property0.NameEquals("architecture"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            architecture = new ArchitectureTypes(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new VirtualMachineImage(id.Value, name, location, Optional.ToDictionary(tags), extendedLocation.Value, plan.Value, osDiskImage.Value, Optional.ToList(dataDiskImages), automaticOSUpgradeProperties.Value, Optional.ToNullable(hyperVGeneration), disallowed.Value, Optional.ToList(features), Optional.ToNullable(architecture)));
        }
 internal VirtualMachineImage(string id, string name, string location, IDictionary <string, string> tags, ExtendedLocation extendedLocation, PurchasePlan plan, OSDiskImage osDiskImage, IList <DataDiskImage> dataDiskImages, AutomaticOSUpgradeProperties automaticOSUpgradeProperties, HyperVGenerationTypes?hyperVGeneration, DisallowedConfiguration disallowed, IList <VirtualMachineImageFeature> features) : base(id, name, location, tags, extendedLocation)
 {
     Plan           = plan;
     OsDiskImage    = osDiskImage;
     DataDiskImages = dataDiskImages;
     AutomaticOSUpgradeProperties = automaticOSUpgradeProperties;
     HyperVGeneration             = hyperVGeneration;
     Disallowed = disallowed;
     Features   = features;
 }