// *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; import * as utilities from "./utilities"; export class StorageVolume extends pulumi.CustomResource { /** * Get an existing StorageVolume resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ public static get( name: string, id: pulumi.Input, state?: StorageVolumeState, opts?: pulumi.CustomResourceOptions, ): StorageVolume { return new StorageVolume(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = "incus:index/storageVolume:StorageVolume"; /** * Returns true if the given object is an instance of StorageVolume. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is StorageVolume { if (obj === undefined || obj === null) { return false; } return obj["__pulumiType"] === StorageVolume.__pulumiType; } /** * *Optional* - Map of key/value pairs of * [volume config settings](https://linuxcontainers.org/incus/docs/main/reference/storage_drivers/). * Config settings vary depending on the Storage Pool used. */ declare public readonly config: pulumi.Output<{ [key: string]: string }>; /** * *Optional* - Volume content type (`filesystem` or `block`) */ declare public readonly contentType: pulumi.Output; /** * *Optional* - Description of the volume. */ declare public readonly description: pulumi.Output; /** * Name of the node where volume was created. It could be useful with Incus in cluster mode. */ declare public readonly /*out*/ location: pulumi.Output; /** * **Required** - Name of the storage volume. */ declare public readonly name: pulumi.Output; /** * **Required** - Name of storage pool to host the volume. */ declare public readonly pool: pulumi.Output; /** * *Optional* - Name of the project where the volume will be stored. */ declare public readonly project: pulumi.Output; /** * *Optional* - The remote in which the resource will be created. If * not provided, the provider's default remote will be used. */ declare public readonly remote: pulumi.Output; /** * *Optional* - Path to a backup file from which the volume will be created. */ declare public readonly sourceFile: pulumi.Output; /** * *Optional* - The source volume from which the volume will be created. See reference below. */ declare public readonly sourceVolume: pulumi.Output< outputs.StorageVolumeSourceVolume | undefined >; /** * *Optional* - Specify a target node in a cluster. */ declare public readonly target: pulumi.Output; /** * *Optional* - The "type" of volume. The default value is `custom`, * which is the type to use for storage volumes attached to instances. */ declare public readonly type: pulumi.Output; /** * Create a StorageVolume resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: StorageVolumeArgs, opts?: pulumi.CustomResourceOptions); constructor( name: string, argsOrState?: StorageVolumeArgs | StorageVolumeState, opts?: pulumi.CustomResourceOptions, ) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as StorageVolumeState | undefined; resourceInputs["config"] = state?.config; resourceInputs["contentType"] = state?.contentType; resourceInputs["description"] = state?.description; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["pool"] = state?.pool; resourceInputs["project"] = state?.project; resourceInputs["remote"] = state?.remote; resourceInputs["sourceFile"] = state?.sourceFile; resourceInputs["sourceVolume"] = state?.sourceVolume; resourceInputs["target"] = state?.target; resourceInputs["type"] = state?.type; } else { const args = argsOrState as StorageVolumeArgs | undefined; if (args?.name === undefined && !opts.urn) { throw new Error("Missing required property 'name'"); } if (args?.pool === undefined && !opts.urn) { throw new Error("Missing required property 'pool'"); } resourceInputs["config"] = args?.config; resourceInputs["contentType"] = args?.contentType; resourceInputs["description"] = args?.description; resourceInputs["name"] = args?.name; resourceInputs["pool"] = args?.pool; resourceInputs["project"] = args?.project ?? "default"; resourceInputs["remote"] = args?.remote; resourceInputs["sourceFile"] = args?.sourceFile; resourceInputs["sourceVolume"] = args?.sourceVolume; resourceInputs["target"] = args?.target; resourceInputs["type"] = args?.type; resourceInputs["location"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(StorageVolume.__pulumiType, name, resourceInputs, opts); } } /** * Input properties used for looking up and filtering StorageVolume resources. */ export interface StorageVolumeState { /** * *Optional* - Map of key/value pairs of * [volume config settings](https://linuxcontainers.org/incus/docs/main/reference/storage_drivers/). * Config settings vary depending on the Storage Pool used. */ config?: pulumi.Input<{ [key: string]: pulumi.Input }>; /** * *Optional* - Volume content type (`filesystem` or `block`) */ contentType?: pulumi.Input; /** * *Optional* - Description of the volume. */ description?: pulumi.Input; /** * Name of the node where volume was created. It could be useful with Incus in cluster mode. */ location?: pulumi.Input; /** * **Required** - Name of the storage volume. */ name?: pulumi.Input; /** * **Required** - Name of storage pool to host the volume. */ pool?: pulumi.Input; /** * *Optional* - Name of the project where the volume will be stored. */ project?: pulumi.Input; /** * *Optional* - The remote in which the resource will be created. If * not provided, the provider's default remote will be used. */ remote?: pulumi.Input; /** * *Optional* - Path to a backup file from which the volume will be created. */ sourceFile?: pulumi.Input; /** * *Optional* - The source volume from which the volume will be created. See reference below. */ sourceVolume?: pulumi.Input; /** * *Optional* - Specify a target node in a cluster. */ target?: pulumi.Input; /** * *Optional* - The "type" of volume. The default value is `custom`, * which is the type to use for storage volumes attached to instances. */ type?: pulumi.Input; } /** * The set of arguments for constructing a StorageVolume resource. */ export interface StorageVolumeArgs { /** * *Optional* - Map of key/value pairs of * [volume config settings](https://linuxcontainers.org/incus/docs/main/reference/storage_drivers/). * Config settings vary depending on the Storage Pool used. */ config?: pulumi.Input<{ [key: string]: pulumi.Input }>; /** * *Optional* - Volume content type (`filesystem` or `block`) */ contentType?: pulumi.Input; /** * *Optional* - Description of the volume. */ description?: pulumi.Input; /** * **Required** - Name of the storage volume. */ name: pulumi.Input; /** * **Required** - Name of storage pool to host the volume. */ pool: pulumi.Input; /** * *Optional* - Name of the project where the volume will be stored. */ project?: pulumi.Input; /** * *Optional* - The remote in which the resource will be created. If * not provided, the provider's default remote will be used. */ remote?: pulumi.Input; /** * *Optional* - Path to a backup file from which the volume will be created. */ sourceFile?: pulumi.Input; /** * *Optional* - The source volume from which the volume will be created. See reference below. */ sourceVolume?: pulumi.Input; /** * *Optional* - Specify a target node in a cluster. */ target?: pulumi.Input; /** * *Optional* - The "type" of volume. The default value is `custom`, * which is the type to use for storage volumes attached to instances. */ type?: pulumi.Input; }