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

353 lines
14 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 Network struct {
pulumi.CustomResourceState
// *Optional* - Map of key/value pairs of
// [network config settings](https://linuxcontainers.org/incus/docs/main/networks/).
Config pulumi.StringMapOutput `pulumi:"config"`
// *Optional* - Description of the network. `description` is mutual exclusive with `target`. The `description` can only be set on cluster level (with `target` not set) or on non-clustered setups.
Description pulumi.StringOutput `pulumi:"description"`
// Whether or not the network is managed.
Managed pulumi.BoolOutput `pulumi:"managed"`
// **Required** - Name of the network. This is usually the device the
// network will appear as to instances.
Name pulumi.StringOutput `pulumi:"name"`
// *Optional* - Name of the project where the network will be created.
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* - Specify a target node in a cluster.
Target pulumi.StringPtrOutput `pulumi:"target"`
// *Optional* - The type of network to create. Can be one of: bridge,
// macvlan, sriov, ovn, or physical. If no type is specified, a bridge network
// is created.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewNetwork registers a new resource with the given unique name, arguments, and options.
func NewNetwork(ctx *pulumi.Context,
name string, args *NetworkArgs, opts ...pulumi.ResourceOption) (*Network, 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.Project == nil {
args.Project = pulumi.StringPtr("default")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Network
err := ctx.RegisterResource("incus:index/network:Network", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetNetwork gets an existing Network 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 GetNetwork(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *NetworkState, opts ...pulumi.ResourceOption) (*Network, error) {
var resource Network
err := ctx.ReadResource("incus:index/network:Network", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Network resources.
type networkState struct {
// *Optional* - Map of key/value pairs of
// [network config settings](https://linuxcontainers.org/incus/docs/main/networks/).
Config map[string]string `pulumi:"config"`
// *Optional* - Description of the network. `description` is mutual exclusive with `target`. The `description` can only be set on cluster level (with `target` not set) or on non-clustered setups.
Description *string `pulumi:"description"`
// Whether or not the network is managed.
Managed *bool `pulumi:"managed"`
// **Required** - Name of the network. This is usually the device the
// network will appear as to instances.
Name *string `pulumi:"name"`
// *Optional* - Name of the project where the network will be created.
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* - Specify a target node in a cluster.
Target *string `pulumi:"target"`
// *Optional* - The type of network to create. Can be one of: bridge,
// macvlan, sriov, ovn, or physical. If no type is specified, a bridge network
// is created.
Type *string `pulumi:"type"`
}
type NetworkState struct {
// *Optional* - Map of key/value pairs of
// [network config settings](https://linuxcontainers.org/incus/docs/main/networks/).
Config pulumi.StringMapInput
// *Optional* - Description of the network. `description` is mutual exclusive with `target`. The `description` can only be set on cluster level (with `target` not set) or on non-clustered setups.
Description pulumi.StringPtrInput
// Whether or not the network is managed.
Managed pulumi.BoolPtrInput
// **Required** - Name of the network. This is usually the device the
// network will appear as to instances.
Name pulumi.StringPtrInput
// *Optional* - Name of the project where the network will be created.
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* - Specify a target node in a cluster.
Target pulumi.StringPtrInput
// *Optional* - The type of network to create. Can be one of: bridge,
// macvlan, sriov, ovn, or physical. If no type is specified, a bridge network
// is created.
Type pulumi.StringPtrInput
}
func (NetworkState) ElementType() reflect.Type {
return reflect.TypeOf((*networkState)(nil)).Elem()
}
type networkArgs struct {
// *Optional* - Map of key/value pairs of
// [network config settings](https://linuxcontainers.org/incus/docs/main/networks/).
Config map[string]string `pulumi:"config"`
// *Optional* - Description of the network. `description` is mutual exclusive with `target`. The `description` can only be set on cluster level (with `target` not set) or on non-clustered setups.
Description *string `pulumi:"description"`
// **Required** - Name of the network. This is usually the device the
// network will appear as to instances.
Name string `pulumi:"name"`
// *Optional* - Name of the project where the network will be created.
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* - Specify a target node in a cluster.
Target *string `pulumi:"target"`
// *Optional* - The type of network to create. Can be one of: bridge,
// macvlan, sriov, ovn, or physical. If no type is specified, a bridge network
// is created.
Type *string `pulumi:"type"`
}
// The set of arguments for constructing a Network resource.
type NetworkArgs struct {
// *Optional* - Map of key/value pairs of
// [network config settings](https://linuxcontainers.org/incus/docs/main/networks/).
Config pulumi.StringMapInput
// *Optional* - Description of the network. `description` is mutual exclusive with `target`. The `description` can only be set on cluster level (with `target` not set) or on non-clustered setups.
Description pulumi.StringPtrInput
// **Required** - Name of the network. This is usually the device the
// network will appear as to instances.
Name pulumi.StringInput
// *Optional* - Name of the project where the network will be created.
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* - Specify a target node in a cluster.
Target pulumi.StringPtrInput
// *Optional* - The type of network to create. Can be one of: bridge,
// macvlan, sriov, ovn, or physical. If no type is specified, a bridge network
// is created.
Type pulumi.StringPtrInput
}
func (NetworkArgs) ElementType() reflect.Type {
return reflect.TypeOf((*networkArgs)(nil)).Elem()
}
type NetworkInput interface {
pulumi.Input
ToNetworkOutput() NetworkOutput
ToNetworkOutputWithContext(ctx context.Context) NetworkOutput
}
func (*Network) ElementType() reflect.Type {
return reflect.TypeOf((**Network)(nil)).Elem()
}
func (i *Network) ToNetworkOutput() NetworkOutput {
return i.ToNetworkOutputWithContext(context.Background())
}
func (i *Network) ToNetworkOutputWithContext(ctx context.Context) NetworkOutput {
return pulumi.ToOutputWithContext(ctx, i).(NetworkOutput)
}
// NetworkArrayInput is an input type that accepts NetworkArray and NetworkArrayOutput values.
// You can construct a concrete instance of `NetworkArrayInput` via:
//
// NetworkArray{ NetworkArgs{...} }
type NetworkArrayInput interface {
pulumi.Input
ToNetworkArrayOutput() NetworkArrayOutput
ToNetworkArrayOutputWithContext(context.Context) NetworkArrayOutput
}
type NetworkArray []NetworkInput
func (NetworkArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Network)(nil)).Elem()
}
func (i NetworkArray) ToNetworkArrayOutput() NetworkArrayOutput {
return i.ToNetworkArrayOutputWithContext(context.Background())
}
func (i NetworkArray) ToNetworkArrayOutputWithContext(ctx context.Context) NetworkArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(NetworkArrayOutput)
}
// NetworkMapInput is an input type that accepts NetworkMap and NetworkMapOutput values.
// You can construct a concrete instance of `NetworkMapInput` via:
//
// NetworkMap{ "key": NetworkArgs{...} }
type NetworkMapInput interface {
pulumi.Input
ToNetworkMapOutput() NetworkMapOutput
ToNetworkMapOutputWithContext(context.Context) NetworkMapOutput
}
type NetworkMap map[string]NetworkInput
func (NetworkMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Network)(nil)).Elem()
}
func (i NetworkMap) ToNetworkMapOutput() NetworkMapOutput {
return i.ToNetworkMapOutputWithContext(context.Background())
}
func (i NetworkMap) ToNetworkMapOutputWithContext(ctx context.Context) NetworkMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(NetworkMapOutput)
}
type NetworkOutput struct{ *pulumi.OutputState }
func (NetworkOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Network)(nil)).Elem()
}
func (o NetworkOutput) ToNetworkOutput() NetworkOutput {
return o
}
func (o NetworkOutput) ToNetworkOutputWithContext(ctx context.Context) NetworkOutput {
return o
}
// *Optional* - Map of key/value pairs of
// [network config settings](https://linuxcontainers.org/incus/docs/main/networks/).
func (o NetworkOutput) Config() pulumi.StringMapOutput {
return o.ApplyT(func(v *Network) pulumi.StringMapOutput { return v.Config }).(pulumi.StringMapOutput)
}
// *Optional* - Description of the network. `description` is mutual exclusive with `target`. The `description` can only be set on cluster level (with `target` not set) or on non-clustered setups.
func (o NetworkOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *Network) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// Whether or not the network is managed.
func (o NetworkOutput) Managed() pulumi.BoolOutput {
return o.ApplyT(func(v *Network) pulumi.BoolOutput { return v.Managed }).(pulumi.BoolOutput)
}
// **Required** - Name of the network. This is usually the device the
// network will appear as to instances.
func (o NetworkOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Network) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// *Optional* - Name of the project where the network will be created.
func (o NetworkOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Network) 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 NetworkOutput) Remote() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Network) pulumi.StringPtrOutput { return v.Remote }).(pulumi.StringPtrOutput)
}
// *Optional* - Specify a target node in a cluster.
func (o NetworkOutput) Target() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Network) pulumi.StringPtrOutput { return v.Target }).(pulumi.StringPtrOutput)
}
// *Optional* - The type of network to create. Can be one of: bridge,
// macvlan, sriov, ovn, or physical. If no type is specified, a bridge network
// is created.
func (o NetworkOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Network) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
type NetworkArrayOutput struct{ *pulumi.OutputState }
func (NetworkArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Network)(nil)).Elem()
}
func (o NetworkArrayOutput) ToNetworkArrayOutput() NetworkArrayOutput {
return o
}
func (o NetworkArrayOutput) ToNetworkArrayOutputWithContext(ctx context.Context) NetworkArrayOutput {
return o
}
func (o NetworkArrayOutput) Index(i pulumi.IntInput) NetworkOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Network {
return vs[0].([]*Network)[vs[1].(int)]
}).(NetworkOutput)
}
type NetworkMapOutput struct{ *pulumi.OutputState }
func (NetworkMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Network)(nil)).Elem()
}
func (o NetworkMapOutput) ToNetworkMapOutput() NetworkMapOutput {
return o
}
func (o NetworkMapOutput) ToNetworkMapOutputWithContext(ctx context.Context) NetworkMapOutput {
return o
}
func (o NetworkMapOutput) MapIndex(k pulumi.StringInput) NetworkOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Network {
return vs[0].(map[string]*Network)[vs[1].(string)]
}).(NetworkOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*NetworkInput)(nil)).Elem(), &Network{})
pulumi.RegisterInputType(reflect.TypeOf((*NetworkArrayInput)(nil)).Elem(), NetworkArray{})
pulumi.RegisterInputType(reflect.TypeOf((*NetworkMapInput)(nil)).Elem(), NetworkMap{})
pulumi.RegisterOutputType(NetworkOutput{})
pulumi.RegisterOutputType(NetworkArrayOutput{})
pulumi.RegisterOutputType(NetworkMapOutput{})
}