generated from pulumi/pulumi-tf-provider-boilerplate
/
getReservedIp.go
159 lines (137 loc) · 5 KB
/
getReservedIp.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// 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 vultr
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information about a Vultr reserved IP address.
//
// ## Example Usage
//
// Get the information for a reserved IP by `label`:
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-vultr/sdk/go/vultr"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := vultr.GetReservedIp(ctx, &GetReservedIpArgs{
// Filters: []GetReservedIpFilter{
// GetReservedIpFilter{
// Name: "label",
// Values: []string{
// "my-reserved-ip-label",
// },
// },
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetReservedIp(ctx *pulumi.Context, args *GetReservedIpArgs, opts ...pulumi.InvokeOption) (*GetReservedIpResult, error) {
var rv GetReservedIpResult
err := ctx.Invoke("vultr:index/getReservedIp:getReservedIp", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getReservedIp.
type GetReservedIpArgs struct {
// Query parameters for finding reserved IP addresses.
Filters []GetReservedIpFilter `pulumi:"filters"`
}
// A collection of values returned by getReservedIp.
type GetReservedIpResult struct {
Filters []GetReservedIpFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The ID of the VPS the reserved IP is attached to.
InstanceId string `pulumi:"instanceId"`
// The IP type of the reserved IP.
IpType string `pulumi:"ipType"`
// The label of the reserved IP.
Label string `pulumi:"label"`
// The ID of the region that the reserved IP is in.
Region string `pulumi:"region"`
// The subnet of the reserved IP.
Subnet string `pulumi:"subnet"`
// The subnet size of the reserved IP.
SubnetSize int `pulumi:"subnetSize"`
}
func GetReservedIpOutput(ctx *pulumi.Context, args GetReservedIpOutputArgs, opts ...pulumi.InvokeOption) GetReservedIpResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetReservedIpResult, error) {
args := v.(GetReservedIpArgs)
r, err := GetReservedIp(ctx, &args, opts...)
var s GetReservedIpResult
if r != nil {
s = *r
}
return s, err
}).(GetReservedIpResultOutput)
}
// A collection of arguments for invoking getReservedIp.
type GetReservedIpOutputArgs struct {
// Query parameters for finding reserved IP addresses.
Filters GetReservedIpFilterArrayInput `pulumi:"filters"`
}
func (GetReservedIpOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetReservedIpArgs)(nil)).Elem()
}
// A collection of values returned by getReservedIp.
type GetReservedIpResultOutput struct{ *pulumi.OutputState }
func (GetReservedIpResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetReservedIpResult)(nil)).Elem()
}
func (o GetReservedIpResultOutput) ToGetReservedIpResultOutput() GetReservedIpResultOutput {
return o
}
func (o GetReservedIpResultOutput) ToGetReservedIpResultOutputWithContext(ctx context.Context) GetReservedIpResultOutput {
return o
}
func (o GetReservedIpResultOutput) Filters() GetReservedIpFilterArrayOutput {
return o.ApplyT(func(v GetReservedIpResult) []GetReservedIpFilter { return v.Filters }).(GetReservedIpFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetReservedIpResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetReservedIpResult) string { return v.Id }).(pulumi.StringOutput)
}
// The ID of the VPS the reserved IP is attached to.
func (o GetReservedIpResultOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v GetReservedIpResult) string { return v.InstanceId }).(pulumi.StringOutput)
}
// The IP type of the reserved IP.
func (o GetReservedIpResultOutput) IpType() pulumi.StringOutput {
return o.ApplyT(func(v GetReservedIpResult) string { return v.IpType }).(pulumi.StringOutput)
}
// The label of the reserved IP.
func (o GetReservedIpResultOutput) Label() pulumi.StringOutput {
return o.ApplyT(func(v GetReservedIpResult) string { return v.Label }).(pulumi.StringOutput)
}
// The ID of the region that the reserved IP is in.
func (o GetReservedIpResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v GetReservedIpResult) string { return v.Region }).(pulumi.StringOutput)
}
// The subnet of the reserved IP.
func (o GetReservedIpResultOutput) Subnet() pulumi.StringOutput {
return o.ApplyT(func(v GetReservedIpResult) string { return v.Subnet }).(pulumi.StringOutput)
}
// The subnet size of the reserved IP.
func (o GetReservedIpResultOutput) SubnetSize() pulumi.IntOutput {
return o.ApplyT(func(v GetReservedIpResult) int { return v.SubnetSize }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterOutputType(GetReservedIpResultOutput{})
}