Files
pulumi-incus/sdk/go/incus/instance.go

535 lines
24 KiB
Go
Generated

// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package incus
import (
"context"
"reflect"
"git.kalinow.ski/kiterun/pulumi-incus/sdk/go/incus/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Instance struct {
pulumi.CustomResourceState
// *Optional* - Map of key/value pairs of
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
Config pulumi.StringMapOutput `pulumi:"config"`
// *Optional* - Description of the instance.
Description pulumi.StringOutput `pulumi:"description"`
// *Optional* - Device definition. See reference below.
Devices InstanceDeviceArrayOutput `pulumi:"devices"`
// *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
Ephemeral pulumi.BoolOutput `pulumi:"ephemeral"`
// *Optional* - File to upload to the instance. See reference below.
Files InstanceFileArrayOutput `pulumi:"files"`
// *Optional* - Base image from which the instance will be created. Must
// specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
Image pulumi.StringPtrOutput `pulumi:"image"`
// The IPv4 Address of the instance. See Instance Network
// Access for more details.
Ipv4Address pulumi.StringOutput `pulumi:"ipv4Address"`
// The IPv6 Address of the instance. See Instance Network
// Access for more details.
Ipv6Address pulumi.StringOutput `pulumi:"ipv6Address"`
// The MAC address of the detected NIC. See Instance Network
// Access for more details.
MacAddress pulumi.StringOutput `pulumi:"macAddress"`
// **Required** - Name of the instance.
Name pulumi.StringOutput `pulumi:"name"`
// *Optional* - List of Incus config profiles to apply to the new
// instance. Profile `default` will be applied if profiles are not set (are `null`).
// However, if an empty array (`[]`) is set as a value, no profiles will be applied.
Profiles pulumi.StringArrayOutput `pulumi:"profiles"`
// *Optional* - Name of the project where the instance will be spawned.
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* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
Running pulumi.BoolOutput `pulumi:"running"`
// *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
SourceFile pulumi.StringPtrOutput `pulumi:"sourceFile"`
// *Optional* - The source instance from which the instance will be created. See reference below.
SourceInstance InstanceSourceInstancePtrOutput `pulumi:"sourceInstance"`
// The status of the instance.
Status pulumi.StringOutput `pulumi:"status"`
// *Optional* - Specify a target node in a cluster.
Target pulumi.StringOutput `pulumi:"target"`
// *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
Type pulumi.StringOutput `pulumi:"type"`
// *Optional* - WaitFor definition. See reference below.
// If `running` is set to false or instance is already running (on update), this value has no effect.
WaitFors InstanceWaitForArrayOutput `pulumi:"waitFors"`
}
// NewInstance registers a new resource with the given unique name, arguments, and options.
func NewInstance(ctx *pulumi.Context,
name string, args *InstanceArgs, opts ...pulumi.ResourceOption) (*Instance, error) {
if args == nil {
args = &InstanceArgs{}
}
if args.Project == nil {
args.Project = pulumi.StringPtr("default")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Instance
err := ctx.RegisterResource("incus:index/instance:Instance", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetInstance gets an existing Instance 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 GetInstance(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *InstanceState, opts ...pulumi.ResourceOption) (*Instance, error) {
var resource Instance
err := ctx.ReadResource("incus:index/instance:Instance", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Instance resources.
type instanceState struct {
// *Optional* - Map of key/value pairs of
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
Config map[string]string `pulumi:"config"`
// *Optional* - Description of the instance.
Description *string `pulumi:"description"`
// *Optional* - Device definition. See reference below.
Devices []InstanceDevice `pulumi:"devices"`
// *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
Ephemeral *bool `pulumi:"ephemeral"`
// *Optional* - File to upload to the instance. See reference below.
Files []InstanceFile `pulumi:"files"`
// *Optional* - Base image from which the instance will be created. Must
// specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
Image *string `pulumi:"image"`
// The IPv4 Address of the instance. See Instance Network
// Access for more details.
Ipv4Address *string `pulumi:"ipv4Address"`
// The IPv6 Address of the instance. See Instance Network
// Access for more details.
Ipv6Address *string `pulumi:"ipv6Address"`
// The MAC address of the detected NIC. See Instance Network
// Access for more details.
MacAddress *string `pulumi:"macAddress"`
// **Required** - Name of the instance.
Name *string `pulumi:"name"`
// *Optional* - List of Incus config profiles to apply to the new
// instance. Profile `default` will be applied if profiles are not set (are `null`).
// However, if an empty array (`[]`) is set as a value, no profiles will be applied.
Profiles []string `pulumi:"profiles"`
// *Optional* - Name of the project where the instance will be spawned.
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* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
Running *bool `pulumi:"running"`
// *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
SourceFile *string `pulumi:"sourceFile"`
// *Optional* - The source instance from which the instance will be created. See reference below.
SourceInstance *InstanceSourceInstance `pulumi:"sourceInstance"`
// The status of the instance.
Status *string `pulumi:"status"`
// *Optional* - Specify a target node in a cluster.
Target *string `pulumi:"target"`
// *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
Type *string `pulumi:"type"`
// *Optional* - WaitFor definition. See reference below.
// If `running` is set to false or instance is already running (on update), this value has no effect.
WaitFors []InstanceWaitFor `pulumi:"waitFors"`
}
type InstanceState struct {
// *Optional* - Map of key/value pairs of
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
Config pulumi.StringMapInput
// *Optional* - Description of the instance.
Description pulumi.StringPtrInput
// *Optional* - Device definition. See reference below.
Devices InstanceDeviceArrayInput
// *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
Ephemeral pulumi.BoolPtrInput
// *Optional* - File to upload to the instance. See reference below.
Files InstanceFileArrayInput
// *Optional* - Base image from which the instance will be created. Must
// specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
Image pulumi.StringPtrInput
// The IPv4 Address of the instance. See Instance Network
// Access for more details.
Ipv4Address pulumi.StringPtrInput
// The IPv6 Address of the instance. See Instance Network
// Access for more details.
Ipv6Address pulumi.StringPtrInput
// The MAC address of the detected NIC. See Instance Network
// Access for more details.
MacAddress pulumi.StringPtrInput
// **Required** - Name of the instance.
Name pulumi.StringPtrInput
// *Optional* - List of Incus config profiles to apply to the new
// instance. Profile `default` will be applied if profiles are not set (are `null`).
// However, if an empty array (`[]`) is set as a value, no profiles will be applied.
Profiles pulumi.StringArrayInput
// *Optional* - Name of the project where the instance will be spawned.
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* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
Running pulumi.BoolPtrInput
// *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
SourceFile pulumi.StringPtrInput
// *Optional* - The source instance from which the instance will be created. See reference below.
SourceInstance InstanceSourceInstancePtrInput
// The status of the instance.
Status pulumi.StringPtrInput
// *Optional* - Specify a target node in a cluster.
Target pulumi.StringPtrInput
// *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
Type pulumi.StringPtrInput
// *Optional* - WaitFor definition. See reference below.
// If `running` is set to false or instance is already running (on update), this value has no effect.
WaitFors InstanceWaitForArrayInput
}
func (InstanceState) ElementType() reflect.Type {
return reflect.TypeOf((*instanceState)(nil)).Elem()
}
type instanceArgs struct {
// *Optional* - Map of key/value pairs of
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
Config map[string]string `pulumi:"config"`
// *Optional* - Description of the instance.
Description *string `pulumi:"description"`
// *Optional* - Device definition. See reference below.
Devices []InstanceDevice `pulumi:"devices"`
// *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
Ephemeral *bool `pulumi:"ephemeral"`
// *Optional* - File to upload to the instance. See reference below.
Files []InstanceFile `pulumi:"files"`
// *Optional* - Base image from which the instance will be created. Must
// specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
Image *string `pulumi:"image"`
// **Required** - Name of the instance.
Name *string `pulumi:"name"`
// *Optional* - List of Incus config profiles to apply to the new
// instance. Profile `default` will be applied if profiles are not set (are `null`).
// However, if an empty array (`[]`) is set as a value, no profiles will be applied.
Profiles []string `pulumi:"profiles"`
// *Optional* - Name of the project where the instance will be spawned.
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* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
Running *bool `pulumi:"running"`
// *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
SourceFile *string `pulumi:"sourceFile"`
// *Optional* - The source instance from which the instance will be created. See reference below.
SourceInstance *InstanceSourceInstance `pulumi:"sourceInstance"`
// *Optional* - Specify a target node in a cluster.
Target *string `pulumi:"target"`
// *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
Type *string `pulumi:"type"`
// *Optional* - WaitFor definition. See reference below.
// If `running` is set to false or instance is already running (on update), this value has no effect.
WaitFors []InstanceWaitFor `pulumi:"waitFors"`
}
// The set of arguments for constructing a Instance resource.
type InstanceArgs struct {
// *Optional* - Map of key/value pairs of
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
Config pulumi.StringMapInput
// *Optional* - Description of the instance.
Description pulumi.StringPtrInput
// *Optional* - Device definition. See reference below.
Devices InstanceDeviceArrayInput
// *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
Ephemeral pulumi.BoolPtrInput
// *Optional* - File to upload to the instance. See reference below.
Files InstanceFileArrayInput
// *Optional* - Base image from which the instance will be created. Must
// specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
Image pulumi.StringPtrInput
// **Required** - Name of the instance.
Name pulumi.StringPtrInput
// *Optional* - List of Incus config profiles to apply to the new
// instance. Profile `default` will be applied if profiles are not set (are `null`).
// However, if an empty array (`[]`) is set as a value, no profiles will be applied.
Profiles pulumi.StringArrayInput
// *Optional* - Name of the project where the instance will be spawned.
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* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
Running pulumi.BoolPtrInput
// *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
SourceFile pulumi.StringPtrInput
// *Optional* - The source instance from which the instance will be created. See reference below.
SourceInstance InstanceSourceInstancePtrInput
// *Optional* - Specify a target node in a cluster.
Target pulumi.StringPtrInput
// *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
Type pulumi.StringPtrInput
// *Optional* - WaitFor definition. See reference below.
// If `running` is set to false or instance is already running (on update), this value has no effect.
WaitFors InstanceWaitForArrayInput
}
func (InstanceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*instanceArgs)(nil)).Elem()
}
type InstanceInput interface {
pulumi.Input
ToInstanceOutput() InstanceOutput
ToInstanceOutputWithContext(ctx context.Context) InstanceOutput
}
func (*Instance) ElementType() reflect.Type {
return reflect.TypeOf((**Instance)(nil)).Elem()
}
func (i *Instance) ToInstanceOutput() InstanceOutput {
return i.ToInstanceOutputWithContext(context.Background())
}
func (i *Instance) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceOutput)
}
// InstanceArrayInput is an input type that accepts InstanceArray and InstanceArrayOutput values.
// You can construct a concrete instance of `InstanceArrayInput` via:
//
// InstanceArray{ InstanceArgs{...} }
type InstanceArrayInput interface {
pulumi.Input
ToInstanceArrayOutput() InstanceArrayOutput
ToInstanceArrayOutputWithContext(context.Context) InstanceArrayOutput
}
type InstanceArray []InstanceInput
func (InstanceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Instance)(nil)).Elem()
}
func (i InstanceArray) ToInstanceArrayOutput() InstanceArrayOutput {
return i.ToInstanceArrayOutputWithContext(context.Background())
}
func (i InstanceArray) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceArrayOutput)
}
// InstanceMapInput is an input type that accepts InstanceMap and InstanceMapOutput values.
// You can construct a concrete instance of `InstanceMapInput` via:
//
// InstanceMap{ "key": InstanceArgs{...} }
type InstanceMapInput interface {
pulumi.Input
ToInstanceMapOutput() InstanceMapOutput
ToInstanceMapOutputWithContext(context.Context) InstanceMapOutput
}
type InstanceMap map[string]InstanceInput
func (InstanceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Instance)(nil)).Elem()
}
func (i InstanceMap) ToInstanceMapOutput() InstanceMapOutput {
return i.ToInstanceMapOutputWithContext(context.Background())
}
func (i InstanceMap) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceMapOutput)
}
type InstanceOutput struct{ *pulumi.OutputState }
func (InstanceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Instance)(nil)).Elem()
}
func (o InstanceOutput) ToInstanceOutput() InstanceOutput {
return o
}
func (o InstanceOutput) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput {
return o
}
// *Optional* - Map of key/value pairs of
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
func (o InstanceOutput) Config() pulumi.StringMapOutput {
return o.ApplyT(func(v *Instance) pulumi.StringMapOutput { return v.Config }).(pulumi.StringMapOutput)
}
// *Optional* - Description of the instance.
func (o InstanceOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// *Optional* - Device definition. See reference below.
func (o InstanceOutput) Devices() InstanceDeviceArrayOutput {
return o.ApplyT(func(v *Instance) InstanceDeviceArrayOutput { return v.Devices }).(InstanceDeviceArrayOutput)
}
// *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
func (o InstanceOutput) Ephemeral() pulumi.BoolOutput {
return o.ApplyT(func(v *Instance) pulumi.BoolOutput { return v.Ephemeral }).(pulumi.BoolOutput)
}
// *Optional* - File to upload to the instance. See reference below.
func (o InstanceOutput) Files() InstanceFileArrayOutput {
return o.ApplyT(func(v *Instance) InstanceFileArrayOutput { return v.Files }).(InstanceFileArrayOutput)
}
// *Optional* - Base image from which the instance will be created. Must
// specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
func (o InstanceOutput) Image() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.Image }).(pulumi.StringPtrOutput)
}
// The IPv4 Address of the instance. See Instance Network
// Access for more details.
func (o InstanceOutput) Ipv4Address() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Ipv4Address }).(pulumi.StringOutput)
}
// The IPv6 Address of the instance. See Instance Network
// Access for more details.
func (o InstanceOutput) Ipv6Address() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Ipv6Address }).(pulumi.StringOutput)
}
// The MAC address of the detected NIC. See Instance Network
// Access for more details.
func (o InstanceOutput) MacAddress() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.MacAddress }).(pulumi.StringOutput)
}
// **Required** - Name of the instance.
func (o InstanceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// *Optional* - List of Incus config profiles to apply to the new
// instance. Profile `default` will be applied if profiles are not set (are `null`).
// However, if an empty array (`[]`) is set as a value, no profiles will be applied.
func (o InstanceOutput) Profiles() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Instance) pulumi.StringArrayOutput { return v.Profiles }).(pulumi.StringArrayOutput)
}
// *Optional* - Name of the project where the instance will be spawned.
func (o InstanceOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) 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 InstanceOutput) Remote() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.Remote }).(pulumi.StringPtrOutput)
}
// *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
func (o InstanceOutput) Running() pulumi.BoolOutput {
return o.ApplyT(func(v *Instance) pulumi.BoolOutput { return v.Running }).(pulumi.BoolOutput)
}
// *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
func (o InstanceOutput) SourceFile() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.SourceFile }).(pulumi.StringPtrOutput)
}
// *Optional* - The source instance from which the instance will be created. See reference below.
func (o InstanceOutput) SourceInstance() InstanceSourceInstancePtrOutput {
return o.ApplyT(func(v *Instance) InstanceSourceInstancePtrOutput { return v.SourceInstance }).(InstanceSourceInstancePtrOutput)
}
// The status of the instance.
func (o InstanceOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// *Optional* - Specify a target node in a cluster.
func (o InstanceOutput) Target() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Target }).(pulumi.StringOutput)
}
// *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
func (o InstanceOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// *Optional* - WaitFor definition. See reference below.
// If `running` is set to false or instance is already running (on update), this value has no effect.
func (o InstanceOutput) WaitFors() InstanceWaitForArrayOutput {
return o.ApplyT(func(v *Instance) InstanceWaitForArrayOutput { return v.WaitFors }).(InstanceWaitForArrayOutput)
}
type InstanceArrayOutput struct{ *pulumi.OutputState }
func (InstanceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Instance)(nil)).Elem()
}
func (o InstanceArrayOutput) ToInstanceArrayOutput() InstanceArrayOutput {
return o
}
func (o InstanceArrayOutput) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput {
return o
}
func (o InstanceArrayOutput) Index(i pulumi.IntInput) InstanceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Instance {
return vs[0].([]*Instance)[vs[1].(int)]
}).(InstanceOutput)
}
type InstanceMapOutput struct{ *pulumi.OutputState }
func (InstanceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Instance)(nil)).Elem()
}
func (o InstanceMapOutput) ToInstanceMapOutput() InstanceMapOutput {
return o
}
func (o InstanceMapOutput) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput {
return o
}
func (o InstanceMapOutput) MapIndex(k pulumi.StringInput) InstanceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Instance {
return vs[0].(map[string]*Instance)[vs[1].(string)]
}).(InstanceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*InstanceInput)(nil)).Elem(), &Instance{})
pulumi.RegisterInputType(reflect.TypeOf((*InstanceArrayInput)(nil)).Elem(), InstanceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*InstanceMapInput)(nil)).Elem(), InstanceMap{})
pulumi.RegisterOutputType(InstanceOutput{})
pulumi.RegisterOutputType(InstanceArrayOutput{})
pulumi.RegisterOutputType(InstanceMapOutput{})
}