/
getMeshIstioService.go
211 lines (186 loc) · 8.17 KB
/
getMeshIstioService.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
// 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 monitoring
import (
"context"
"reflect"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// A Monitoring Service is the root resource under which operational aspects of a
// generic service are accessible. A service is some discrete, autonomous, and
// network-accessible unit, designed to solve an individual concern
//
// An Mesh Istio monitoring service is automatically created by GCP to monitor
// Mesh Istio services.
//
// To get more information about Service, see:
//
// * [API documentation](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services)
// * How-to Guides
// - [Service Monitoring](https://cloud.google.com/monitoring/service-monitoring)
// - [Monitoring API Documentation](https://cloud.google.com/monitoring/api/v3/)
//
// ## Example Usage
// ### Monitoring Mesh Istio Service
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/monitoring"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := monitoring.GetMeshIstioService(ctx, &monitoring.GetMeshIstioServiceArgs{
// MeshUid: "proj-573164786102",
// ServiceName: "prometheus",
// ServiceNamespace: "istio-system",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetMeshIstioService(ctx *pulumi.Context, args *GetMeshIstioServiceArgs, opts ...pulumi.InvokeOption) (*GetMeshIstioServiceResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetMeshIstioServiceResult
err := ctx.Invoke("gcp:monitoring/getMeshIstioService:getMeshIstioService", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getMeshIstioService.
type GetMeshIstioServiceArgs struct {
// Identifier for the mesh in which this Istio service is defined.
// Corresponds to the meshUid metric label in Istio metrics.
MeshUid string `pulumi:"meshUid"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// The name of the Istio service underlying this service.
// Corresponds to the destinationServiceName metric label in Istio metrics.
//
// ***
//
// Other optional fields include:
ServiceName string `pulumi:"serviceName"`
// The namespace of the Istio service underlying this service.
// Corresponds to the destinationServiceNamespace metric label in Istio metrics.
ServiceNamespace string `pulumi:"serviceNamespace"`
}
// A collection of values returned by getMeshIstioService.
type GetMeshIstioServiceResult struct {
// Name used for UI elements listing this (Monitoring) Service.
DisplayName string `pulumi:"displayName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
MeshUid string `pulumi:"meshUid"`
// The full REST resource name for this channel. The syntax is:
// `projects/[PROJECT_ID]/services/[SERVICE_ID]`.
Name string `pulumi:"name"`
Project *string `pulumi:"project"`
ServiceId string `pulumi:"serviceId"`
ServiceName string `pulumi:"serviceName"`
ServiceNamespace string `pulumi:"serviceNamespace"`
// Configuration for how to query telemetry on the Service. Structure is documented below.
Telemetries []GetMeshIstioServiceTelemetry `pulumi:"telemetries"`
UserLabels map[string]string `pulumi:"userLabels"`
}
func GetMeshIstioServiceOutput(ctx *pulumi.Context, args GetMeshIstioServiceOutputArgs, opts ...pulumi.InvokeOption) GetMeshIstioServiceResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetMeshIstioServiceResult, error) {
args := v.(GetMeshIstioServiceArgs)
r, err := GetMeshIstioService(ctx, &args, opts...)
var s GetMeshIstioServiceResult
if r != nil {
s = *r
}
return s, err
}).(GetMeshIstioServiceResultOutput)
}
// A collection of arguments for invoking getMeshIstioService.
type GetMeshIstioServiceOutputArgs struct {
// Identifier for the mesh in which this Istio service is defined.
// Corresponds to the meshUid metric label in Istio metrics.
MeshUid pulumi.StringInput `pulumi:"meshUid"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringPtrInput `pulumi:"project"`
// The name of the Istio service underlying this service.
// Corresponds to the destinationServiceName metric label in Istio metrics.
//
// ***
//
// Other optional fields include:
ServiceName pulumi.StringInput `pulumi:"serviceName"`
// The namespace of the Istio service underlying this service.
// Corresponds to the destinationServiceNamespace metric label in Istio metrics.
ServiceNamespace pulumi.StringInput `pulumi:"serviceNamespace"`
}
func (GetMeshIstioServiceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetMeshIstioServiceArgs)(nil)).Elem()
}
// A collection of values returned by getMeshIstioService.
type GetMeshIstioServiceResultOutput struct{ *pulumi.OutputState }
func (GetMeshIstioServiceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetMeshIstioServiceResult)(nil)).Elem()
}
func (o GetMeshIstioServiceResultOutput) ToGetMeshIstioServiceResultOutput() GetMeshIstioServiceResultOutput {
return o
}
func (o GetMeshIstioServiceResultOutput) ToGetMeshIstioServiceResultOutputWithContext(ctx context.Context) GetMeshIstioServiceResultOutput {
return o
}
func (o GetMeshIstioServiceResultOutput) ToOutput(ctx context.Context) pulumix.Output[GetMeshIstioServiceResult] {
return pulumix.Output[GetMeshIstioServiceResult]{
OutputState: o.OutputState,
}
}
// Name used for UI elements listing this (Monitoring) Service.
func (o GetMeshIstioServiceResultOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) string { return v.DisplayName }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetMeshIstioServiceResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetMeshIstioServiceResultOutput) MeshUid() pulumi.StringOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) string { return v.MeshUid }).(pulumi.StringOutput)
}
// The full REST resource name for this channel. The syntax is:
// `projects/[PROJECT_ID]/services/[SERVICE_ID]`.
func (o GetMeshIstioServiceResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o GetMeshIstioServiceResultOutput) Project() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) *string { return v.Project }).(pulumi.StringPtrOutput)
}
func (o GetMeshIstioServiceResultOutput) ServiceId() pulumi.StringOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) string { return v.ServiceId }).(pulumi.StringOutput)
}
func (o GetMeshIstioServiceResultOutput) ServiceName() pulumi.StringOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) string { return v.ServiceName }).(pulumi.StringOutput)
}
func (o GetMeshIstioServiceResultOutput) ServiceNamespace() pulumi.StringOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) string { return v.ServiceNamespace }).(pulumi.StringOutput)
}
// Configuration for how to query telemetry on the Service. Structure is documented below.
func (o GetMeshIstioServiceResultOutput) Telemetries() GetMeshIstioServiceTelemetryArrayOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) []GetMeshIstioServiceTelemetry { return v.Telemetries }).(GetMeshIstioServiceTelemetryArrayOutput)
}
func (o GetMeshIstioServiceResultOutput) UserLabels() pulumi.StringMapOutput {
return o.ApplyT(func(v GetMeshIstioServiceResult) map[string]string { return v.UserLabels }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(GetMeshIstioServiceResultOutput{})
}