/
getNamespace.go
138 lines (115 loc) · 5.93 KB
/
getNamespace.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
// 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 v1beta
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Returns the details of a fleet namespace.
func LookupNamespace(ctx *pulumi.Context, args *LookupNamespaceArgs, opts ...pulumi.InvokeOption) (*LookupNamespaceResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupNamespaceResult
err := ctx.Invoke("google-native:gkehub/v1beta:getNamespace", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupNamespaceArgs struct {
Location string `pulumi:"location"`
NamespaceId string `pulumi:"namespaceId"`
Project *string `pulumi:"project"`
ScopeId string `pulumi:"scopeId"`
}
type LookupNamespaceResult struct {
// When the namespace was created.
CreateTime string `pulumi:"createTime"`
// When the namespace was deleted.
DeleteTime string `pulumi:"deleteTime"`
// Optional. Labels for this Namespace.
Labels map[string]string `pulumi:"labels"`
// The resource name for the namespace `projects/{project}/locations/{location}/namespaces/{namespace}`
Name string `pulumi:"name"`
// Optional. Namespace-level cluster namespace labels. These labels are applied to the related namespace of the member clusters bound to the parent Scope. Scope-level labels (`namespace_labels` in the Fleet Scope resource) take precedence over Namespace-level labels if they share a key. Keys and values must be Kubernetes-conformant.
NamespaceLabels map[string]string `pulumi:"namespaceLabels"`
// Scope associated with the namespace
Scope string `pulumi:"scope"`
// State of the namespace resource.
State NamespaceLifecycleStateResponse `pulumi:"state"`
// Google-generated UUID for this resource. This is unique across all namespace resources. If a namespace resource is deleted and another resource with the same name is created, it gets a different uid.
Uid string `pulumi:"uid"`
// When the namespace was last updated.
UpdateTime string `pulumi:"updateTime"`
}
func LookupNamespaceOutput(ctx *pulumi.Context, args LookupNamespaceOutputArgs, opts ...pulumi.InvokeOption) LookupNamespaceResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupNamespaceResult, error) {
args := v.(LookupNamespaceArgs)
r, err := LookupNamespace(ctx, &args, opts...)
var s LookupNamespaceResult
if r != nil {
s = *r
}
return s, err
}).(LookupNamespaceResultOutput)
}
type LookupNamespaceOutputArgs struct {
Location pulumi.StringInput `pulumi:"location"`
NamespaceId pulumi.StringInput `pulumi:"namespaceId"`
Project pulumi.StringPtrInput `pulumi:"project"`
ScopeId pulumi.StringInput `pulumi:"scopeId"`
}
func (LookupNamespaceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNamespaceArgs)(nil)).Elem()
}
type LookupNamespaceResultOutput struct{ *pulumi.OutputState }
func (LookupNamespaceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNamespaceResult)(nil)).Elem()
}
func (o LookupNamespaceResultOutput) ToLookupNamespaceResultOutput() LookupNamespaceResultOutput {
return o
}
func (o LookupNamespaceResultOutput) ToLookupNamespaceResultOutputWithContext(ctx context.Context) LookupNamespaceResultOutput {
return o
}
// When the namespace was created.
func (o LookupNamespaceResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupNamespaceResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// When the namespace was deleted.
func (o LookupNamespaceResultOutput) DeleteTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupNamespaceResult) string { return v.DeleteTime }).(pulumi.StringOutput)
}
// Optional. Labels for this Namespace.
func (o LookupNamespaceResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupNamespaceResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// The resource name for the namespace `projects/{project}/locations/{location}/namespaces/{namespace}`
func (o LookupNamespaceResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupNamespaceResult) string { return v.Name }).(pulumi.StringOutput)
}
// Optional. Namespace-level cluster namespace labels. These labels are applied to the related namespace of the member clusters bound to the parent Scope. Scope-level labels (`namespace_labels` in the Fleet Scope resource) take precedence over Namespace-level labels if they share a key. Keys and values must be Kubernetes-conformant.
func (o LookupNamespaceResultOutput) NamespaceLabels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupNamespaceResult) map[string]string { return v.NamespaceLabels }).(pulumi.StringMapOutput)
}
// Scope associated with the namespace
func (o LookupNamespaceResultOutput) Scope() pulumi.StringOutput {
return o.ApplyT(func(v LookupNamespaceResult) string { return v.Scope }).(pulumi.StringOutput)
}
// State of the namespace resource.
func (o LookupNamespaceResultOutput) State() NamespaceLifecycleStateResponseOutput {
return o.ApplyT(func(v LookupNamespaceResult) NamespaceLifecycleStateResponse { return v.State }).(NamespaceLifecycleStateResponseOutput)
}
// Google-generated UUID for this resource. This is unique across all namespace resources. If a namespace resource is deleted and another resource with the same name is created, it gets a different uid.
func (o LookupNamespaceResultOutput) Uid() pulumi.StringOutput {
return o.ApplyT(func(v LookupNamespaceResult) string { return v.Uid }).(pulumi.StringOutput)
}
// When the namespace was last updated.
func (o LookupNamespaceResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupNamespaceResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupNamespaceResultOutput{})
}