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

com.pulumi.azurenative.compute.inputs.DataDiskArgs 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.DiskDetachOptionTypes;
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;


/**
 * Describes a data disk.
 * 
 */
public final class DataDiskArgs extends com.pulumi.resources.ResourceArgs {

    public static final DataDiskArgs Empty = new DataDiskArgs();

    /**
     * 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 data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
     * 
     */
    @Import(name="deleteOption")
    private @Nullable Output> deleteOption;

    /**
     * @return Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
     * 
     */
    public Optional>> deleteOption() {
        return Optional.ofNullable(this.deleteOption);
    }

    /**
     * Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
     * 
     */
    @Import(name="detachOption")
    private @Nullable Output> detachOption;

    /**
     * @return Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
     * 
     */
    public Optional>> detachOption() {
        return Optional.ofNullable(this.detachOption);
    }

    /**
     * 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);
    }

    /**
     * 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);
    }

    /**
     * Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
     * 
     */
    @Import(name="lun", required=true)
    private Output lun;

    /**
     * @return Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
     * 
     */
    public Output lun() {
        return this.lun;
    }

    /**
     * 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);
    }

    /**
     * Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset
     * 
     */
    @Import(name="toBeDetached")
    private @Nullable Output toBeDetached;

    /**
     * @return Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset
     * 
     */
    public Optional> toBeDetached() {
        return Optional.ofNullable(this.toBeDetached);
    }

    /**
     * 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 DataDiskArgs() {}

    private DataDiskArgs(DataDiskArgs $) {
        this.caching = $.caching;
        this.createOption = $.createOption;
        this.deleteOption = $.deleteOption;
        this.detachOption = $.detachOption;
        this.diskSizeGB = $.diskSizeGB;
        this.image = $.image;
        this.lun = $.lun;
        this.managedDisk = $.managedDisk;
        this.name = $.name;
        this.toBeDetached = $.toBeDetached;
        this.vhd = $.vhd;
        this.writeAcceleratorEnabled = $.writeAcceleratorEnabled;
    }

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

    public static final class Builder {
        private DataDiskArgs $;

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

        public Builder(DataDiskArgs defaults) {
            $ = new DataDiskArgs(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 data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
         * 
         * @return builder
         * 
         */
        public Builder deleteOption(@Nullable Output> deleteOption) {
            $.deleteOption = deleteOption;
            return this;
        }

        /**
         * @param deleteOption Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
         * 
         * @return builder
         * 
         */
        public Builder deleteOption(Either deleteOption) {
            return deleteOption(Output.of(deleteOption));
        }

        /**
         * @param deleteOption Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
         * 
         * @return builder
         * 
         */
        public Builder deleteOption(String deleteOption) {
            return deleteOption(Either.ofLeft(deleteOption));
        }

        /**
         * @param deleteOption Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
         * 
         * @return builder
         * 
         */
        public Builder deleteOption(DiskDeleteOptionTypes deleteOption) {
            return deleteOption(Either.ofRight(deleteOption));
        }

        /**
         * @param detachOption Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
         * 
         * @return builder
         * 
         */
        public Builder detachOption(@Nullable Output> detachOption) {
            $.detachOption = detachOption;
            return this;
        }

        /**
         * @param detachOption Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
         * 
         * @return builder
         * 
         */
        public Builder detachOption(Either detachOption) {
            return detachOption(Output.of(detachOption));
        }

        /**
         * @param detachOption Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
         * 
         * @return builder
         * 
         */
        public Builder detachOption(String detachOption) {
            return detachOption(Either.ofLeft(detachOption));
        }

        /**
         * @param detachOption Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
         * 
         * @return builder
         * 
         */
        public Builder detachOption(DiskDetachOptionTypes detachOption) {
            return detachOption(Either.ofRight(detachOption));
        }

        /**
         * @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 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 lun Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
         * 
         * @return builder
         * 
         */
        public Builder lun(Output lun) {
            $.lun = lun;
            return this;
        }

        /**
         * @param lun Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
         * 
         * @return builder
         * 
         */
        public Builder lun(Integer lun) {
            return lun(Output.of(lun));
        }

        /**
         * @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 toBeDetached Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset
         * 
         * @return builder
         * 
         */
        public Builder toBeDetached(@Nullable Output toBeDetached) {
            $.toBeDetached = toBeDetached;
            return this;
        }

        /**
         * @param toBeDetached Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset
         * 
         * @return builder
         * 
         */
        public Builder toBeDetached(Boolean toBeDetached) {
            return toBeDetached(Output.of(toBeDetached));
        }

        /**
         * @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 DataDiskArgs build() {
            if ($.createOption == null) {
                throw new MissingRequiredPropertyException("DataDiskArgs", "createOption");
            }
            if ($.lun == null) {
                throw new MissingRequiredPropertyException("DataDiskArgs", "lun");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy