/
getInstance.go
164 lines (137 loc) · 7.24 KB
/
getInstance.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v2
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets details of a single Instance.
func LookupInstance(ctx *pulumi.Context, args *LookupInstanceArgs, opts ...pulumi.InvokeOption) (*LookupInstanceResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupInstanceResult
err := ctx.Invoke("google-native:notebooks/v2:getInstance", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupInstanceArgs struct {
InstanceId string `pulumi:"instanceId"`
Location string `pulumi:"location"`
Project *string `pulumi:"project"`
}
type LookupInstanceResult struct {
// Instance creation time.
CreateTime string `pulumi:"createTime"`
// Email address of entity that sent original CreateInstance request.
Creator string `pulumi:"creator"`
// Optional. If true, the notebook instance will not register with the proxy.
DisableProxyAccess bool `pulumi:"disableProxyAccess"`
// Optional. Compute Engine setup for the notebook. Uses notebook-defined fields.
GceSetup GceSetupResponse `pulumi:"gceSetup"`
// Additional information about instance health. Example: healthInfo": { "docker_proxy_agent_status": "1", "docker_status": "1", "jupyterlab_api_status": "-1", "jupyterlab_status": "-1", "updated": "2020-10-18 09:40:03.573409" }
HealthInfo map[string]string `pulumi:"healthInfo"`
// Instance health_state.
HealthState string `pulumi:"healthState"`
// Optional. Input only. The owner of this instance after creation. Format: `alias@example.com` Currently supports one owner only. If not specified, all of the service account users of your VM instance's service account can use the instance.
InstanceOwners []string `pulumi:"instanceOwners"`
// Optional. Labels to apply to this instance. These can be later modified by the UpdateInstance method.
Labels map[string]string `pulumi:"labels"`
// The name of this notebook instance. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`
Name string `pulumi:"name"`
// The proxy endpoint that is used to access the Jupyter notebook.
ProxyUri string `pulumi:"proxyUri"`
// The state of this instance.
State string `pulumi:"state"`
// Instance update time.
UpdateTime string `pulumi:"updateTime"`
// The upgrade history of this instance.
UpgradeHistory []UpgradeHistoryEntryResponse `pulumi:"upgradeHistory"`
}
func LookupInstanceOutput(ctx *pulumi.Context, args LookupInstanceOutputArgs, opts ...pulumi.InvokeOption) LookupInstanceResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupInstanceResult, error) {
args := v.(LookupInstanceArgs)
r, err := LookupInstance(ctx, &args, opts...)
var s LookupInstanceResult
if r != nil {
s = *r
}
return s, err
}).(LookupInstanceResultOutput)
}
type LookupInstanceOutputArgs struct {
InstanceId pulumi.StringInput `pulumi:"instanceId"`
Location pulumi.StringInput `pulumi:"location"`
Project pulumi.StringPtrInput `pulumi:"project"`
}
func (LookupInstanceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupInstanceArgs)(nil)).Elem()
}
type LookupInstanceResultOutput struct{ *pulumi.OutputState }
func (LookupInstanceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupInstanceResult)(nil)).Elem()
}
func (o LookupInstanceResultOutput) ToLookupInstanceResultOutput() LookupInstanceResultOutput {
return o
}
func (o LookupInstanceResultOutput) ToLookupInstanceResultOutputWithContext(ctx context.Context) LookupInstanceResultOutput {
return o
}
// Instance creation time.
func (o LookupInstanceResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// Email address of entity that sent original CreateInstance request.
func (o LookupInstanceResultOutput) Creator() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.Creator }).(pulumi.StringOutput)
}
// Optional. If true, the notebook instance will not register with the proxy.
func (o LookupInstanceResultOutput) DisableProxyAccess() pulumi.BoolOutput {
return o.ApplyT(func(v LookupInstanceResult) bool { return v.DisableProxyAccess }).(pulumi.BoolOutput)
}
// Optional. Compute Engine setup for the notebook. Uses notebook-defined fields.
func (o LookupInstanceResultOutput) GceSetup() GceSetupResponseOutput {
return o.ApplyT(func(v LookupInstanceResult) GceSetupResponse { return v.GceSetup }).(GceSetupResponseOutput)
}
// Additional information about instance health. Example: healthInfo": { "docker_proxy_agent_status": "1", "docker_status": "1", "jupyterlab_api_status": "-1", "jupyterlab_status": "-1", "updated": "2020-10-18 09:40:03.573409" }
func (o LookupInstanceResultOutput) HealthInfo() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupInstanceResult) map[string]string { return v.HealthInfo }).(pulumi.StringMapOutput)
}
// Instance health_state.
func (o LookupInstanceResultOutput) HealthState() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.HealthState }).(pulumi.StringOutput)
}
// Optional. Input only. The owner of this instance after creation. Format: `alias@example.com` Currently supports one owner only. If not specified, all of the service account users of your VM instance's service account can use the instance.
func (o LookupInstanceResultOutput) InstanceOwners() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupInstanceResult) []string { return v.InstanceOwners }).(pulumi.StringArrayOutput)
}
// Optional. Labels to apply to this instance. These can be later modified by the UpdateInstance method.
func (o LookupInstanceResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupInstanceResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// The name of this notebook instance. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`
func (o LookupInstanceResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.Name }).(pulumi.StringOutput)
}
// The proxy endpoint that is used to access the Jupyter notebook.
func (o LookupInstanceResultOutput) ProxyUri() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.ProxyUri }).(pulumi.StringOutput)
}
// The state of this instance.
func (o LookupInstanceResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.State }).(pulumi.StringOutput)
}
// Instance update time.
func (o LookupInstanceResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
// The upgrade history of this instance.
func (o LookupInstanceResultOutput) UpgradeHistory() UpgradeHistoryEntryResponseArrayOutput {
return o.ApplyT(func(v LookupInstanceResult) []UpgradeHistoryEntryResponse { return v.UpgradeHistory }).(UpgradeHistoryEntryResponseArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupInstanceResultOutput{})
}