wip: init go provider
This commit is contained in:
168
sdk/go/incus/getProfile.go
generated
Normal file
168
sdk/go/incus/getProfile.go
generated
Normal file
@@ -0,0 +1,168 @@
|
||||
// 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/nimbus/pulumi-incus/sdk/go/incus/internal"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
// ## # Profile
|
||||
//
|
||||
// Provides information about an Incus profile.
|
||||
//
|
||||
// ## Example Usage
|
||||
//
|
||||
// ```go
|
||||
// package main
|
||||
//
|
||||
// import (
|
||||
//
|
||||
// "git.kalinow.ski/nimbus/pulumi-incus/sdk/go/incus"
|
||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _default, err := incus.LookupProfile(ctx, &incus.LookupProfileArgs{
|
||||
// Name: "default",
|
||||
// }, nil)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// _, err = incus.NewInstance(ctx, "d1", &incus.InstanceArgs{
|
||||
// Profiles: pulumi.StringArray{
|
||||
// pulumi.String(_default.Name),
|
||||
// },
|
||||
// Image: pulumi.String("images:debian/12"),
|
||||
// Name: pulumi.String("d1"),
|
||||
// })
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// return nil
|
||||
// })
|
||||
// }
|
||||
//
|
||||
// ```
|
||||
func LookupProfile(ctx *pulumi.Context, args *LookupProfileArgs, opts ...pulumi.InvokeOption) (*LookupProfileResult, error) {
|
||||
opts = internal.PkgInvokeDefaultOpts(opts)
|
||||
var rv LookupProfileResult
|
||||
err := ctx.Invoke("incus:index/getProfile:getProfile", args, &rv, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &rv, nil
|
||||
}
|
||||
|
||||
// A collection of arguments for invoking getProfile.
|
||||
type LookupProfileArgs struct {
|
||||
// Device definition. See reference below.
|
||||
Devices []GetProfileDevice `pulumi:"devices"`
|
||||
// **Required** - Name of the profile.
|
||||
Name string `pulumi:"name"`
|
||||
// *Optional* - Name of the project where the profile will be stored.
|
||||
Project *string `pulumi:"project"`
|
||||
// *Optional* - The remote in which the resource was created. If
|
||||
// not provided, the provider's default remote will be used.
|
||||
Remote *string `pulumi:"remote"`
|
||||
}
|
||||
|
||||
// A collection of values returned by getProfile.
|
||||
type LookupProfileResult struct {
|
||||
// Map of key/value pairs of
|
||||
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
|
||||
Config map[string]string `pulumi:"config"`
|
||||
Description string `pulumi:"description"`
|
||||
// Device definition. See reference below.
|
||||
Devices []GetProfileDevice `pulumi:"devices"`
|
||||
// The provider-assigned unique ID for this managed resource.
|
||||
Id string `pulumi:"id"`
|
||||
// Name of the device.
|
||||
Name string `pulumi:"name"`
|
||||
Project *string `pulumi:"project"`
|
||||
Remote *string `pulumi:"remote"`
|
||||
}
|
||||
|
||||
func LookupProfileOutput(ctx *pulumi.Context, args LookupProfileOutputArgs, opts ...pulumi.InvokeOption) LookupProfileResultOutput {
|
||||
return pulumi.ToOutputWithContext(ctx.Context(), args).
|
||||
ApplyT(func(v interface{}) (LookupProfileResultOutput, error) {
|
||||
args := v.(LookupProfileArgs)
|
||||
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
|
||||
return ctx.InvokeOutput("incus:index/getProfile:getProfile", args, LookupProfileResultOutput{}, options).(LookupProfileResultOutput), nil
|
||||
}).(LookupProfileResultOutput)
|
||||
}
|
||||
|
||||
// A collection of arguments for invoking getProfile.
|
||||
type LookupProfileOutputArgs struct {
|
||||
// Device definition. See reference below.
|
||||
Devices GetProfileDeviceArrayInput `pulumi:"devices"`
|
||||
// **Required** - Name of the profile.
|
||||
Name pulumi.StringInput `pulumi:"name"`
|
||||
// *Optional* - Name of the project where the profile will be stored.
|
||||
Project pulumi.StringPtrInput `pulumi:"project"`
|
||||
// *Optional* - The remote in which the resource was created. If
|
||||
// not provided, the provider's default remote will be used.
|
||||
Remote pulumi.StringPtrInput `pulumi:"remote"`
|
||||
}
|
||||
|
||||
func (LookupProfileOutputArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*LookupProfileArgs)(nil)).Elem()
|
||||
}
|
||||
|
||||
// A collection of values returned by getProfile.
|
||||
type LookupProfileResultOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (LookupProfileResultOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*LookupProfileResult)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o LookupProfileResultOutput) ToLookupProfileResultOutput() LookupProfileResultOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o LookupProfileResultOutput) ToLookupProfileResultOutputWithContext(ctx context.Context) LookupProfileResultOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
// Map of key/value pairs of
|
||||
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
|
||||
func (o LookupProfileResultOutput) Config() pulumi.StringMapOutput {
|
||||
return o.ApplyT(func(v LookupProfileResult) map[string]string { return v.Config }).(pulumi.StringMapOutput)
|
||||
}
|
||||
|
||||
func (o LookupProfileResultOutput) Description() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v LookupProfileResult) string { return v.Description }).(pulumi.StringOutput)
|
||||
}
|
||||
|
||||
// Device definition. See reference below.
|
||||
func (o LookupProfileResultOutput) Devices() GetProfileDeviceArrayOutput {
|
||||
return o.ApplyT(func(v LookupProfileResult) []GetProfileDevice { return v.Devices }).(GetProfileDeviceArrayOutput)
|
||||
}
|
||||
|
||||
// The provider-assigned unique ID for this managed resource.
|
||||
func (o LookupProfileResultOutput) Id() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v LookupProfileResult) string { return v.Id }).(pulumi.StringOutput)
|
||||
}
|
||||
|
||||
// Name of the device.
|
||||
func (o LookupProfileResultOutput) Name() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v LookupProfileResult) string { return v.Name }).(pulumi.StringOutput)
|
||||
}
|
||||
|
||||
func (o LookupProfileResultOutput) Project() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v LookupProfileResult) *string { return v.Project }).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
func (o LookupProfileResultOutput) Remote() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v LookupProfileResult) *string { return v.Remote }).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterOutputType(LookupProfileResultOutput{})
|
||||
}
|
||||
Reference in New Issue
Block a user