All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.compute.inputs.OSDiskArgs Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.compute.inputs;

import com.pulumi.azurenative.compute.enums.CachingTypes;
import com.pulumi.azurenative.compute.enums.DiskCreateOptionTypes;
import com.pulumi.azurenative.compute.enums.DiskDeleteOptionTypes;
import com.pulumi.azurenative.compute.enums.OperatingSystemTypes;
import com.pulumi.azurenative.compute.inputs.DiffDiskSettingsArgs;
import com.pulumi.azurenative.compute.inputs.DiskEncryptionSettingsArgs;
import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
import com.pulumi.azurenative.compute.inputs.VirtualHardDiskArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * Specifies information about the operating system disk used by the virtual machine. For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
 * 
 */
public final class OSDiskArgs extends com.pulumi.resources.ResourceArgs {

    public static final OSDiskArgs Empty = new OSDiskArgs();

    /**
     * Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**
     * 
     */
    @Import(name="caching")
    private @Nullable Output caching;

    /**
     * @return Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**
     * 
     */
    public Optional> caching() {
        return Optional.ofNullable(this.caching);
    }

    /**
     * Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
     * 
     */
    @Import(name="createOption", required=true)
    private Output> createOption;

    /**
     * @return Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
     * 
     */
    public Output> createOption() {
        return this.createOption;
    }

    /**
     * Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
     * 
     */
    @Import(name="deleteOption")
    private @Nullable Output> deleteOption;

    /**
     * @return Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
     * 
     */
    public Optional>> deleteOption() {
        return Optional.ofNullable(this.deleteOption);
    }

    /**
     * Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
     * 
     */
    @Import(name="diffDiskSettings")
    private @Nullable Output diffDiskSettings;

    /**
     * @return Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
     * 
     */
    public Optional> diffDiskSettings() {
        return Optional.ofNullable(this.diffDiskSettings);
    }

    /**
     * Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.
     * 
     */
    @Import(name="diskSizeGB")
    private @Nullable Output diskSizeGB;

    /**
     * @return Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.
     * 
     */
    public Optional> diskSizeGB() {
        return Optional.ofNullable(this.diskSizeGB);
    }

    /**
     * Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
     * 
     */
    @Import(name="encryptionSettings")
    private @Nullable Output encryptionSettings;

    /**
     * @return Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
     * 
     */
    public Optional> encryptionSettings() {
        return Optional.ofNullable(this.encryptionSettings);
    }

    /**
     * The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
     * 
     */
    @Import(name="image")
    private @Nullable Output image;

    /**
     * @return The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
     * 
     */
    public Optional> image() {
        return Optional.ofNullable(this.image);
    }

    /**
     * The managed disk parameters.
     * 
     */
    @Import(name="managedDisk")
    private @Nullable Output managedDisk;

    /**
     * @return The managed disk parameters.
     * 
     */
    public Optional> managedDisk() {
        return Optional.ofNullable(this.managedDisk);
    }

    /**
     * The disk name.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return The disk name.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**
     * 
     */
    @Import(name="osType")
    private @Nullable Output osType;

    /**
     * @return This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**
     * 
     */
    public Optional> osType() {
        return Optional.ofNullable(this.osType);
    }

    /**
     * The virtual hard disk.
     * 
     */
    @Import(name="vhd")
    private @Nullable Output vhd;

    /**
     * @return The virtual hard disk.
     * 
     */
    public Optional> vhd() {
        return Optional.ofNullable(this.vhd);
    }

    /**
     * Specifies whether writeAccelerator should be enabled or disabled on the disk.
     * 
     */
    @Import(name="writeAcceleratorEnabled")
    private @Nullable Output writeAcceleratorEnabled;

    /**
     * @return Specifies whether writeAccelerator should be enabled or disabled on the disk.
     * 
     */
    public Optional> writeAcceleratorEnabled() {
        return Optional.ofNullable(this.writeAcceleratorEnabled);
    }

    private OSDiskArgs() {}

    private OSDiskArgs(OSDiskArgs $) {
        this.caching = $.caching;
        this.createOption = $.createOption;
        this.deleteOption = $.deleteOption;
        this.diffDiskSettings = $.diffDiskSettings;
        this.diskSizeGB = $.diskSizeGB;
        this.encryptionSettings = $.encryptionSettings;
        this.image = $.image;
        this.managedDisk = $.managedDisk;
        this.name = $.name;
        this.osType = $.osType;
        this.vhd = $.vhd;
        this.writeAcceleratorEnabled = $.writeAcceleratorEnabled;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(OSDiskArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private OSDiskArgs $;

        public Builder() {
            $ = new OSDiskArgs();
        }

        public Builder(OSDiskArgs defaults) {
            $ = new OSDiskArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param caching Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**
         * 
         * @return builder
         * 
         */
        public Builder caching(@Nullable Output caching) {
            $.caching = caching;
            return this;
        }

        /**
         * @param caching Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**
         * 
         * @return builder
         * 
         */
        public Builder caching(CachingTypes caching) {
            return caching(Output.of(caching));
        }

        /**
         * @param createOption Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
         * 
         * @return builder
         * 
         */
        public Builder createOption(Output> createOption) {
            $.createOption = createOption;
            return this;
        }

        /**
         * @param createOption Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
         * 
         * @return builder
         * 
         */
        public Builder createOption(Either createOption) {
            return createOption(Output.of(createOption));
        }

        /**
         * @param createOption Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
         * 
         * @return builder
         * 
         */
        public Builder createOption(String createOption) {
            return createOption(Either.ofLeft(createOption));
        }

        /**
         * @param createOption Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
         * 
         * @return builder
         * 
         */
        public Builder createOption(DiskCreateOptionTypes createOption) {
            return createOption(Either.ofRight(createOption));
        }

        /**
         * @param deleteOption Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
         * 
         * @return builder
         * 
         */
        public Builder deleteOption(@Nullable Output> deleteOption) {
            $.deleteOption = deleteOption;
            return this;
        }

        /**
         * @param deleteOption Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
         * 
         * @return builder
         * 
         */
        public Builder deleteOption(Either deleteOption) {
            return deleteOption(Output.of(deleteOption));
        }

        /**
         * @param deleteOption Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
         * 
         * @return builder
         * 
         */
        public Builder deleteOption(String deleteOption) {
            return deleteOption(Either.ofLeft(deleteOption));
        }

        /**
         * @param deleteOption Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
         * 
         * @return builder
         * 
         */
        public Builder deleteOption(DiskDeleteOptionTypes deleteOption) {
            return deleteOption(Either.ofRight(deleteOption));
        }

        /**
         * @param diffDiskSettings Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
         * 
         * @return builder
         * 
         */
        public Builder diffDiskSettings(@Nullable Output diffDiskSettings) {
            $.diffDiskSettings = diffDiskSettings;
            return this;
        }

        /**
         * @param diffDiskSettings Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
         * 
         * @return builder
         * 
         */
        public Builder diffDiskSettings(DiffDiskSettingsArgs diffDiskSettings) {
            return diffDiskSettings(Output.of(diffDiskSettings));
        }

        /**
         * @param diskSizeGB Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.
         * 
         * @return builder
         * 
         */
        public Builder diskSizeGB(@Nullable Output diskSizeGB) {
            $.diskSizeGB = diskSizeGB;
            return this;
        }

        /**
         * @param diskSizeGB Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.
         * 
         * @return builder
         * 
         */
        public Builder diskSizeGB(Integer diskSizeGB) {
            return diskSizeGB(Output.of(diskSizeGB));
        }

        /**
         * @param encryptionSettings Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
         * 
         * @return builder
         * 
         */
        public Builder encryptionSettings(@Nullable Output encryptionSettings) {
            $.encryptionSettings = encryptionSettings;
            return this;
        }

        /**
         * @param encryptionSettings Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
         * 
         * @return builder
         * 
         */
        public Builder encryptionSettings(DiskEncryptionSettingsArgs encryptionSettings) {
            return encryptionSettings(Output.of(encryptionSettings));
        }

        /**
         * @param image The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
         * 
         * @return builder
         * 
         */
        public Builder image(@Nullable Output image) {
            $.image = image;
            return this;
        }

        /**
         * @param image The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
         * 
         * @return builder
         * 
         */
        public Builder image(VirtualHardDiskArgs image) {
            return image(Output.of(image));
        }

        /**
         * @param managedDisk The managed disk parameters.
         * 
         * @return builder
         * 
         */
        public Builder managedDisk(@Nullable Output managedDisk) {
            $.managedDisk = managedDisk;
            return this;
        }

        /**
         * @param managedDisk The managed disk parameters.
         * 
         * @return builder
         * 
         */
        public Builder managedDisk(ManagedDiskParametersArgs managedDisk) {
            return managedDisk(Output.of(managedDisk));
        }

        /**
         * @param name The disk name.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The disk name.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param osType This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**
         * 
         * @return builder
         * 
         */
        public Builder osType(@Nullable Output osType) {
            $.osType = osType;
            return this;
        }

        /**
         * @param osType This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**
         * 
         * @return builder
         * 
         */
        public Builder osType(OperatingSystemTypes osType) {
            return osType(Output.of(osType));
        }

        /**
         * @param vhd The virtual hard disk.
         * 
         * @return builder
         * 
         */
        public Builder vhd(@Nullable Output vhd) {
            $.vhd = vhd;
            return this;
        }

        /**
         * @param vhd The virtual hard disk.
         * 
         * @return builder
         * 
         */
        public Builder vhd(VirtualHardDiskArgs vhd) {
            return vhd(Output.of(vhd));
        }

        /**
         * @param writeAcceleratorEnabled Specifies whether writeAccelerator should be enabled or disabled on the disk.
         * 
         * @return builder
         * 
         */
        public Builder writeAcceleratorEnabled(@Nullable Output writeAcceleratorEnabled) {
            $.writeAcceleratorEnabled = writeAcceleratorEnabled;
            return this;
        }

        /**
         * @param writeAcceleratorEnabled Specifies whether writeAccelerator should be enabled or disabled on the disk.
         * 
         * @return builder
         * 
         */
        public Builder writeAcceleratorEnabled(Boolean writeAcceleratorEnabled) {
            return writeAcceleratorEnabled(Output.of(writeAcceleratorEnabled));
        }

        public OSDiskArgs build() {
            if ($.createOption == null) {
                throw new MissingRequiredPropertyException("OSDiskArgs", "createOption");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy