generated from cloudy-sky-software/pulumi-provider-template
/
getPlacementGroup.go
89 lines (72 loc) · 2.79 KB
/
getPlacementGroup.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Code generated by pulumigen DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package placement_groups
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func LookupPlacementGroup(ctx *pulumi.Context, args *LookupPlacementGroupArgs, opts ...pulumi.InvokeOption) (*LookupPlacementGroupResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv LookupPlacementGroupResult
err := ctx.Invoke("scaleway-instances:placement_groups:getPlacementGroup", args, &rv, opts...)
if err != nil {
return nil, err
}
return rv.Defaults(), nil
}
type LookupPlacementGroupArgs struct {
// UUID of the placement group you want to get
Id string `pulumi:"id"`
// The zone you want to target
Zone string `pulumi:"zone"`
}
type LookupPlacementGroupResult struct {
Items ScalewayInstanceV1GetPlacementGroupResponse `pulumi:"items"`
}
// Defaults sets the appropriate defaults for LookupPlacementGroupResult
func (val *LookupPlacementGroupResult) Defaults() *LookupPlacementGroupResult {
if val == nil {
return nil
}
tmp := *val
tmp.Items = *tmp.Items.Defaults()
return &tmp
}
func LookupPlacementGroupOutput(ctx *pulumi.Context, args LookupPlacementGroupOutputArgs, opts ...pulumi.InvokeOption) LookupPlacementGroupResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupPlacementGroupResult, error) {
args := v.(LookupPlacementGroupArgs)
r, err := LookupPlacementGroup(ctx, &args, opts...)
var s LookupPlacementGroupResult
if r != nil {
s = *r
}
return s, err
}).(LookupPlacementGroupResultOutput)
}
type LookupPlacementGroupOutputArgs struct {
// UUID of the placement group you want to get
Id pulumi.StringInput `pulumi:"id"`
// The zone you want to target
Zone pulumi.StringInput `pulumi:"zone"`
}
func (LookupPlacementGroupOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupPlacementGroupArgs)(nil)).Elem()
}
type LookupPlacementGroupResultOutput struct{ *pulumi.OutputState }
func (LookupPlacementGroupResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupPlacementGroupResult)(nil)).Elem()
}
func (o LookupPlacementGroupResultOutput) ToLookupPlacementGroupResultOutput() LookupPlacementGroupResultOutput {
return o
}
func (o LookupPlacementGroupResultOutput) ToLookupPlacementGroupResultOutputWithContext(ctx context.Context) LookupPlacementGroupResultOutput {
return o
}
func (o LookupPlacementGroupResultOutput) Items() ScalewayInstanceV1GetPlacementGroupResponseOutput {
return o.ApplyT(func(v LookupPlacementGroupResult) ScalewayInstanceV1GetPlacementGroupResponse { return v.Items }).(ScalewayInstanceV1GetPlacementGroupResponseOutput)
}
func init() {
pulumi.RegisterOutputType(LookupPlacementGroupResultOutput{})
}