Files
pulumi-incus/sdk/go/incus/storageVolume.go
2025-12-08 10:47:09 -05:00

410 lines
17 KiB
Go
Generated

// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package incus
import (
"context"
"reflect"
"errors"
"git.kalinow.ski/kiterun/pulumi-incus/sdk/go/incus/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type StorageVolume struct {
pulumi.CustomResourceState
// *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.StringMapOutput `pulumi:"config"`
// *Optional* - Volume content type (`filesystem` or `block`)
ContentType pulumi.StringOutput `pulumi:"contentType"`
// *Optional* - Description of the volume.
Description pulumi.StringOutput `pulumi:"description"`
// Name of the node where volume was created. It could be useful with Incus in cluster mode.
Location pulumi.StringOutput `pulumi:"location"`
// **Required** - Name of the storage volume.
Name pulumi.StringOutput `pulumi:"name"`
// **Required** - Name of storage pool to host the volume.
Pool pulumi.StringOutput `pulumi:"pool"`
// *Optional* - Name of the project where the volume will be stored.
Project pulumi.StringOutput `pulumi:"project"`
// *Optional* - The remote in which the resource will be created. If
// not provided, the provider's default remote will be used.
Remote pulumi.StringPtrOutput `pulumi:"remote"`
// *Optional* - Path to a backup file from which the volume will be created.
SourceFile pulumi.StringPtrOutput `pulumi:"sourceFile"`
// *Optional* - The source volume from which the volume will be created. See reference below.
SourceVolume StorageVolumeSourceVolumePtrOutput `pulumi:"sourceVolume"`
// *Optional* - Specify a target node in a cluster.
Target pulumi.StringOutput `pulumi:"target"`
// *Optional* - The "type" of volume. The default value is `custom`,
// which is the type to use for storage volumes attached to instances.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewStorageVolume registers a new resource with the given unique name, arguments, and options.
func NewStorageVolume(ctx *pulumi.Context,
name string, args *StorageVolumeArgs, opts ...pulumi.ResourceOption) (*StorageVolume, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Name == nil {
return nil, errors.New("invalid value for required argument 'Name'")
}
if args.Pool == nil {
return nil, errors.New("invalid value for required argument 'Pool'")
}
if args.Project == nil {
args.Project = pulumi.StringPtr("default")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource StorageVolume
err := ctx.RegisterResource("incus:index/storageVolume:StorageVolume", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetStorageVolume gets an existing StorageVolume resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetStorageVolume(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *StorageVolumeState, opts ...pulumi.ResourceOption) (*StorageVolume, error) {
var resource StorageVolume
err := ctx.ReadResource("incus:index/storageVolume:StorageVolume", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering StorageVolume resources.
type storageVolumeState struct {
// *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 map[string]string `pulumi:"config"`
// *Optional* - Volume content type (`filesystem` or `block`)
ContentType *string `pulumi:"contentType"`
// *Optional* - Description of the volume.
Description *string `pulumi:"description"`
// Name of the node where volume was created. It could be useful with Incus in cluster mode.
Location *string `pulumi:"location"`
// **Required** - Name of the storage volume.
Name *string `pulumi:"name"`
// **Required** - Name of storage pool to host the volume.
Pool *string `pulumi:"pool"`
// *Optional* - Name of the project where the volume will be stored.
Project *string `pulumi:"project"`
// *Optional* - The remote in which the resource will be created. If
// not provided, the provider's default remote will be used.
Remote *string `pulumi:"remote"`
// *Optional* - Path to a backup file from which the volume will be created.
SourceFile *string `pulumi:"sourceFile"`
// *Optional* - The source volume from which the volume will be created. See reference below.
SourceVolume *StorageVolumeSourceVolume `pulumi:"sourceVolume"`
// *Optional* - Specify a target node in a cluster.
Target *string `pulumi:"target"`
// *Optional* - The "type" of volume. The default value is `custom`,
// which is the type to use for storage volumes attached to instances.
Type *string `pulumi:"type"`
}
type StorageVolumeState struct {
// *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.StringMapInput
// *Optional* - Volume content type (`filesystem` or `block`)
ContentType pulumi.StringPtrInput
// *Optional* - Description of the volume.
Description pulumi.StringPtrInput
// Name of the node where volume was created. It could be useful with Incus in cluster mode.
Location pulumi.StringPtrInput
// **Required** - Name of the storage volume.
Name pulumi.StringPtrInput
// **Required** - Name of storage pool to host the volume.
Pool pulumi.StringPtrInput
// *Optional* - Name of the project where the volume will be stored.
Project pulumi.StringPtrInput
// *Optional* - The remote in which the resource will be created. If
// not provided, the provider's default remote will be used.
Remote pulumi.StringPtrInput
// *Optional* - Path to a backup file from which the volume will be created.
SourceFile pulumi.StringPtrInput
// *Optional* - The source volume from which the volume will be created. See reference below.
SourceVolume StorageVolumeSourceVolumePtrInput
// *Optional* - Specify a target node in a cluster.
Target pulumi.StringPtrInput
// *Optional* - The "type" of volume. The default value is `custom`,
// which is the type to use for storage volumes attached to instances.
Type pulumi.StringPtrInput
}
func (StorageVolumeState) ElementType() reflect.Type {
return reflect.TypeOf((*storageVolumeState)(nil)).Elem()
}
type storageVolumeArgs struct {
// *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 map[string]string `pulumi:"config"`
// *Optional* - Volume content type (`filesystem` or `block`)
ContentType *string `pulumi:"contentType"`
// *Optional* - Description of the volume.
Description *string `pulumi:"description"`
// **Required** - Name of the storage volume.
Name string `pulumi:"name"`
// **Required** - Name of storage pool to host the volume.
Pool string `pulumi:"pool"`
// *Optional* - Name of the project where the volume will be stored.
Project *string `pulumi:"project"`
// *Optional* - The remote in which the resource will be created. If
// not provided, the provider's default remote will be used.
Remote *string `pulumi:"remote"`
// *Optional* - Path to a backup file from which the volume will be created.
SourceFile *string `pulumi:"sourceFile"`
// *Optional* - The source volume from which the volume will be created. See reference below.
SourceVolume *StorageVolumeSourceVolume `pulumi:"sourceVolume"`
// *Optional* - Specify a target node in a cluster.
Target *string `pulumi:"target"`
// *Optional* - The "type" of volume. The default value is `custom`,
// which is the type to use for storage volumes attached to instances.
Type *string `pulumi:"type"`
}
// The set of arguments for constructing a StorageVolume resource.
type StorageVolumeArgs struct {
// *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.StringMapInput
// *Optional* - Volume content type (`filesystem` or `block`)
ContentType pulumi.StringPtrInput
// *Optional* - Description of the volume.
Description pulumi.StringPtrInput
// **Required** - Name of the storage volume.
Name pulumi.StringInput
// **Required** - Name of storage pool to host the volume.
Pool pulumi.StringInput
// *Optional* - Name of the project where the volume will be stored.
Project pulumi.StringPtrInput
// *Optional* - The remote in which the resource will be created. If
// not provided, the provider's default remote will be used.
Remote pulumi.StringPtrInput
// *Optional* - Path to a backup file from which the volume will be created.
SourceFile pulumi.StringPtrInput
// *Optional* - The source volume from which the volume will be created. See reference below.
SourceVolume StorageVolumeSourceVolumePtrInput
// *Optional* - Specify a target node in a cluster.
Target pulumi.StringPtrInput
// *Optional* - The "type" of volume. The default value is `custom`,
// which is the type to use for storage volumes attached to instances.
Type pulumi.StringPtrInput
}
func (StorageVolumeArgs) ElementType() reflect.Type {
return reflect.TypeOf((*storageVolumeArgs)(nil)).Elem()
}
type StorageVolumeInput interface {
pulumi.Input
ToStorageVolumeOutput() StorageVolumeOutput
ToStorageVolumeOutputWithContext(ctx context.Context) StorageVolumeOutput
}
func (*StorageVolume) ElementType() reflect.Type {
return reflect.TypeOf((**StorageVolume)(nil)).Elem()
}
func (i *StorageVolume) ToStorageVolumeOutput() StorageVolumeOutput {
return i.ToStorageVolumeOutputWithContext(context.Background())
}
func (i *StorageVolume) ToStorageVolumeOutputWithContext(ctx context.Context) StorageVolumeOutput {
return pulumi.ToOutputWithContext(ctx, i).(StorageVolumeOutput)
}
// StorageVolumeArrayInput is an input type that accepts StorageVolumeArray and StorageVolumeArrayOutput values.
// You can construct a concrete instance of `StorageVolumeArrayInput` via:
//
// StorageVolumeArray{ StorageVolumeArgs{...} }
type StorageVolumeArrayInput interface {
pulumi.Input
ToStorageVolumeArrayOutput() StorageVolumeArrayOutput
ToStorageVolumeArrayOutputWithContext(context.Context) StorageVolumeArrayOutput
}
type StorageVolumeArray []StorageVolumeInput
func (StorageVolumeArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*StorageVolume)(nil)).Elem()
}
func (i StorageVolumeArray) ToStorageVolumeArrayOutput() StorageVolumeArrayOutput {
return i.ToStorageVolumeArrayOutputWithContext(context.Background())
}
func (i StorageVolumeArray) ToStorageVolumeArrayOutputWithContext(ctx context.Context) StorageVolumeArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(StorageVolumeArrayOutput)
}
// StorageVolumeMapInput is an input type that accepts StorageVolumeMap and StorageVolumeMapOutput values.
// You can construct a concrete instance of `StorageVolumeMapInput` via:
//
// StorageVolumeMap{ "key": StorageVolumeArgs{...} }
type StorageVolumeMapInput interface {
pulumi.Input
ToStorageVolumeMapOutput() StorageVolumeMapOutput
ToStorageVolumeMapOutputWithContext(context.Context) StorageVolumeMapOutput
}
type StorageVolumeMap map[string]StorageVolumeInput
func (StorageVolumeMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*StorageVolume)(nil)).Elem()
}
func (i StorageVolumeMap) ToStorageVolumeMapOutput() StorageVolumeMapOutput {
return i.ToStorageVolumeMapOutputWithContext(context.Background())
}
func (i StorageVolumeMap) ToStorageVolumeMapOutputWithContext(ctx context.Context) StorageVolumeMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(StorageVolumeMapOutput)
}
type StorageVolumeOutput struct{ *pulumi.OutputState }
func (StorageVolumeOutput) ElementType() reflect.Type {
return reflect.TypeOf((**StorageVolume)(nil)).Elem()
}
func (o StorageVolumeOutput) ToStorageVolumeOutput() StorageVolumeOutput {
return o
}
func (o StorageVolumeOutput) ToStorageVolumeOutputWithContext(ctx context.Context) StorageVolumeOutput {
return o
}
// *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.
func (o StorageVolumeOutput) Config() pulumi.StringMapOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringMapOutput { return v.Config }).(pulumi.StringMapOutput)
}
// *Optional* - Volume content type (`filesystem` or `block`)
func (o StorageVolumeOutput) ContentType() pulumi.StringOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringOutput { return v.ContentType }).(pulumi.StringOutput)
}
// *Optional* - Description of the volume.
func (o StorageVolumeOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// Name of the node where volume was created. It could be useful with Incus in cluster mode.
func (o StorageVolumeOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// **Required** - Name of the storage volume.
func (o StorageVolumeOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// **Required** - Name of storage pool to host the volume.
func (o StorageVolumeOutput) Pool() pulumi.StringOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringOutput { return v.Pool }).(pulumi.StringOutput)
}
// *Optional* - Name of the project where the volume will be stored.
func (o StorageVolumeOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// *Optional* - The remote in which the resource will be created. If
// not provided, the provider's default remote will be used.
func (o StorageVolumeOutput) Remote() pulumi.StringPtrOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringPtrOutput { return v.Remote }).(pulumi.StringPtrOutput)
}
// *Optional* - Path to a backup file from which the volume will be created.
func (o StorageVolumeOutput) SourceFile() pulumi.StringPtrOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringPtrOutput { return v.SourceFile }).(pulumi.StringPtrOutput)
}
// *Optional* - The source volume from which the volume will be created. See reference below.
func (o StorageVolumeOutput) SourceVolume() StorageVolumeSourceVolumePtrOutput {
return o.ApplyT(func(v *StorageVolume) StorageVolumeSourceVolumePtrOutput { return v.SourceVolume }).(StorageVolumeSourceVolumePtrOutput)
}
// *Optional* - Specify a target node in a cluster.
func (o StorageVolumeOutput) Target() pulumi.StringOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringOutput { return v.Target }).(pulumi.StringOutput)
}
// *Optional* - The "type" of volume. The default value is `custom`,
// which is the type to use for storage volumes attached to instances.
func (o StorageVolumeOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *StorageVolume) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
type StorageVolumeArrayOutput struct{ *pulumi.OutputState }
func (StorageVolumeArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*StorageVolume)(nil)).Elem()
}
func (o StorageVolumeArrayOutput) ToStorageVolumeArrayOutput() StorageVolumeArrayOutput {
return o
}
func (o StorageVolumeArrayOutput) ToStorageVolumeArrayOutputWithContext(ctx context.Context) StorageVolumeArrayOutput {
return o
}
func (o StorageVolumeArrayOutput) Index(i pulumi.IntInput) StorageVolumeOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *StorageVolume {
return vs[0].([]*StorageVolume)[vs[1].(int)]
}).(StorageVolumeOutput)
}
type StorageVolumeMapOutput struct{ *pulumi.OutputState }
func (StorageVolumeMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*StorageVolume)(nil)).Elem()
}
func (o StorageVolumeMapOutput) ToStorageVolumeMapOutput() StorageVolumeMapOutput {
return o
}
func (o StorageVolumeMapOutput) ToStorageVolumeMapOutputWithContext(ctx context.Context) StorageVolumeMapOutput {
return o
}
func (o StorageVolumeMapOutput) MapIndex(k pulumi.StringInput) StorageVolumeOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *StorageVolume {
return vs[0].(map[string]*StorageVolume)[vs[1].(string)]
}).(StorageVolumeOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*StorageVolumeInput)(nil)).Elem(), &StorageVolume{})
pulumi.RegisterInputType(reflect.TypeOf((*StorageVolumeArrayInput)(nil)).Elem(), StorageVolumeArray{})
pulumi.RegisterInputType(reflect.TypeOf((*StorageVolumeMapInput)(nil)).Elem(), StorageVolumeMap{})
pulumi.RegisterOutputType(StorageVolumeOutput{})
pulumi.RegisterOutputType(StorageVolumeArrayOutput{})
pulumi.RegisterOutputType(StorageVolumeMapOutput{})
}