wip: init go provider
This commit is contained in:
156
sdk/go/incus/getProject.go
generated
Normal file
156
sdk/go/incus/getProject.go
generated
Normal file
@@ -0,0 +1,156 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ## # Project
|
||||
//
|
||||
// Provides information about an Incus project.
|
||||
//
|
||||
// ## 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.LookupProject(ctx, &incus.LookupProjectArgs{
|
||||
// Name: "default",
|
||||
// }, nil)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// _, err = incus.NewInstance(ctx, "d1", &incus.InstanceArgs{
|
||||
// Project: pulumi.String(_default.Name),
|
||||
// Image: pulumi.String("images:debian/12"),
|
||||
// Name: pulumi.String("d1"),
|
||||
// })
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// return nil
|
||||
// })
|
||||
// }
|
||||
//
|
||||
// ```
|
||||
func LookupProject(ctx *pulumi.Context, args *LookupProjectArgs, opts ...pulumi.InvokeOption) (*LookupProjectResult, error) {
|
||||
opts = internal.PkgInvokeDefaultOpts(opts)
|
||||
var rv LookupProjectResult
|
||||
err := ctx.Invoke("incus:index/getProject:getProject", args, &rv, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &rv, nil
|
||||
}
|
||||
|
||||
// A collection of arguments for invoking getProject.
|
||||
type LookupProjectArgs 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 of the project.
|
||||
Description *string `pulumi:"description"`
|
||||
// **Required** - Name of the project.
|
||||
Name string `pulumi:"name"`
|
||||
// *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 getProject.
|
||||
type LookupProjectResult 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 of the project.
|
||||
Description string `pulumi:"description"`
|
||||
// The provider-assigned unique ID for this managed resource.
|
||||
Id string `pulumi:"id"`
|
||||
Name string `pulumi:"name"`
|
||||
Remote *string `pulumi:"remote"`
|
||||
}
|
||||
|
||||
func LookupProjectOutput(ctx *pulumi.Context, args LookupProjectOutputArgs, opts ...pulumi.InvokeOption) LookupProjectResultOutput {
|
||||
return pulumi.ToOutputWithContext(ctx.Context(), args).
|
||||
ApplyT(func(v interface{}) (LookupProjectResultOutput, error) {
|
||||
args := v.(LookupProjectArgs)
|
||||
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
|
||||
return ctx.InvokeOutput("incus:index/getProject:getProject", args, LookupProjectResultOutput{}, options).(LookupProjectResultOutput), nil
|
||||
}).(LookupProjectResultOutput)
|
||||
}
|
||||
|
||||
// A collection of arguments for invoking getProject.
|
||||
type LookupProjectOutputArgs struct {
|
||||
// Map of key/value pairs of
|
||||
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
|
||||
Config pulumi.StringMapInput `pulumi:"config"`
|
||||
// Description of the project.
|
||||
Description pulumi.StringPtrInput `pulumi:"description"`
|
||||
// **Required** - Name of the project.
|
||||
Name pulumi.StringInput `pulumi:"name"`
|
||||
// *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 (LookupProjectOutputArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*LookupProjectArgs)(nil)).Elem()
|
||||
}
|
||||
|
||||
// A collection of values returned by getProject.
|
||||
type LookupProjectResultOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (LookupProjectResultOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*LookupProjectResult)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o LookupProjectResultOutput) ToLookupProjectResultOutput() LookupProjectResultOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o LookupProjectResultOutput) ToLookupProjectResultOutputWithContext(ctx context.Context) LookupProjectResultOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
// Map of key/value pairs of
|
||||
// [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
|
||||
func (o LookupProjectResultOutput) Config() pulumi.StringMapOutput {
|
||||
return o.ApplyT(func(v LookupProjectResult) map[string]string { return v.Config }).(pulumi.StringMapOutput)
|
||||
}
|
||||
|
||||
// Description of the project.
|
||||
func (o LookupProjectResultOutput) Description() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v LookupProjectResult) string { return v.Description }).(pulumi.StringOutput)
|
||||
}
|
||||
|
||||
// The provider-assigned unique ID for this managed resource.
|
||||
func (o LookupProjectResultOutput) Id() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v LookupProjectResult) string { return v.Id }).(pulumi.StringOutput)
|
||||
}
|
||||
|
||||
func (o LookupProjectResultOutput) Name() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v LookupProjectResult) string { return v.Name }).(pulumi.StringOutput)
|
||||
}
|
||||
|
||||
func (o LookupProjectResultOutput) Remote() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v LookupProjectResult) *string { return v.Remote }).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterOutputType(LookupProjectResultOutput{})
|
||||
}
|
||||
Reference in New Issue
Block a user