Пример #1
0
 /// <summary>
 /// Initializes a new instance of the ImageOSDisk class.
 /// </summary>
 /// <param name="osType">This property allows you to specify the type
 /// of the OS that is included in the disk if creating a VM from a
 /// custom image. &lt;br&gt;&lt;br&gt; Possible values are:
 /// &lt;br&gt;&lt;br&gt; **Windows** &lt;br&gt;&lt;br&gt; **Linux**.
 /// Possible values include: 'Windows', 'Linux'</param>
 /// <param name="osState">The OS State. Possible values include:
 /// 'Generalized', 'Specialized'</param>
 /// <param name="snapshot">The snapshot.</param>
 /// <param name="managedDisk">The managedDisk.</param>
 /// <param name="blobUri">The Virtual Hard Disk.</param>
 /// <param name="caching">Specifies the caching requirements.
 /// &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt;
 /// **None** &lt;br&gt;&lt;br&gt; **ReadOnly** &lt;br&gt;&lt;br&gt;
 /// **ReadWrite** &lt;br&gt;&lt;br&gt; Default: **None for Standard
 /// storage. ReadOnly for Premium storage**. Possible values include:
 /// 'None', 'ReadOnly', 'ReadWrite'</param>
 /// <param name="diskSizeGB">Specifies the size of empty data disks in
 /// gigabytes. This element can be used to overwrite the name of the
 /// disk in a virtual machine image. &lt;br&gt;&lt;br&gt; This value
 /// cannot be larger than 1023 GB</param>
 /// <param name="storageAccountType">Specifies the storage account type
 /// for the managed disk. NOTE: UltraSSD_LRS can only be used with data
 /// disks, it cannot be used with OS Disk. Possible values include:
 /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS',
 /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS'</param>
 /// <param name="diskEncryptionSet">Specifies the customer managed disk
 /// encryption set resource id for the managed image disk.</param>
 public ImageOSDisk(OperatingSystemTypes osType, OperatingSystemStateTypes osState, SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes?caching = default(CachingTypes?), int?diskSizeGB = default(int?), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters))
     : base(snapshot, managedDisk, blobUri, caching, diskSizeGB, storageAccountType, diskEncryptionSet)
 {
     OsType  = osType;
     OsState = osState;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the ImageOSDisk class.
 /// </summary>
 /// <param name="osType">This property allows you to specify the type
 /// of the OS that is included in the disk if creating a VM from a
 /// custom image. &lt;br&gt;&lt;br&gt; Possible values are:
 /// &lt;br&gt;&lt;br&gt; **Windows** &lt;br&gt;&lt;br&gt; **Linux**.
 /// Possible values include: 'Windows', 'Linux'</param>
 /// <param name="osState">The OS State. Possible values include:
 /// 'Generalized', 'Specialized'</param>
 /// <param name="snapshot">The snapshot.</param>
 /// <param name="managedDisk">The managedDisk.</param>
 /// <param name="blobUri">The Virtual Hard Disk.</param>
 /// <param name="caching">Specifies the caching requirements.
 /// &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt;
 /// **None** &lt;br&gt;&lt;br&gt; **ReadOnly** &lt;br&gt;&lt;br&gt;
 /// **ReadWrite** &lt;br&gt;&lt;br&gt; Default: **None for Standard
 /// storage. ReadOnly for Premium storage**. Possible values include:
 /// 'None', 'ReadOnly', 'ReadWrite'</param>
 /// <param name="diskSizeGB">Specifies the size of empty data disks in
 /// gigabytes. This element can be used to overwrite the name of the
 /// disk in a virtual machine image. &lt;br&gt;&lt;br&gt; This value
 /// cannot be larger than 1023 GB</param>
 /// <param name="storageAccountType">Specifies the storage account type
 /// for the managed disk. NOTE: UltraSSD_LRS can only be used with data
 /// disks, it cannot be used with OS Disk. Possible values include:
 /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS',
 /// 'UltraSSD_LRS'</param>
 /// <param name="diskEncryptionSet">Specifies the customer managed disk
 /// encryption set resource id for the managed image disk.</param>
 public ImageOSDisk(OperatingSystemTypes osType, OperatingSystemStateTypes osState, Management.ResourceManager.Fluent.SubResource snapshot = default(Management.ResourceManager.Fluent.SubResource), Management.ResourceManager.Fluent.SubResource managedDisk = default(Management.ResourceManager.Fluent.SubResource), string blobUri = default(string), CachingTypes?caching = default(CachingTypes?), int?diskSizeGB = default(int?), StorageAccountTypes storageAccountType = default(StorageAccountTypes), Management.ResourceManager.Fluent.SubResource diskEncryptionSet = default(Management.ResourceManager.Fluent.SubResource))
     : base(snapshot, managedDisk, blobUri, caching, diskSizeGB, storageAccountType, diskEncryptionSet)
 {
     OsType  = osType;
     OsState = osState;
     CustomInit();
 }
Пример #3
0
        ///GENMHASH:D1C4946A9D880775BE2352E9E76C9EED:AC7317852CF2F1330BAFC7715BAE78BC
        public VirtualMachineCustomImageImpl WithLinuxFromVhd(string sourceVhdUrl, OperatingSystemStateTypes osState)
        {
            var imageOsDisk = EnsureOsDiskImage();

            imageOsDisk.OsState = osState;
            imageOsDisk.OsType  = OperatingSystemTypes.Linux;
            imageOsDisk.BlobUri = sourceVhdUrl;
            return(this);
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the ImageOSDisk class.
 /// </summary>
 /// <param name="osType">This property allows you to specify the type
 /// of the OS that is included in the disk if creating a VM from a
 /// custom image. &lt;br&gt;&lt;br&gt; Possible values are:
 /// &lt;br&gt;&lt;br&gt; **Windows** &lt;br&gt;&lt;br&gt; **Linux**.
 /// Possible values include: 'Windows', 'Linux'</param>
 /// <param name="osState">The OS State. Possible values include:
 /// 'Generalized', 'Specialized'</param>
 /// <param name="snapshot">The snapshot.</param>
 /// <param name="managedDisk">The managedDisk.</param>
 /// <param name="blobUri">The Virtual Hard Disk.</param>
 /// <param name="caching">Specifies the caching requirements.
 /// &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt;
 /// **None** &lt;br&gt;&lt;br&gt; **ReadOnly** &lt;br&gt;&lt;br&gt;
 /// **ReadWrite** &lt;br&gt;&lt;br&gt; Default: **None for Standard
 /// storage. ReadOnly for Premium storage**. Possible values include:
 /// 'None', 'ReadOnly', 'ReadWrite'</param>
 /// <param name="diskSizeGB">Specifies the size of empty data disks in
 /// gigabytes. This element can be used to overwrite the name of the
 /// disk in a virtual machine image. &lt;br&gt;&lt;br&gt; This value
 /// cannot be larger than 1023 GB</param>
 public ImageOSDisk(OperatingSystemTypes osType, OperatingSystemStateTypes osState, SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes?caching = default(CachingTypes?), int?diskSizeGB = default(int?))
 {
     OsType      = osType;
     OsState     = osState;
     Snapshot    = snapshot;
     ManagedDisk = managedDisk;
     BlobUri     = blobUri;
     Caching     = caching;
     DiskSizeGB  = diskSizeGB;
     CustomInit();
 }
        internal static string ToSerializedValue(this OperatingSystemStateTypes value)
        {
            switch (value)
            {
            case OperatingSystemStateTypes.Generalized:
                return("Generalized");

            case OperatingSystemStateTypes.Specialized:
                return("Specialized");
            }
            return(null);
        }
 /// <summary>
 /// Initializes a new instance of the ImageOSDisk class.
 /// </summary>
 /// <param name="osType">This property allows you to specify the type
 /// of the OS that is included in the disk if creating a VM from a
 /// custom image. &lt;br&gt;&lt;br&gt; Possible values are:
 /// &lt;br&gt;&lt;br&gt; **Windows** &lt;br&gt;&lt;br&gt; **Linux**.
 /// Possible values include: 'Windows', 'Linux'</param>
 /// <param name="osState">The OS State. Possible values include:
 /// 'Generalized', 'Specialized'</param>
 /// <param name="snapshot">The snapshot.</param>
 /// <param name="managedDisk">The managedDisk.</param>
 /// <param name="blobUri">The Virtual Hard Disk.</param>
 /// <param name="caching">Specifies the caching requirements.
 /// &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt;
 /// **None** &lt;br&gt;&lt;br&gt; **ReadOnly** &lt;br&gt;&lt;br&gt;
 /// **ReadWrite** &lt;br&gt;&lt;br&gt; Default: **None for Standard
 /// storage. ReadOnly for Premium storage**. Possible values include:
 /// 'None', 'ReadOnly', 'ReadWrite'</param>
 /// <param name="diskSizeGB">Specifies the size of empty data disks in
 /// gigabytes. This element can be used to overwrite the name of the
 /// disk in a virtual machine image. &lt;br&gt;&lt;br&gt; This value
 /// cannot be larger than 1023 GB</param>
 /// <param name="storageAccountType">Specifies the storage account type
 /// for the managed disk. Possible values are: Standard_LRS,
 /// Premium_LRS, and StandardSSD_LRS. Possible values include:
 /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'</param>
 public ImageOSDisk(OperatingSystemTypes osType, OperatingSystemStateTypes osState, Management.ResourceManager.Fluent.SubResource snapshot = default(Management.ResourceManager.Fluent.SubResource), Management.ResourceManager.Fluent.SubResource managedDisk = default(Management.ResourceManager.Fluent.SubResource), string blobUri = default(string), CachingTypes?caching = default(CachingTypes?), int?diskSizeGB = default(int?), StorageAccountTypes storageAccountType = default(StorageAccountTypes))
 {
     OsType             = osType;
     OsState            = osState;
     Snapshot           = snapshot;
     ManagedDisk        = managedDisk;
     BlobUri            = blobUri;
     Caching            = caching;
     DiskSizeGB         = diskSizeGB;
     StorageAccountType = storageAccountType;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the SharedGalleryImage class.
 /// </summary>
 /// <param name="osType">This property allows you to specify the type
 /// of the OS that is included in the disk when creating a VM from a
 /// managed image. &lt;br&gt;&lt;br&gt; Possible values are:
 /// &lt;br&gt;&lt;br&gt; **Windows** &lt;br&gt;&lt;br&gt; **Linux**.
 /// Possible values include: 'Windows', 'Linux'</param>
 /// <param name="osState">This property allows the user to specify
 /// whether the virtual machines created under this image are
 /// 'Generalized' or 'Specialized'. Possible values include:
 /// 'Generalized', 'Specialized'</param>
 /// <param name="name">Resource name</param>
 /// <param name="location">Resource location</param>
 /// <param name="uniqueId">The unique id of this shared
 /// gallery.</param>
 /// <param name="endOfLifeDate">The end of life date of the gallery
 /// image definition. This property can be used for decommissioning
 /// purposes. This property is updatable.</param>
 /// <param name="hyperVGeneration">The hypervisor generation of the
 /// Virtual Machine. Applicable to OS disks only. Possible values
 /// include: 'V1', 'V2'</param>
 /// <param name="features">A list of gallery image features.</param>
 public SharedGalleryImage(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string name = default(string), string location = default(string), string uniqueId = default(string), System.DateTime?endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), string hyperVGeneration = default(string), IList <GalleryImageFeature> features = default(IList <GalleryImageFeature>), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan))
     : base(name, location, uniqueId)
 {
     OsType           = osType;
     OsState          = osState;
     EndOfLifeDate    = endOfLifeDate;
     Identifier       = identifier;
     Recommended      = recommended;
     Disallowed       = disallowed;
     HyperVGeneration = hyperVGeneration;
     Features         = features;
     PurchasePlan     = purchasePlan;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the GalleryImageInner class.
 /// </summary>
 /// <param name="osType">This property allows you to specify the type
 /// of the OS that is included in the disk when creating a VM from a
 /// managed image. &lt;br&gt;&lt;br&gt; Possible values are:
 /// &lt;br&gt;&lt;br&gt; **Windows** &lt;br&gt;&lt;br&gt; **Linux**.
 /// Possible values include: 'Windows', 'Linux'</param>
 /// <param name="osState">The allowed values for OS State are
 /// 'Generalized'. Possible values include: 'Generalized',
 /// 'Specialized'</param>
 /// <param name="description">The description of this gallery Image
 /// Definition resource. This property is updatable.</param>
 /// <param name="eula">The Eula agreement for the gallery Image
 /// Definition.</param>
 /// <param name="privacyStatementUri">The privacy statement
 /// uri.</param>
 /// <param name="releaseNoteUri">The release note uri.</param>
 /// <param name="endOfLifeDate">The end of life date of the gallery
 /// Image Definition. This property can be used for decommissioning
 /// purposes. This property is updatable.</param>
 /// <param name="provisioningState">The current state of the gallery
 /// Image Definition.</param>
 public GalleryImageInner(string location, OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), System.DateTime?endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), ProvisioningState provisioningState = default(ProvisioningState))
     : base(location, id, name, type, tags)
 {
     Description         = description;
     Eula                = eula;
     PrivacyStatementUri = privacyStatementUri;
     ReleaseNoteUri      = releaseNoteUri;
     OsType              = osType;
     OsState             = osState;
     EndOfLifeDate       = endOfLifeDate;
     Identifier          = identifier;
     Recommended         = recommended;
     Disallowed          = disallowed;
     PurchasePlan        = purchasePlan;
     ProvisioningState   = provisioningState;
     CustomInit();
 }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the GalleryImageUpdate class.
 /// </summary>
 /// <param name="osType">This property allows you to specify the type
 /// of the OS that is included in the disk when creating a VM from a
 /// managed image. &lt;br&gt;&lt;br&gt; Possible values are:
 /// &lt;br&gt;&lt;br&gt; **Windows** &lt;br&gt;&lt;br&gt; **Linux**.
 /// Possible values include: 'Windows', 'Linux'</param>
 /// <param name="osState">This property allows the user to specify
 /// whether the virtual machines created under this image are
 /// 'Generalized' or 'Specialized'. Possible values include:
 /// 'Generalized', 'Specialized'</param>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="tags">Resource tags</param>
 /// <param name="description">The description of this gallery image
 /// definition resource. This property is updatable.</param>
 /// <param name="eula">The Eula agreement for the gallery image
 /// definition.</param>
 /// <param name="privacyStatementUri">The privacy statement
 /// uri.</param>
 /// <param name="releaseNoteUri">The release note uri.</param>
 /// <param name="hyperVGeneration">The hypervisor generation of the
 /// Virtual Machine. Applicable to OS disks only. Possible values
 /// include: 'V1', 'V2'</param>
 /// <param name="endOfLifeDate">The end of life date of the gallery
 /// image definition. This property can be used for decommissioning
 /// purposes. This property is updatable.</param>
 /// <param name="provisioningState">Possible values include:
 /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting',
 /// 'Migrating'</param>
 /// <param name="features">A list of gallery image features.</param>
 /// <param name="architecture">Possible values include: 'x64',
 /// 'Arm64'</param>
 public GalleryImageUpdate(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime?endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), IList <GalleryImageFeature> features = default(IList <GalleryImageFeature>), string architecture = default(string))
     : base(id, name, type, tags)
 {
     Description         = description;
     Eula                = eula;
     PrivacyStatementUri = privacyStatementUri;
     ReleaseNoteUri      = releaseNoteUri;
     OsType              = osType;
     OsState             = osState;
     HyperVGeneration    = hyperVGeneration;
     EndOfLifeDate       = endOfLifeDate;
     Identifier          = identifier;
     Recommended         = recommended;
     Disallowed          = disallowed;
     PurchasePlan        = purchasePlan;
     ProvisioningState   = provisioningState;
     Features            = features;
     Architecture        = architecture;
     CustomInit();
 }
 /// <summary>
 /// Specifies that image is a Windows image.
 /// </summary>
 /// <param name="osState">Operating system state.</param>
 /// <return>The next definition stage.</return>
 GalleryImage.Definition.IWithCreate GalleryImage.Definition.IWithOsTypeAndState.WithWindows(OperatingSystemStateTypes osState)
 {
     return(this.WithWindows(osState));
 }
 /// <summary>
 /// Specifies osState.
 /// </summary>
 /// <param name="osState">The OS State.</param>
 /// <return>The next update stage.</return>
 GalleryImage.Update.IUpdate GalleryImage.Update.IWithOsState.WithOsState(OperatingSystemStateTypes osState)
 {
     return(this.WithOsState(osState));
 }
 /// <summary>
 /// Specifies the Linux source snapshot for the OS disk image.
 /// </summary>
 /// <param name="sourceSnapshot">Source snapshot resource.</param>
 /// <param name="osState">Operating system state.</param>
 /// <return>The next stage of the definition.</return>
 VirtualMachineCustomImage.Definition.IWithCreateAndDataDiskImageOSDiskSettings VirtualMachineCustomImage.Definition.IWithOSDiskImageSource.WithLinuxFromSnapshot(ISnapshot sourceSnapshot, OperatingSystemStateTypes osState)
 {
     return(this.WithLinuxFromSnapshot(sourceSnapshot, osState));
 }
Пример #13
0
 public static string ToSerialString(this OperatingSystemStateTypes value) => value switch
 {
 ///GENMHASH:3472074D1AB5FCC22AE56AFE70FDA2F8:E55B773D65A05FA8865303A9358A98E3
 public GalleryImageImpl WithLinux(OperatingSystemStateTypes osState)
 {
     this.Inner.OsType  = OperatingSystemTypes.Linux;
     this.Inner.OsState = osState;
     return(this);
 }
 /// <summary>
 /// Specifies the Windows source managed disk for the OS disk image.
 /// </summary>
 /// <param name="sourceManagedDisk">Source managed disk.</param>
 /// <param name="osState">Operating system state.</param>
 /// <return>The next stage of the definition.</return>
 VirtualMachineCustomImage.Definition.IWithCreateAndDataDiskImageOSDiskSettings VirtualMachineCustomImage.Definition.IWithOSDiskImageSource.WithWindowsFromDisk(IDisk sourceManagedDisk, OperatingSystemStateTypes osState)
 {
     return(this.WithWindowsFromDisk(sourceManagedDisk, osState));
 }
Пример #16
0
 ///GENMHASH:317134690AC492A13AB6664204ABFD95:2CD52FED9DD80D3ACA7A05FE17CBFC89
 public VirtualMachineCustomImageImpl WithLinuxFromSnapshot(ISnapshot sourceSnapshot, OperatingSystemStateTypes osState)
 {
     return(this.WithLinuxFromSnapshot(sourceSnapshot.Id, osState));
 }
Пример #17
0
        ///GENMHASH:D660B915C7DA582BBE874F8D2757FB0A:0044BB116AAF8812F23F9F359960E510
        public VirtualMachineCustomImageImpl WithWindowsFromDisk(string sourceManagedDiskId, OperatingSystemStateTypes osState)
        {
            var imageOsDisk = EnsureOsDiskImage();

            imageOsDisk.OsState     = osState;
            imageOsDisk.OsType      = OperatingSystemTypes.Windows;
            imageOsDisk.ManagedDisk = new SubResource()
            {
                Id = sourceManagedDiskId
            };
            return(this);
        }
Пример #18
0
 public ImageOSDisk(OperatingSystemTypes osType, OperatingSystemStateTypes osState)
 {
     OsType  = osType;
     OsState = osState;
 }
Пример #19
0
 internal ImageOSDisk(WritableSubResource snapshot, WritableSubResource managedDisk, string blobUri, CachingTypes?caching, int?diskSizeGB, StorageAccountTypes?storageAccountType, WritableSubResource diskEncryptionSet, OperatingSystemTypes osType, OperatingSystemStateTypes osState) : base(snapshot, managedDisk, blobUri, caching, diskSizeGB, storageAccountType, diskEncryptionSet)
 {
     OsType  = osType;
     OsState = osState;
 }
 public ImageOSDisk(OperatingSystemTypes oSType, OperatingSystemStateTypes oSState)
 {
     OSType  = oSType;
     OSState = oSState;
 }
 ///GENMHASH:255C87A909686D389A226B73B5FC61E0:9D9164D3A619DF1BDF4D73358606FD40
 public GalleryImageImpl WithWindows(OperatingSystemStateTypes osState)
 {
     this.Inner.OsType  = OperatingSystemTypes.Windows;
     this.Inner.OsState = osState;
     return(this);
 }
 ///GENMHASH:B193C7EB04D97343DA56B771815DD347:058990A9D00E548A58C7CAB261EFDC30
 public GalleryImageImpl WithOsState(OperatingSystemStateTypes osState)
 {
     this.Inner.OsState = osState;
     return(this);
 }
Пример #23
0
 ///GENMHASH:F40AACF05EEBCEC01371839C967AF08E:83720436CA6F52E320BEC17AA5E2BE07
 public VirtualMachineCustomImageImpl WithLinuxFromDisk(IDisk sourceManagedDisk, OperatingSystemStateTypes osState)
 {
     return(WithLinuxFromDisk(sourceManagedDisk.Id, osState));
 }
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="OperatingSystemStateTypes" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => OperatingSystemStateTypes.CreateFrom(sourceValue);
Пример #25
0
        ///GENMHASH:F6E3577574DD9BBB65B312D78461CDF4:8390A7C04DC74112B8FBA74388AF9C57
        public VirtualMachineCustomImageImpl WithLinuxFromSnapshot(string sourceSnapshotId, OperatingSystemStateTypes osState)
        {
            var imageOsDisk = this.EnsureOsDiskImage();

            imageOsDisk.OsState  = osState;
            imageOsDisk.OsType   = OperatingSystemTypes.Linux;
            imageOsDisk.Snapshot = new SubResource()
            {
                Id = sourceSnapshotId
            };
            return(this);
        }
        internal static ImageOSDisk DeserializeImageOSDisk(JsonElement element)
        {
            OperatingSystemTypes      osType       = default;
            OperatingSystemStateTypes osState      = default;
            SubResource         snapshot           = default;
            SubResource         managedDisk        = default;
            string              blobUri            = default;
            CachingTypes?       caching            = default;
            int?                diskSizeGB         = default;
            StorageAccountTypes?storageAccountType = default;
            SubResource         diskEncryptionSet  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("osType"))
                {
                    osType = property.Value.GetString().ToOperatingSystemTypes();
                    continue;
                }
                if (property.NameEquals("osState"))
                {
                    osState = property.Value.GetString().ToOperatingSystemStateTypes();
                    continue;
                }
                if (property.NameEquals("snapshot"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    snapshot = SubResource.DeserializeSubResource(property.Value);
                    continue;
                }
                if (property.NameEquals("managedDisk"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    managedDisk = SubResource.DeserializeSubResource(property.Value);
                    continue;
                }
                if (property.NameEquals("blobUri"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    blobUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("caching"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    caching = property.Value.GetString().ToCachingTypes();
                    continue;
                }
                if (property.NameEquals("diskSizeGB"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    diskSizeGB = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("storageAccountType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    storageAccountType = new StorageAccountTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("diskEncryptionSet"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    diskEncryptionSet = SubResource.DeserializeSubResource(property.Value);
                    continue;
                }
            }
            return(new ImageOSDisk(snapshot, managedDisk, blobUri, caching, diskSizeGB, storageAccountType, diskEncryptionSet, osType, osState));
        }
 /// <summary>
 /// Specifies the Linux source managed disk for the OS disk image.
 /// </summary>
 /// <param name="sourceManagedDiskId">Source managed disk resource ID.</param>
 /// <param name="osState">Operating system state.</param>
 /// <return>The next stage of the definition.</return>
 VirtualMachineCustomImage.Definition.IWithCreateAndDataDiskImageOSDiskSettings VirtualMachineCustomImage.Definition.IWithOSDiskImageSource.WithLinuxFromDisk(string sourceManagedDiskId, OperatingSystemStateTypes osState)
 {
     return(this.WithLinuxFromDisk(sourceManagedDiskId, osState) as VirtualMachineCustomImage.Definition.IWithCreateAndDataDiskImageOSDiskSettings);
 }
 /// <summary>
 /// Specifies the Windows source snapshot for the OS disk image.
 /// </summary>
 /// <param name="sourceSnapshotId">Source snapshot resource ID.</param>
 /// <param name="osState">Operating system state.</param>
 /// <return>The next stage of the definition.</return>
 VirtualMachineCustomImage.Definition.IWithCreateAndDataDiskImageOSDiskSettings VirtualMachineCustomImage.Definition.IWithOSDiskImageSource.WithWindowsFromSnapshot(string sourceSnapshotId, OperatingSystemStateTypes osState)
 {
     return(this.WithWindowsFromSnapshot(sourceSnapshotId, osState) as VirtualMachineCustomImage.Definition.IWithCreateAndDataDiskImageOSDiskSettings);
 }
 /// <summary>
 /// Specifies the Windows source native VHD for the OS disk image.
 /// </summary>
 /// <param name="sourceVhdUrl">Source Windows virtual hard disk URL.</param>
 /// <param name="osState">Operating system state.</param>
 /// <return>The next stage of the definition.</return>
 VirtualMachineCustomImage.Definition.IWithCreateAndDataDiskImageOSDiskSettings VirtualMachineCustomImage.Definition.IWithOSDiskImageSource.WithWindowsFromVhd(string sourceVhdUrl, OperatingSystemStateTypes osState)
 {
     return(this.WithWindowsFromVhd(sourceVhdUrl, osState));
 }
        internal static ImageOSDisk DeserializeImageOSDisk(JsonElement element)
        {
            OperatingSystemTypes           osType             = default;
            OperatingSystemStateTypes      osState            = default;
            Optional <SubResource>         snapshot           = default;
            Optional <SubResource>         managedDisk        = default;
            Optional <string>              blobUri            = default;
            Optional <CachingTypes>        caching            = default;
            Optional <int>                 diskSizeGB         = default;
            Optional <StorageAccountTypes> storageAccountType = default;
            Optional <SubResource>         diskEncryptionSet  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("osType"))
                {
                    osType = property.Value.GetString().ToOperatingSystemTypes();
                    continue;
                }
                if (property.NameEquals("osState"))
                {
                    osState = property.Value.GetString().ToOperatingSystemStateTypes();
                    continue;
                }
                if (property.NameEquals("snapshot"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    snapshot = SubResource.DeserializeSubResource(property.Value);
                    continue;
                }
                if (property.NameEquals("managedDisk"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    managedDisk = SubResource.DeserializeSubResource(property.Value);
                    continue;
                }
                if (property.NameEquals("blobUri"))
                {
                    blobUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("caching"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    caching = property.Value.GetString().ToCachingTypes();
                    continue;
                }
                if (property.NameEquals("diskSizeGB"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    diskSizeGB = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("storageAccountType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    storageAccountType = new StorageAccountTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("diskEncryptionSet"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    diskEncryptionSet = SubResource.DeserializeSubResource(property.Value);
                    continue;
                }
            }
            return(new ImageOSDisk(snapshot.Value, managedDisk.Value, blobUri.Value, Optional.ToNullable(caching), Optional.ToNullable(diskSizeGB), Optional.ToNullable(storageAccountType), diskEncryptionSet.Value, osType, osState));
        }