/
getEndpoint.go
133 lines (111 loc) · 7.56 KB
/
getEndpoint.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
// 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 v1beta1
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets an endpoint.
func LookupEndpoint(ctx *pulumi.Context, args *LookupEndpointArgs, opts ...pulumi.InvokeOption) (*LookupEndpointResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupEndpointResult
err := ctx.Invoke("google-native:servicedirectory/v1beta1:getEndpoint", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupEndpointArgs struct {
EndpointId string `pulumi:"endpointId"`
Location string `pulumi:"location"`
NamespaceId string `pulumi:"namespaceId"`
Project *string `pulumi:"project"`
ServiceId string `pulumi:"serviceId"`
}
type LookupEndpointResult struct {
// Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses like: * `8.8.8` * `8.8.8.8:53` * `test:bad:address` * `[::1]` * `[::1]:8080` Limited to 45 characters.
Address string `pulumi:"address"`
// The timestamp when the endpoint was created.
CreateTime string `pulumi:"createTime"`
// Optional. Metadata for the endpoint. This data can be consumed by service clients. Restrictions: * The entire metadata dictionary may contain up to 512 characters, spread accoss all key-value pairs. Metadata that goes beyond this limit are rejected * Valid metadata keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/). Metadata that fails to meet these requirements are rejected Note: This field is equivalent to the `annotations` field in the v1 API. They have the same syntax and read/write to the same location in Service Directory.
Metadata map[string]string `pulumi:"metadata"`
// Immutable. The resource name for the endpoint in the format `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
Name string `pulumi:"name"`
// Immutable. The Google Compute Engine network (VPC) of the endpoint in the format `projects//locations/global/networks/*`. The project must be specified by project number (project id is rejected). Incorrectly formatted networks are rejected, but no other validation is performed on this field (ex. network or project existence, reachability, or permissions).
Network string `pulumi:"network"`
// Optional. Service Directory rejects values outside of `[0, 65535]`.
Port int `pulumi:"port"`
// A globally unique identifier (in UUID4 format) for this endpoint.
Uid string `pulumi:"uid"`
// The timestamp when the endpoint was last updated.
UpdateTime string `pulumi:"updateTime"`
}
func LookupEndpointOutput(ctx *pulumi.Context, args LookupEndpointOutputArgs, opts ...pulumi.InvokeOption) LookupEndpointResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupEndpointResult, error) {
args := v.(LookupEndpointArgs)
r, err := LookupEndpoint(ctx, &args, opts...)
var s LookupEndpointResult
if r != nil {
s = *r
}
return s, err
}).(LookupEndpointResultOutput)
}
type LookupEndpointOutputArgs struct {
EndpointId pulumi.StringInput `pulumi:"endpointId"`
Location pulumi.StringInput `pulumi:"location"`
NamespaceId pulumi.StringInput `pulumi:"namespaceId"`
Project pulumi.StringPtrInput `pulumi:"project"`
ServiceId pulumi.StringInput `pulumi:"serviceId"`
}
func (LookupEndpointOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupEndpointArgs)(nil)).Elem()
}
type LookupEndpointResultOutput struct{ *pulumi.OutputState }
func (LookupEndpointResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupEndpointResult)(nil)).Elem()
}
func (o LookupEndpointResultOutput) ToLookupEndpointResultOutput() LookupEndpointResultOutput {
return o
}
func (o LookupEndpointResultOutput) ToLookupEndpointResultOutputWithContext(ctx context.Context) LookupEndpointResultOutput {
return o
}
// Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses like: * `8.8.8` * `8.8.8.8:53` * `test:bad:address` * `[::1]` * `[::1]:8080` Limited to 45 characters.
func (o LookupEndpointResultOutput) Address() pulumi.StringOutput {
return o.ApplyT(func(v LookupEndpointResult) string { return v.Address }).(pulumi.StringOutput)
}
// The timestamp when the endpoint was created.
func (o LookupEndpointResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupEndpointResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// Optional. Metadata for the endpoint. This data can be consumed by service clients. Restrictions: * The entire metadata dictionary may contain up to 512 characters, spread accoss all key-value pairs. Metadata that goes beyond this limit are rejected * Valid metadata keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/). Metadata that fails to meet these requirements are rejected Note: This field is equivalent to the `annotations` field in the v1 API. They have the same syntax and read/write to the same location in Service Directory.
func (o LookupEndpointResultOutput) Metadata() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupEndpointResult) map[string]string { return v.Metadata }).(pulumi.StringMapOutput)
}
// Immutable. The resource name for the endpoint in the format `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
func (o LookupEndpointResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupEndpointResult) string { return v.Name }).(pulumi.StringOutput)
}
// Immutable. The Google Compute Engine network (VPC) of the endpoint in the format `projects//locations/global/networks/*`. The project must be specified by project number (project id is rejected). Incorrectly formatted networks are rejected, but no other validation is performed on this field (ex. network or project existence, reachability, or permissions).
func (o LookupEndpointResultOutput) Network() pulumi.StringOutput {
return o.ApplyT(func(v LookupEndpointResult) string { return v.Network }).(pulumi.StringOutput)
}
// Optional. Service Directory rejects values outside of `[0, 65535]`.
func (o LookupEndpointResultOutput) Port() pulumi.IntOutput {
return o.ApplyT(func(v LookupEndpointResult) int { return v.Port }).(pulumi.IntOutput)
}
// A globally unique identifier (in UUID4 format) for this endpoint.
func (o LookupEndpointResultOutput) Uid() pulumi.StringOutput {
return o.ApplyT(func(v LookupEndpointResult) string { return v.Uid }).(pulumi.StringOutput)
}
// The timestamp when the endpoint was last updated.
func (o LookupEndpointResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupEndpointResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupEndpointResultOutput{})
}