generated from pulumi/pulumi-tf-provider-boilerplate
/
getVPS.go
221 lines (190 loc) · 7.37 KB
/
getVPS.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
// 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 ovh
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to retrieve information about a vps associated with your OVH Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-ovh/sdk/go/ovh"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ovh.GetVPS(ctx, &GetVPSArgs{
// ServiceName: "XXXXXX",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetVPS(ctx *pulumi.Context, args *GetVPSArgs, opts ...pulumi.InvokeOption) (*GetVPSResult, error) {
var rv GetVPSResult
err := ctx.Invoke("ovh:index/getVPS:getVPS", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getVPS.
type GetVPSArgs struct {
// The serviceName of your dedicated server.
ServiceName string `pulumi:"serviceName"`
}
// A collection of values returned by getVPS.
type GetVPSResult struct {
// The ovh cluster the vps is in
Cluster string `pulumi:"cluster"`
// The datacenter in which the vps is located
// * `datacenter.longname` - The fullname of the datacenter (ex: "Strasbourg SBG1")
// * `datacenter.name` - The short name of the datacenter (ex: "sbg1)
Datacenter map[string]string `pulumi:"datacenter"`
// The displayed name in the ovh web admin
Displayname string `pulumi:"displayname"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The list of IPs addresses attached to the vps
Ips []string `pulumi:"ips"`
// The keymap for the ip kvm, valid values "", "fr", "us"
Keymap string `pulumi:"keymap"`
// The amount of memory in MB of the vps.
Memory int `pulumi:"memory"`
// A dict describing the type of vps.
// * `model.name` - The model name (ex: model1)
// * `model.offer` - The model human description (ex: "VPS 2016 SSD 1")
// * `model.version` - The model version (ex: "2017v2")
Model map[string]string `pulumi:"model"`
Name string `pulumi:"name"`
// The source of the boot kernel
Netbootmode string `pulumi:"netbootmode"`
// The type of offer (ssd, cloud, classic)
Offertype string `pulumi:"offertype"`
ServiceName string `pulumi:"serviceName"`
// A boolean to indicate if OVH sla monitoring is active.
Slamonitoring bool `pulumi:"slamonitoring"`
// The state of the vps
State string `pulumi:"state"`
// The type of server
Type string `pulumi:"type"`
// The number of vcore of the vps
Vcore int `pulumi:"vcore"`
// The OVH zone where the vps is
Zone string `pulumi:"zone"`
}
func GetVPSOutput(ctx *pulumi.Context, args GetVPSOutputArgs, opts ...pulumi.InvokeOption) GetVPSResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetVPSResult, error) {
args := v.(GetVPSArgs)
r, err := GetVPS(ctx, &args, opts...)
var s GetVPSResult
if r != nil {
s = *r
}
return s, err
}).(GetVPSResultOutput)
}
// A collection of arguments for invoking getVPS.
type GetVPSOutputArgs struct {
// The serviceName of your dedicated server.
ServiceName pulumi.StringInput `pulumi:"serviceName"`
}
func (GetVPSOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetVPSArgs)(nil)).Elem()
}
// A collection of values returned by getVPS.
type GetVPSResultOutput struct{ *pulumi.OutputState }
func (GetVPSResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetVPSResult)(nil)).Elem()
}
func (o GetVPSResultOutput) ToGetVPSResultOutput() GetVPSResultOutput {
return o
}
func (o GetVPSResultOutput) ToGetVPSResultOutputWithContext(ctx context.Context) GetVPSResultOutput {
return o
}
// The ovh cluster the vps is in
func (o GetVPSResultOutput) Cluster() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.Cluster }).(pulumi.StringOutput)
}
// The datacenter in which the vps is located
// * `datacenter.longname` - The fullname of the datacenter (ex: "Strasbourg SBG1")
// * `datacenter.name` - The short name of the datacenter (ex: "sbg1)
func (o GetVPSResultOutput) Datacenter() pulumi.StringMapOutput {
return o.ApplyT(func(v GetVPSResult) map[string]string { return v.Datacenter }).(pulumi.StringMapOutput)
}
// The displayed name in the ovh web admin
func (o GetVPSResultOutput) Displayname() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.Displayname }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetVPSResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.Id }).(pulumi.StringOutput)
}
// The list of IPs addresses attached to the vps
func (o GetVPSResultOutput) Ips() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetVPSResult) []string { return v.Ips }).(pulumi.StringArrayOutput)
}
// The keymap for the ip kvm, valid values "", "fr", "us"
func (o GetVPSResultOutput) Keymap() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.Keymap }).(pulumi.StringOutput)
}
// The amount of memory in MB of the vps.
func (o GetVPSResultOutput) Memory() pulumi.IntOutput {
return o.ApplyT(func(v GetVPSResult) int { return v.Memory }).(pulumi.IntOutput)
}
// A dict describing the type of vps.
// * `model.name` - The model name (ex: model1)
// * `model.offer` - The model human description (ex: "VPS 2016 SSD 1")
// * `model.version` - The model version (ex: "2017v2")
func (o GetVPSResultOutput) Model() pulumi.StringMapOutput {
return o.ApplyT(func(v GetVPSResult) map[string]string { return v.Model }).(pulumi.StringMapOutput)
}
func (o GetVPSResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.Name }).(pulumi.StringOutput)
}
// The source of the boot kernel
func (o GetVPSResultOutput) Netbootmode() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.Netbootmode }).(pulumi.StringOutput)
}
// The type of offer (ssd, cloud, classic)
func (o GetVPSResultOutput) Offertype() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.Offertype }).(pulumi.StringOutput)
}
func (o GetVPSResultOutput) ServiceName() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.ServiceName }).(pulumi.StringOutput)
}
// A boolean to indicate if OVH sla monitoring is active.
func (o GetVPSResultOutput) Slamonitoring() pulumi.BoolOutput {
return o.ApplyT(func(v GetVPSResult) bool { return v.Slamonitoring }).(pulumi.BoolOutput)
}
// The state of the vps
func (o GetVPSResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.State }).(pulumi.StringOutput)
}
// The type of server
func (o GetVPSResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.Type }).(pulumi.StringOutput)
}
// The number of vcore of the vps
func (o GetVPSResultOutput) Vcore() pulumi.IntOutput {
return o.ApplyT(func(v GetVPSResult) int { return v.Vcore }).(pulumi.IntOutput)
}
// The OVH zone where the vps is
func (o GetVPSResultOutput) Zone() pulumi.StringOutput {
return o.ApplyT(func(v GetVPSResult) string { return v.Zone }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetVPSResultOutput{})
}