/
getServerVNCInfo.go
134 lines (114 loc) · 4.34 KB
/
getServerVNCInfo.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package sakuracloud
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information about VNC for connecting to an existing Server.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-sakuracloud/sdk/go/sakuracloud"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := sakuracloud.GetServerVNCInfo(ctx, &GetServerVNCInfoArgs{
// ServerId: sakuracloud_server.Foobar.Id,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetServerVNCInfo(ctx *pulumi.Context, args *GetServerVNCInfoArgs, opts ...pulumi.InvokeOption) (*GetServerVNCInfoResult, error) {
var rv GetServerVNCInfoResult
err := ctx.Invoke("sakuracloud:index/getServerVNCInfo:getServerVNCInfo", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getServerVNCInfo.
type GetServerVNCInfoArgs struct {
// The id of the Server.
ServerId string `pulumi:"serverId"`
// The name of zone that the Server is in (e.g. `is1a`, `tk1a`).
Zone *string `pulumi:"zone"`
}
// A collection of values returned by getServerVNCInfo.
type GetServerVNCInfoResult struct {
// The host name for connecting by VNC.
Host string `pulumi:"host"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The password for connecting by VNC.
Password string `pulumi:"password"`
// The port number for connecting by VNC.
Port int `pulumi:"port"`
ServerId string `pulumi:"serverId"`
Zone string `pulumi:"zone"`
}
func GetServerVNCInfoOutput(ctx *pulumi.Context, args GetServerVNCInfoOutputArgs, opts ...pulumi.InvokeOption) GetServerVNCInfoResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetServerVNCInfoResult, error) {
args := v.(GetServerVNCInfoArgs)
r, err := GetServerVNCInfo(ctx, &args, opts...)
return *r, err
}).(GetServerVNCInfoResultOutput)
}
// A collection of arguments for invoking getServerVNCInfo.
type GetServerVNCInfoOutputArgs struct {
// The id of the Server.
ServerId pulumi.StringInput `pulumi:"serverId"`
// The name of zone that the Server is in (e.g. `is1a`, `tk1a`).
Zone pulumi.StringPtrInput `pulumi:"zone"`
}
func (GetServerVNCInfoOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetServerVNCInfoArgs)(nil)).Elem()
}
// A collection of values returned by getServerVNCInfo.
type GetServerVNCInfoResultOutput struct{ *pulumi.OutputState }
func (GetServerVNCInfoResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetServerVNCInfoResult)(nil)).Elem()
}
func (o GetServerVNCInfoResultOutput) ToGetServerVNCInfoResultOutput() GetServerVNCInfoResultOutput {
return o
}
func (o GetServerVNCInfoResultOutput) ToGetServerVNCInfoResultOutputWithContext(ctx context.Context) GetServerVNCInfoResultOutput {
return o
}
// The host name for connecting by VNC.
func (o GetServerVNCInfoResultOutput) Host() pulumi.StringOutput {
return o.ApplyT(func(v GetServerVNCInfoResult) string { return v.Host }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetServerVNCInfoResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetServerVNCInfoResult) string { return v.Id }).(pulumi.StringOutput)
}
// The password for connecting by VNC.
func (o GetServerVNCInfoResultOutput) Password() pulumi.StringOutput {
return o.ApplyT(func(v GetServerVNCInfoResult) string { return v.Password }).(pulumi.StringOutput)
}
// The port number for connecting by VNC.
func (o GetServerVNCInfoResultOutput) Port() pulumi.IntOutput {
return o.ApplyT(func(v GetServerVNCInfoResult) int { return v.Port }).(pulumi.IntOutput)
}
func (o GetServerVNCInfoResultOutput) ServerId() pulumi.StringOutput {
return o.ApplyT(func(v GetServerVNCInfoResult) string { return v.ServerId }).(pulumi.StringOutput)
}
func (o GetServerVNCInfoResultOutput) Zone() pulumi.StringOutput {
return o.ApplyT(func(v GetServerVNCInfoResult) string { return v.Zone }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetServerVNCInfoResultOutput{})
}